@eidola.app/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/{cli.js → dist/cli.js} +0 -0
- package/dist/package.json +42 -0
- package/{shrine/renderer/assets/index-C44XsM0B.js → dist/shrine/renderer/assets/index-DK53vjQa.js} +109 -23
- package/{shrine/renderer/assets/index-DeRYP3aH.css → dist/shrine/renderer/assets/index-DXxigoPT.css} +1 -1
- package/{shrine → dist/shrine}/renderer/index.html +2 -2
- package/package.json +25 -8
- /package/{cli.d.ts → dist/cli.d.ts} +0 -0
- /package/{cli.d.ts.map → dist/cli.d.ts.map} +0 -0
- /package/{cli.js.map → dist/cli.js.map} +0 -0
- /package/{config.d.ts → dist/config.d.ts} +0 -0
- /package/{config.d.ts.map → dist/config.d.ts.map} +0 -0
- /package/{config.js → dist/config.js} +0 -0
- /package/{config.js.map → dist/config.js.map} +0 -0
- /package/{cursor → dist/cursor}/auto-activate.d.ts +0 -0
- /package/{cursor → dist/cursor}/auto-activate.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/auto-activate.js +0 -0
- /package/{cursor → dist/cursor}/auto-activate.js.map +0 -0
- /package/{cursor → dist/cursor}/compile.d.ts +0 -0
- /package/{cursor → dist/cursor}/compile.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/compile.js +0 -0
- /package/{cursor → dist/cursor}/compile.js.map +0 -0
- /package/{cursor → dist/cursor}/ensure-shrine.d.ts +0 -0
- /package/{cursor → dist/cursor}/ensure-shrine.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/ensure-shrine.js +0 -0
- /package/{cursor → dist/cursor}/ensure-shrine.js.map +0 -0
- /package/{cursor → dist/cursor}/hash.d.ts +0 -0
- /package/{cursor → dist/cursor}/hash.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/hash.js +0 -0
- /package/{cursor → dist/cursor}/hash.js.map +0 -0
- /package/{cursor → dist/cursor}/shrine-lock.d.ts +0 -0
- /package/{cursor → dist/cursor}/shrine-lock.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/shrine-lock.js +0 -0
- /package/{cursor → dist/cursor}/shrine-lock.js.map +0 -0
- /package/{cursor → dist/cursor}/shrine-surface.d.ts +0 -0
- /package/{cursor → dist/cursor}/shrine-surface.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/shrine-surface.js +0 -0
- /package/{cursor → dist/cursor}/shrine-surface.js.map +0 -0
- /package/{cursor → dist/cursor}/soul-source.d.ts +0 -0
- /package/{cursor → dist/cursor}/soul-source.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/soul-source.js +0 -0
- /package/{cursor → dist/cursor}/soul-source.js.map +0 -0
- /package/{cursor → dist/cursor}/stale.d.ts +0 -0
- /package/{cursor → dist/cursor}/stale.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/stale.js +0 -0
- /package/{cursor → dist/cursor}/stale.js.map +0 -0
- /package/{cursor → dist/cursor}/types.d.ts +0 -0
- /package/{cursor → dist/cursor}/types.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/types.js +0 -0
- /package/{cursor → dist/cursor}/types.js.map +0 -0
- /package/{cursor → dist/cursor}/workspace-config.d.ts +0 -0
- /package/{cursor → dist/cursor}/workspace-config.d.ts.map +0 -0
- /package/{cursor → dist/cursor}/workspace-config.js +0 -0
- /package/{cursor → dist/cursor}/workspace-config.js.map +0 -0
- /package/{engram → dist/engram}/loader.d.ts +0 -0
- /package/{engram → dist/engram}/loader.d.ts.map +0 -0
- /package/{engram → dist/engram}/loader.js +0 -0
- /package/{engram → dist/engram}/loader.js.map +0 -0
- /package/{engram → dist/engram}/parse.d.ts +0 -0
- /package/{engram → dist/engram}/parse.d.ts.map +0 -0
- /package/{engram → dist/engram}/parse.js +0 -0
- /package/{engram → dist/engram}/parse.js.map +0 -0
- /package/{engram → dist/engram}/registry.d.ts +0 -0
- /package/{engram → dist/engram}/registry.d.ts.map +0 -0
- /package/{engram → dist/engram}/registry.js +0 -0
- /package/{engram → dist/engram}/registry.js.map +0 -0
- /package/{engram → dist/engram}/types.d.ts +0 -0
- /package/{engram → dist/engram}/types.d.ts.map +0 -0
- /package/{engram → dist/engram}/types.js +0 -0
- /package/{engram → dist/engram}/types.js.map +0 -0
- /package/{engram → dist/engram}/validate.d.ts +0 -0
- /package/{engram → dist/engram}/validate.d.ts.map +0 -0
- /package/{engram → dist/engram}/validate.js +0 -0
- /package/{engram → dist/engram}/validate.js.map +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.d.ts.map → dist/index.d.ts.map} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{index.js.map → dist/index.js.map} +0 -0
- /package/{migrations → dist/migrations}/json-to-directory.d.ts +0 -0
- /package/{migrations → dist/migrations}/json-to-directory.d.ts.map +0 -0
- /package/{migrations → dist/migrations}/json-to-directory.js +0 -0
- /package/{migrations → dist/migrations}/json-to-directory.js.map +0 -0
- /package/{migrations → dist/migrations}/types.d.ts +0 -0
- /package/{migrations → dist/migrations}/types.d.ts.map +0 -0
- /package/{migrations → dist/migrations}/types.js +0 -0
- /package/{migrations → dist/migrations}/types.js.map +0 -0
- /package/{server.d.ts → dist/server.d.ts} +0 -0
- /package/{server.d.ts.map → dist/server.d.ts.map} +0 -0
- /package/{server.js → dist/server.js} +0 -0
- /package/{server.js.map → dist/server.js.map} +0 -0
- /package/{session → dist/session}/state.d.ts +0 -0
- /package/{session → dist/session}/state.d.ts.map +0 -0
- /package/{session → dist/session}/state.js +0 -0
- /package/{session → dist/session}/state.js.map +0 -0
- /package/{shrine → dist/shrine}/server/display-config.d.ts +0 -0
- /package/{shrine → dist/shrine}/server/display-config.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/server/display-config.js +0 -0
- /package/{shrine → dist/shrine}/server/display-config.js.map +0 -0
- /package/{shrine → dist/shrine}/server/index.d.ts +0 -0
- /package/{shrine → dist/shrine}/server/index.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/server/index.js +0 -0
- /package/{shrine → dist/shrine}/server/index.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.js +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.test.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.test.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.test.js +0 -0
- /package/{shrine → dist/shrine}/shared/approval-idle-logic.test.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.js +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.test.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.test.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.test.js +0 -0
- /package/{shrine → dist/shrine}/shared/kraken-detect.test.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-api.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-api.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-api.js +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-api.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.js +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.test.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.test.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.test.js +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-display-config.test.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-state-colors.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-state-colors.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-state-colors.js +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-state-colors.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.js +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.test.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.test.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.test.js +0 -0
- /package/{shrine → dist/shrine}/shared/shrine-surface.test.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.js +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.test.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.test.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.test.js +0 -0
- /package/{shrine → dist/shrine}/shared/state-socket-client.test.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/types.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/types.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/types.js +0 -0
- /package/{shrine → dist/shrine}/shared/types.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/types.test.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/types.test.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/types.test.js +0 -0
- /package/{shrine → dist/shrine}/shared/types.test.js.map +0 -0
- /package/{shrine → dist/shrine}/shared/vessel-resolver.d.ts +0 -0
- /package/{shrine → dist/shrine}/shared/vessel-resolver.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/shared/vessel-resolver.js +0 -0
- /package/{shrine → dist/shrine}/shared/vessel-resolver.js.map +0 -0
- /package/{shrine → dist/shrine}/vendor/mcp.d.ts +0 -0
- /package/{shrine → dist/shrine}/vendor/mcp.d.ts.map +0 -0
- /package/{shrine → dist/shrine}/vendor/mcp.js +0 -0
- /package/{shrine → dist/shrine}/vendor/mcp.js.map +0 -0
- /package/{socket → dist/socket}/expression.d.ts +0 -0
- /package/{socket → dist/socket}/expression.d.ts.map +0 -0
- /package/{socket → dist/socket}/expression.js +0 -0
- /package/{socket → dist/socket}/expression.js.map +0 -0
- /package/{socket → dist/socket}/protocol.d.ts +0 -0
- /package/{socket → dist/socket}/protocol.d.ts.map +0 -0
- /package/{socket → dist/socket}/protocol.js +0 -0
- /package/{socket → dist/socket}/protocol.js.map +0 -0
- /package/{socket → dist/socket}/server.d.ts +0 -0
- /package/{socket → dist/socket}/server.d.ts.map +0 -0
- /package/{socket → dist/socket}/server.js +0 -0
- /package/{socket → dist/socket}/server.js.map +0 -0
- /package/{socket → dist/socket}/types.d.ts +0 -0
- /package/{socket → dist/socket}/types.d.ts.map +0 -0
- /package/{socket → dist/socket}/types.js +0 -0
- /package/{socket → dist/socket}/types.js.map +0 -0
- /package/{socket → dist/socket}/visual-turn.d.ts +0 -0
- /package/{socket → dist/socket}/visual-turn.d.ts.map +0 -0
- /package/{socket → dist/socket}/visual-turn.js +0 -0
- /package/{socket → dist/socket}/visual-turn.js.map +0 -0
- /package/{soul → dist/soul}/injection.d.ts +0 -0
- /package/{soul → dist/soul}/injection.d.ts.map +0 -0
- /package/{soul → dist/soul}/injection.js +0 -0
- /package/{soul → dist/soul}/injection.js.map +0 -0
- /package/{soul → dist/soul}/reinject.d.ts +0 -0
- /package/{soul → dist/soul}/reinject.d.ts.map +0 -0
- /package/{soul → dist/soul}/reinject.js +0 -0
- /package/{soul → dist/soul}/reinject.js.map +0 -0
- /package/{tools → dist/tools}/handlers.d.ts +0 -0
- /package/{tools → dist/tools}/handlers.d.ts.map +0 -0
- /package/{tools → dist/tools}/handlers.js +0 -0
- /package/{tools → dist/tools}/handlers.js.map +0 -0
- /package/{tools → dist/tools}/register.d.ts +0 -0
- /package/{tools → dist/tools}/register.d.ts.map +0 -0
- /package/{tools → dist/tools}/register.js +0 -0
- /package/{tools → dist/tools}/register.js.map +0 -0
- /package/{vendor → dist/vendor}/tool-state-pkg/index.d.ts +0 -0
- /package/{vendor → dist/vendor}/tool-state-pkg/index.d.ts.map +0 -0
- /package/{vendor → dist/vendor}/tool-state-pkg/index.js +0 -0
- /package/{vendor → dist/vendor}/tool-state-pkg/index.js.map +0 -0
- /package/{vendor → dist/vendor}/tool-state.d.ts +0 -0
- /package/{vendor → dist/vendor}/tool-state.d.ts.map +0 -0
- /package/{vendor → dist/vendor}/tool-state.js +0 -0
- /package/{vendor → dist/vendor}/tool-state.js.map +0 -0
- /package/{watch → dist/watch}/filesystem.d.ts +0 -0
- /package/{watch → dist/watch}/filesystem.d.ts.map +0 -0
- /package/{watch → dist/watch}/filesystem.js +0 -0
- /package/{watch → dist/watch}/filesystem.js.map +0 -0
package/{shrine/renderer/assets/index-C44XsM0B.js → dist/shrine/renderer/assets/index-DK53vjQa.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();const WORKING_CLUSTER$1=["thinking","searching","writing","working"];function isWorkingClusterState(i){return WORKING_CLUSTER$1.includes(i)}function resolveVisualState({state:i,firstToolStarted:e}){return isWorkingClusterState(i)?i==="thinking"&&!e?"thinking":"working":i}function getDefaultExportFromCjs(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var lottie$2={exports:{}},lottie$1=lottie$2.exports,hasRequiredLottie;function requireLottie(){return hasRequiredLottie||(hasRequiredLottie=1,(function(module,exports){typeof document<"u"&&typeof navigator<"u"&&(function(i,e){module.exports=e()})(lottie$1,(function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(i){return document.createElement(i)}function extendPrototype(i,e){var t,n=i.length,r;for(t=0;t<n;t+=1){r=i[t].prototype;for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e.prototype[s]=r[s])}}function getDescriptor(i,e){return Object.getOwnPropertyDescriptor(i,e)}function createProxyFunction(i){function e(){}return e.prototype=i,e}var audioControllerFactory=(function(){function i(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return i.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].pause()},resume:function(){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].resume()},setRate:function(t){var n,r=this.audios.length;for(n=0;n<r;n+=1)this.audios[n].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):window.Howl?new window.Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new i}})(),createTypedArray=(function(){function i(t,n){var r=0,s=[],a;switch(t){case"int16":case"uint8c":a=1;break;default:a=1.1;break}for(r=0;r<n;r+=1)s.push(a);return s}function e(t,n){return t==="float32"?new Float32Array(n):t==="int16"?new Int16Array(n):t==="uint8c"?new Uint8ClampedArray(n):i(t,n)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:i})();function createSizedArray(i){return Array.apply(null,{length:i})}function _typeof$6(i){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(i)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var i=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e,t=i.length;for(e=0;e<t;e+=1)BMMath[i[e]]=Math[i[e]]})(),BMMath.random=Math.random,BMMath.abs=function(i){var e=_typeof$6(i);if(e==="object"&&i.length){var t=createSizedArray(i.length),n,r=i.length;for(n=0;n<r;n+=1)t[n]=Math.abs(i[n]);return t}return Math.abs(i)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(i){i.style.position="absolute",i.style.top=0,i.style.left=0,i.style.display="block",i.style.transformOrigin="0 0",i.style.webkitTransformOrigin="0 0",i.style.backfaceVisibility="visible",i.style.webkitBackfaceVisibility="visible",i.style.transformStyle="preserve-3d",i.style.webkitTransformStyle="preserve-3d",i.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(i,e,t,n){this.type=i,this.currentTime=e,this.totalTime=t,this.direction=n<0?-1:1}function BMCompleteEvent(i,e){this.type=i,this.direction=e<0?-1:1}function BMCompleteLoopEvent(i,e,t,n){this.type=i,this.currentLoop=t,this.totalLoops=e,this.direction=n<0?-1:1}function BMSegmentStartEvent(i,e,t){this.type=i,this.firstFrame=e,this.totalFrames=t}function BMDestroyEvent(i,e){this.type=i,this.target=e}function BMRenderFrameErrorEvent(i,e){this.type="renderFrameError",this.nativeError=i,this.currentTime=e}function BMConfigErrorEvent(i){this.type="configError",this.nativeError=i}var createElementID=(function(){var i=0;return function(){return i+=1,idPrefix$1+"__lottie_element_"+i}})();function HSVtoRGB(i,e,t){var n,r,s,a,o,l,h,u;switch(a=Math.floor(i*6),o=i*6-a,l=t*(1-e),h=t*(1-o*e),u=t*(1-(1-o)*e),a%6){case 0:n=t,r=u,s=l;break;case 1:n=h,r=t,s=l;break;case 2:n=l,r=t,s=u;break;case 3:n=l,r=h,s=t;break;case 4:n=u,r=l,s=t;break;case 5:n=t,r=l,s=h;break}return[n,r,s]}function RGBtoHSV(i,e,t){var n=Math.max(i,e,t),r=Math.min(i,e,t),s=n-r,a,o=n===0?0:s/n,l=n/255;switch(n){case r:a=0;break;case i:a=e-t+s*(e<t?6:0),a/=6*s;break;case e:a=t-i+s*2,a/=6*s;break;case t:a=i-e+s*4,a/=6*s;break}return[a,o,l]}function addSaturationToRGB(i,e){var t=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return t[1]+=e,t[1]>1?t[1]=1:t[1]<=0&&(t[1]=0),HSVtoRGB(t[0],t[1],t[2])}function addBrightnessToRGB(i,e){var t=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return t[2]+=e,t[2]>1?t[2]=1:t[2]<0&&(t[2]=0),HSVtoRGB(t[0],t[1],t[2])}function addHueToRGB(i,e){var t=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return t[0]+=e/360,t[0]>1?t[0]-=1:t[0]<0&&(t[0]+=1),HSVtoRGB(t[0],t[1],t[2])}var rgbToHex=(function(){var i=[],e,t;for(e=0;e<256;e+=1)t=e.toString(16),i[e]=t.length===1?"0"+t:t;return function(n,r,s){return n<0&&(n=0),r<0&&(r=0),s<0&&(s=0),"#"+i[n]+i[r]+i[s]}})(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(i){return document.createElementNS(svgNS,i)}function _typeof$5(i){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(i)}var dataManager=(function(){var i=1,e=[],t,n,r={onmessage:function(){},postMessage:function(p){t({data:p})}},s={postMessage:function(p){r.onmessage({data:p})}};function a(f){if(window.Worker&&window.Blob&&getWebWorker()){var p=new Blob(["var _workerSelf = self; self.onmessage = ",f.toString()],{type:"text/javascript"}),m=URL.createObjectURL(p);return new Worker(m)}return t=f,r}function o(){n||(n=a(function(p){function m(){function y(O,C){var L,E,T=O.length,k,B,ee,oe;for(E=0;E<T;E+=1)if(L=O[E],"ks"in L&&!L.completed){if(L.completed=!0,L.hasMask){var X=L.masksProperties;for(B=X.length,k=0;k<B;k+=1)if(X[k].pt.k.i)b(X[k].pt.k);else for(oe=X[k].pt.k.length,ee=0;ee<oe;ee+=1)X[k].pt.k[ee].s&&b(X[k].pt.k[ee].s[0]),X[k].pt.k[ee].e&&b(X[k].pt.k[ee].e[0])}L.ty===0?(L.layers=v(L.refId,C),y(L.layers,C)):L.ty===4?_(L.shapes):L.ty===5&&G(L)}}function c(O,C){if(O){var L=0,E=O.length;for(L=0;L<E;L+=1)O[L].t===1&&(O[L].data.layers=v(O[L].data.refId,C),y(O[L].data.layers,C))}}function x(O,C){for(var L=0,E=C.length;L<E;){if(C[L].id===O)return C[L];L+=1}return null}function v(O,C){var L=x(O,C);return L?L.layers.__used?JSON.parse(JSON.stringify(L.layers)):(L.layers.__used=!0,L.layers):null}function _(O){var C,L=O.length,E,T;for(C=L-1;C>=0;C-=1)if(O[C].ty==="sh")if(O[C].ks.k.i)b(O[C].ks.k);else for(T=O[C].ks.k.length,E=0;E<T;E+=1)O[C].ks.k[E].s&&b(O[C].ks.k[E].s[0]),O[C].ks.k[E].e&&b(O[C].ks.k[E].e[0]);else O[C].ty==="gr"&&_(O[C].it)}function b(O){var C,L=O.i.length;for(C=0;C<L;C+=1)O.i[C][0]+=O.v[C][0],O.i[C][1]+=O.v[C][1],O.o[C][0]+=O.v[C][0],O.o[C][1]+=O.v[C][1]}function M(O,C){var L=C?C.split("."):[100,100,100];return O[0]>L[0]?!0:L[0]>O[0]?!1:O[1]>L[1]?!0:L[1]>O[1]?!1:O[2]>L[2]?!0:L[2]>O[2]?!1:null}var A=(function(){var O=[4,4,14];function C(E){var T=E.t.d;E.t.d={k:[{s:T,t:0}]}}function L(E){var T,k=E.length;for(T=0;T<k;T+=1)E[T].ty===5&&C(E[T])}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})(),R=(function(){var O=[4,7,99];return function(C){if(C.chars&&!M(O,C.v)){var L,E=C.chars.length;for(L=0;L<E;L+=1){var T=C.chars[L];T.data&&T.data.shapes&&(_(T.data.shapes),T.data.ip=0,T.data.op=99999,T.data.st=0,T.data.sr=1,T.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},C.chars[L].t||(T.data.shapes.push({ty:"no"}),T.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}})(),w=(function(){var O=[5,7,15];function C(E){var T=E.t.p;typeof T.a=="number"&&(T.a={a:0,k:T.a}),typeof T.p=="number"&&(T.p={a:0,k:T.p}),typeof T.r=="number"&&(T.r={a:0,k:T.r})}function L(E){var T,k=E.length;for(T=0;T<k;T+=1)E[T].ty===5&&C(E[T])}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})(),P=(function(){var O=[4,1,9];function C(E){var T,k=E.length,B,ee;for(T=0;T<k;T+=1)if(E[T].ty==="gr")C(E[T].it);else if(E[T].ty==="fl"||E[T].ty==="st")if(E[T].c.k&&E[T].c.k[0].i)for(ee=E[T].c.k.length,B=0;B<ee;B+=1)E[T].c.k[B].s&&(E[T].c.k[B].s[0]/=255,E[T].c.k[B].s[1]/=255,E[T].c.k[B].s[2]/=255,E[T].c.k[B].s[3]/=255),E[T].c.k[B].e&&(E[T].c.k[B].e[0]/=255,E[T].c.k[B].e[1]/=255,E[T].c.k[B].e[2]/=255,E[T].c.k[B].e[3]/=255);else E[T].c.k[0]/=255,E[T].c.k[1]/=255,E[T].c.k[2]/=255,E[T].c.k[3]/=255}function L(E){var T,k=E.length;for(T=0;T<k;T+=1)E[T].ty===4&&C(E[T].shapes)}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})(),N=(function(){var O=[4,4,18];function C(E){var T,k=E.length,B,ee;for(T=k-1;T>=0;T-=1)if(E[T].ty==="sh")if(E[T].ks.k.i)E[T].ks.k.c=E[T].closed;else for(ee=E[T].ks.k.length,B=0;B<ee;B+=1)E[T].ks.k[B].s&&(E[T].ks.k[B].s[0].c=E[T].closed),E[T].ks.k[B].e&&(E[T].ks.k[B].e[0].c=E[T].closed);else E[T].ty==="gr"&&C(E[T].it)}function L(E){var T,k,B=E.length,ee,oe,X,Q;for(k=0;k<B;k+=1){if(T=E[k],T.hasMask){var ne=T.masksProperties;for(oe=ne.length,ee=0;ee<oe;ee+=1)if(ne[ee].pt.k.i)ne[ee].pt.k.c=ne[ee].cl;else for(Q=ne[ee].pt.k.length,X=0;X<Q;X+=1)ne[ee].pt.k[X].s&&(ne[ee].pt.k[X].s[0].c=ne[ee].cl),ne[ee].pt.k[X].e&&(ne[ee].pt.k[X].e[0].c=ne[ee].cl)}T.ty===4&&C(T.shapes)}}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})();function V(O){O.__complete||(P(O),A(O),R(O),w(O),N(O),y(O.layers,O.assets),c(O.chars,O.assets),O.__complete=!0)}function G(O){O.t.a.length===0&&"m"in O.t.p}var H={};return H.completeData=V,H.checkColors=P,H.checkChars=R,H.checkPathProperties=w,H.checkShapes=N,H.completeLayers=y,H}if(s.dataManager||(s.dataManager=m()),s.assetLoader||(s.assetLoader=(function(){function y(x){var v=x.getResponseHeader("content-type");return v&&x.responseType==="json"&&v.indexOf("json")!==-1||x.response&&_typeof$5(x.response)==="object"?x.response:x.response&&typeof x.response=="string"?JSON.parse(x.response):x.responseText?JSON.parse(x.responseText):null}function c(x,v,_,b){var M,A=new XMLHttpRequest;try{A.responseType="json"}catch{}A.onreadystatechange=function(){if(A.readyState===4)if(A.status===200)M=y(A),_(M);else try{M=y(A),_(M)}catch(R){b&&b(R)}};try{A.open(["G","E","T"].join(""),x,!0)}catch{A.open(["G","E","T"].join(""),v+"/"+x,!0)}A.send()}return{load:c}})()),p.data.type==="loadAnimation")s.assetLoader.load(p.data.path,p.data.fullPath,function(y){s.dataManager.completeData(y),s.postMessage({id:p.data.id,payload:y,status:"success"})},function(){s.postMessage({id:p.data.id,status:"error"})});else if(p.data.type==="complete"){var g=p.data.animation;s.dataManager.completeData(g),s.postMessage({id:p.data.id,payload:g,status:"success"})}else p.data.type==="loadData"&&s.assetLoader.load(p.data.path,p.data.fullPath,function(y){s.postMessage({id:p.data.id,payload:y,status:"success"})},function(){s.postMessage({id:p.data.id,status:"error"})})}),n.onmessage=function(f){var p=f.data,m=p.id,g=e[m];e[m]=null,p.status==="success"?g.onComplete(p.payload):g.onError&&g.onError()})}function l(f,p){i+=1;var m="processId_"+i;return e[m]={onComplete:f,onError:p},m}function h(f,p,m){o();var g=l(p,m);n.postMessage({type:"loadAnimation",path:f,fullPath:window.location.origin+window.location.pathname,id:g})}function u(f,p,m){o();var g=l(p,m);n.postMessage({type:"loadData",path:f,fullPath:window.location.origin+window.location.pathname,id:g})}function d(f,p,m){o();var g=l(p,m);n.postMessage({type:"complete",animation:f,id:g})}return{loadAnimation:h,loadData:u,completeAnimation:d}})(),ImagePreloader=(function(){var i=(function(){var c=createTag("canvas");c.width=1,c.height=1;var x=c.getContext("2d");return x.fillStyle="rgba(0,0,0,0)",x.fillRect(0,0,1,1),c})();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function t(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(c,x,v){var _="";if(c.e)_=c.p;else if(x){var b=c.p;b.indexOf("images/")!==-1&&(b=b.split("/")[1]),_=x+b}else _=v,_+=c.u?c.u:"",_+=c.p;return _}function r(c){var x=0,v=setInterval((function(){var _=c.getBBox();(_.width||x>500)&&(this._imageLoaded(),clearInterval(v)),x+=1}).bind(this),50)}function s(c){var x=n(c,this.assetsPath,this.path),v=createNS("image");isSafari?this.testImageLoaded(v):v.addEventListener("load",this._imageLoaded,!1),v.addEventListener("error",(function(){_.img=i,this._imageLoaded()}).bind(this),!1),v.setAttributeNS("http://www.w3.org/1999/xlink","href",x),this._elementHelper.append?this._elementHelper.append(v):this._elementHelper.appendChild(v);var _={img:v,assetData:c};return _}function a(c){var x=n(c,this.assetsPath,this.path),v=createTag("img");v.crossOrigin="anonymous",v.addEventListener("load",this._imageLoaded,!1),v.addEventListener("error",(function(){_.img=i,this._imageLoaded()}).bind(this),!1),v.src=x;var _={img:v,assetData:c};return _}function o(c){var x={assetData:c},v=n(c,this.assetsPath,this.path);return dataManager.loadData(v,(function(_){x.img=_,this._footageLoaded()}).bind(this),(function(){x.img={},this._footageLoaded()}).bind(this)),x}function l(c,x){this.imagesLoadedCb=x;var v,_=c.length;for(v=0;v<_;v+=1)c[v].layers||(!c[v].t||c[v].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(c[v]))):c[v].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(c[v]))))}function h(c){this.path=c||""}function u(c){this.assetsPath=c||""}function d(c){for(var x=0,v=this.images.length;x<v;){if(this.images[x].assetData===c)return this.images[x].img;x+=1}return null}function f(){this.imagesLoadedCb=null,this.images.length=0}function p(){return this.totalImages===this.loadedAssets}function m(){return this.totalFootages===this.loadedFootagesCount}function g(c,x){c==="svg"?(this._elementHelper=x,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function y(){this._imageLoaded=e.bind(this),this._footageLoaded=t.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=o.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return y.prototype={loadAssets:l,setAssetsPath:u,setPath:h,loadedImages:p,loadedFootages:m,destroy:f,getAsset:d,createImgData:a,createImageData:s,imageLoaded:e,footageLoaded:t,setCacheType:g},y})();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var n=this._cbs[e],r=0;r<n.length;r+=1)n[r](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),(function(){this.removeEventListener(e,t)}).bind(this)},removeEventListener:function(e,t){if(!t)this._cbs[e]=null;else if(this._cbs[e]){for(var n=0,r=this._cbs[e].length;n<r;)this._cbs[e][n]===t&&(this._cbs[e].splice(n,1),n-=1,r-=1),n+=1;this._cbs[e].length||(this._cbs[e]=null)}}};var markerParser=(function(){function i(e){for(var t=e.split(`\r
|
|
2
|
-
`),n={},r,s=0,a=0;a<t.length;a+=1)r=t[a].split(":"),r.length===2&&(n[r[0]]=r[1].trim(),s+=1);if(s===0)throw new Error;return n}return function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e[n],s={time:r.tm,duration:r.dr};try{s.payload=JSON.parse(e[n].cm)}catch{try{s.payload=i(e[n].cm)}catch{s.payload={name:e[n].cm}}}t.push(s)}return t}})(),ProjectInterface=(function(){function i(e){this.compositions.push(e)}return function(){function e(t){for(var n=0,r=this.compositions.length;n<r;){if(this.compositions[n].data&&this.compositions[n].data.nm===t)return this.compositions[n].prepareFrame&&this.compositions[n].data.xt&&this.compositions[n].prepareFrame(this.currentFrame),this.compositions[n].compInterface;n+=1}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=i,e}})(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(i){return renderers[i]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var i in renderers)if(renderers[i])return i;return""}function _typeof$4(i){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(i)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(i){(i.wrapper||i.container)&&(this.wrapper=i.wrapper||i.container);var e="svg";i.animType?e=i.animType:i.renderer&&(e=i.renderer);var t=getRenderer(e);this.renderer=new t(this,i.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,i.loop===""||i.loop===null||i.loop===void 0||i.loop===!0?this.loop=!0:i.loop===!1?this.loop=!1:this.loop=parseInt(i.loop,10),this.autoplay="autoplay"in i?i.autoplay:!0,this.name=i.name?i.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(i,"autoloadSegments")?i.autoloadSegments:!0,this.assetsPath=i.assetsPath,this.initialSegment=i.initialSegment,i.audioFactory&&this.audioController.setAudioFactory(i.audioFactory),i.animationData?this.setupAnimation(i.animationData):i.path&&(i.path.lastIndexOf("\\")!==-1?this.path=i.path.substr(0,i.path.lastIndexOf("\\")+1):this.path=i.path.substr(0,i.path.lastIndexOf("/")+1),this.fileName=i.path.substr(i.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(i.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(i){dataManager.completeAnimation(i,this.configAnimation)},AnimationItem.prototype.setData=function(i,e){e&&_typeof$4(e)!=="object"&&(e=JSON.parse(e));var t={wrapper:i,animationData:e},n=i.attributes;t.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",t.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var r=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";r==="false"?t.loop=!1:r==="true"?t.loop=!0:r!==""&&(t.loop=parseInt(r,10));var s=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:n.getNamedItem("bm-autoplay")?n.getNamedItem("bm-autoplay").value:!0;t.autoplay=s!=="false",t.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"";var a=n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"";a==="false"&&(t.prerender=!1),t.path?this.setParams(t):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(i){i.op>this.animationData.op&&(this.animationData.op=i.op,this.totalFrames=Math.floor(i.op-this.animationData.ip));var e=this.animationData.layers,t,n=e.length,r=i.layers,s,a=r.length;for(s=0;s<a;s+=1)for(t=0;t<n;){if(e[t].id===r[s].id){e[t]=r[s];break}t+=1}if((i.chars||i.fonts)&&(this.renderer.globalData.fontManager.addChars(i.chars),this.renderer.globalData.fontManager.addFonts(i.fonts,this.renderer.globalData.defs)),i.assets)for(n=i.assets.length,t=0;t<n;t+=1)this.animationData.assets.push(i.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(i){this.animationData=i;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var i=this.animationData.segments;if(!i||i.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var e=i.shift();this.timeCompleted=e.time*this.frameRate;var t=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(t,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var i=this.animationData.segments;i||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(i){if(this.renderer)try{this.animationData=i,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(i),i.assets||(i.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(i.assets),this.markers=markerParser(i.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var i=getExpressionsPlugin();i&&i.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(i,e){var t=typeof i=="number"?i:void 0,n=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(t,n)},AnimationItem.prototype.setSubframe=function(i){this.isSubframeEnabled=!!i},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(i){this.triggerRenderFrameError(i)}},AnimationItem.prototype.play=function(i){i&&this.name!==i||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(i){i&&this.name!==i||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(i){i&&this.name!==i||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(i){i&&this.name!==i||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(i){for(var e,t=0;t<this.markers.length;t+=1)if(e=this.markers[t],e.payload&&e.payload.name===i)return e;return null},AnimationItem.prototype.goToAndStop=function(i,e,t){if(!(t&&this.name!==t)){var n=Number(i);if(isNaN(n)){var r=this.getMarkerData(i);r&&this.goToAndStop(r.time,!0)}else e?this.setCurrentRawFrameValue(i):this.setCurrentRawFrameValue(i*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(i,e,t){if(!(t&&this.name!==t)){var n=Number(i);if(isNaN(n)){var r=this.getMarkerData(i);r&&(r.duration?this.playSegments([r.time,r.time+r.duration],!0):this.goToAndStop(r.time,!0))}else this.goToAndStop(n,e,t);this.play()}},AnimationItem.prototype.advanceTime=function(i){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+i*this.frameModifier,t=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(t=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(t=!0,e=0)):this.setCurrentRawFrameValue(e),t&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(i,e){this.playCount=0,i[1]<i[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=i[0]-i[1],this.timeCompleted=this.totalFrames,this.firstFrame=i[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):i[1]>i[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=i[1]-i[0],this.timeCompleted=this.totalFrames,this.firstFrame=i[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(i,e){var t=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<i?t=i:this.currentRawFrame+this.firstFrame>e&&(t=e-i)),this.firstFrame=i,this.totalFrames=e-i,this.timeCompleted=this.totalFrames,t!==-1&&this.goToAndStop(t,!0)},AnimationItem.prototype.playSegments=function(i,e){if(e&&(this.segments.length=0),_typeof$4(i[0])==="object"){var t,n=i.length;for(t=0;t<n;t+=1)this.segments.push(i[t])}else this.segments.push(i);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(i){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),i&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(i){return this.segments.length?(this.adjustSegment(this.segments.shift(),i),!0):!1},AnimationItem.prototype.destroy=function(i){i&&this.name!==i||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(i){this.currentRawFrame=i,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(i){this.playSpeed=i,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(i){this.playDirection=i<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(i){this.loop=i},AnimationItem.prototype.setVolume=function(i,e){e&&this.name!==e||this.audioController.setVolume(i)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(i){i&&this.name!==i||this.audioController.mute()},AnimationItem.prototype.unmute=function(i){i&&this.name!==i||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(i){var e="";if(i.e)e=i.p;else if(this.assetsPath){var t=i.p;t.indexOf("images/")!==-1&&(t=t.split("/")[1]),e=this.assetsPath+t}else e=this.path,e+=i.u?i.u:"",e+=i.p;return e},AnimationItem.prototype.getAssetData=function(i){for(var e=0,t=this.assets.length;e<t;){if(i===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(i){return i?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(i,e,t){try{var n=this.renderer.getElementByPath(i);n.updateDocumentData(e,t)}catch{}},AnimationItem.prototype.trigger=function(i){if(this._cbs&&this._cbs[i])switch(i){case"enterFrame":this.triggerEvent(i,new BMEnterFrameEvent(i,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(i,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(i,new BMCompleteLoopEvent(i,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(i,new BMCompleteEvent(i,this.frameMult));break;case"segmentStart":this.triggerEvent(i,new BMSegmentStartEvent(i,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(i,new BMDestroyEvent(i,this));break;default:this.triggerEvent(i)}i==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(i,this.currentFrame,this.totalFrames,this.frameMult)),i==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(i,this.loop,this.playCount,this.frameMult)),i==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(i,this.frameMult)),i==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(i,this.firstFrame,this.totalFrames)),i==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(i,this))},AnimationItem.prototype.triggerRenderFrameError=function(i){var e=new BMRenderFrameErrorEvent(i,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(i){var e=new BMConfigErrorEvent(i,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var animationManager=(function(){var i={},e=[],t=0,n=0,r=0,s=!0,a=!1;function o(C){for(var L=0,E=C.target;L<n;)e[L].animation===E&&(e.splice(L,1),L-=1,n-=1,E.isPaused||d()),L+=1}function l(C,L){if(!C)return null;for(var E=0;E<n;){if(e[E].elem===C&&e[E].elem!==null)return e[E].animation;E+=1}var T=new AnimationItem;return f(T,C),T.setData(C,L),T}function h(){var C,L=e.length,E=[];for(C=0;C<L;C+=1)E.push(e[C].animation);return E}function u(){r+=1,P()}function d(){r-=1}function f(C,L){C.addEventListener("destroy",o),C.addEventListener("_active",u),C.addEventListener("_idle",d),e.push({elem:L,animation:C}),n+=1}function p(C){var L=new AnimationItem;return f(L,null),L.setParams(C),L}function m(C,L){var E;for(E=0;E<n;E+=1)e[E].animation.setSpeed(C,L)}function g(C,L){var E;for(E=0;E<n;E+=1)e[E].animation.setDirection(C,L)}function y(C){var L;for(L=0;L<n;L+=1)e[L].animation.play(C)}function c(C){var L=C-t,E;for(E=0;E<n;E+=1)e[E].animation.advanceTime(L);t=C,r&&!a?window.requestAnimationFrame(c):s=!0}function x(C){t=C,window.requestAnimationFrame(c)}function v(C){var L;for(L=0;L<n;L+=1)e[L].animation.pause(C)}function _(C,L,E){var T;for(T=0;T<n;T+=1)e[T].animation.goToAndStop(C,L,E)}function b(C){var L;for(L=0;L<n;L+=1)e[L].animation.stop(C)}function M(C){var L;for(L=0;L<n;L+=1)e[L].animation.togglePause(C)}function A(C){var L;for(L=n-1;L>=0;L-=1)e[L].animation.destroy(C)}function R(C,L,E){var T=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),k,B=T.length;for(k=0;k<B;k+=1)E&&T[k].setAttribute("data-bm-type",E),l(T[k],C);if(L&&B===0){E||(E="svg");var ee=document.getElementsByTagName("body")[0];ee.innerText="";var oe=createTag("div");oe.style.width="100%",oe.style.height="100%",oe.setAttribute("data-bm-type",E),ee.appendChild(oe),l(oe,C)}}function w(){var C;for(C=0;C<n;C+=1)e[C].animation.resize()}function P(){!a&&r&&s&&(window.requestAnimationFrame(x),s=!1)}function N(){a=!0}function V(){a=!1,P()}function G(C,L){var E;for(E=0;E<n;E+=1)e[E].animation.setVolume(C,L)}function H(C){var L;for(L=0;L<n;L+=1)e[L].animation.mute(C)}function O(C){var L;for(L=0;L<n;L+=1)e[L].animation.unmute(C)}return i.registerAnimation=l,i.loadAnimation=p,i.setSpeed=m,i.setDirection=g,i.play=y,i.pause=v,i.stop=b,i.togglePause=M,i.searchAnimations=R,i.resize=w,i.goToAndStop=_,i.destroy=A,i.freeze=N,i.unfreeze=V,i.setVolume=G,i.mute=H,i.unmute=O,i.getRegisteredAnimations=h,i})(),BezierFactory=(function(){var i={};i.getBezierEasing=t;var e={};function t(x,v,_,b,M){var A=M||("bez_"+x+"_"+v+"_"+_+"_"+b).replace(/\./g,"p");if(e[A])return e[A];var R=new c([x,v,_,b]);return e[A]=R,R}var n=4,r=.001,s=1e-7,a=10,o=11,l=1/(o-1),h=typeof Float32Array=="function";function u(x,v){return 1-3*v+3*x}function d(x,v){return 3*v-6*x}function f(x){return 3*x}function p(x,v,_){return((u(v,_)*x+d(v,_))*x+f(v))*x}function m(x,v,_){return 3*u(v,_)*x*x+2*d(v,_)*x+f(v)}function g(x,v,_,b,M){var A,R,w=0;do R=v+(_-v)/2,A=p(R,b,M)-x,A>0?_=R:v=R;while(Math.abs(A)>s&&++w<a);return R}function y(x,v,_,b){for(var M=0;M<n;++M){var A=m(v,_,b);if(A===0)return v;var R=p(v,_,b)-x;v-=R/A}return v}function c(x){this._p=x,this._mSampleValues=h?new Float32Array(o):new Array(o),this._precomputed=!1,this.get=this.get.bind(this)}return c.prototype={get:function(v){var _=this._p[0],b=this._p[1],M=this._p[2],A=this._p[3];return this._precomputed||this._precompute(),_===b&&M===A?v:v===0?0:v===1?1:p(this._getTForX(v),b,A)},_precompute:function(){var v=this._p[0],_=this._p[1],b=this._p[2],M=this._p[3];this._precomputed=!0,(v!==_||b!==M)&&this._calcSampleValues()},_calcSampleValues:function(){for(var v=this._p[0],_=this._p[2],b=0;b<o;++b)this._mSampleValues[b]=p(b*l,v,_)},_getTForX:function(v){for(var _=this._p[0],b=this._p[2],M=this._mSampleValues,A=0,R=1,w=o-1;R!==w&&M[R]<=v;++R)A+=l;--R;var P=(v-M[R])/(M[R+1]-M[R]),N=A+P*l,V=m(N,_,b);return V>=r?y(v,N,_,b):V===0?N:g(v,A,A+l,_,b)}},i})(),pooling=(function(){function i(e){return e.concat(createSizedArray(e.length))}return{double:i}})(),poolFactory=(function(){return function(i,e,t){var n=0,r=i,s=createSizedArray(r),a={newElement:o,release:l};function o(){var h;return n?(n-=1,h=s[n]):h=e(),h}function l(h){n===r&&(s=pooling.double(s),r*=2),t&&t(h),s[n]=h,n+=1}return a}})(),bezierLengthPool=(function(){function i(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,i)})(),segmentsLengthPool=(function(){function i(){return{lengths:[],totalLength:0}}function e(t){var n,r=t.lengths.length;for(n=0;n<r;n+=1)bezierLengthPool.release(t.lengths[n]);t.lengths.length=0}return poolFactory(8,i,e)})();function bezFunction(){var i=Math;function e(f,p,m,g,y,c){var x=f*g+p*y+m*c-y*g-c*f-m*p;return x>-.001&&x<.001}function t(f,p,m,g,y,c,x,v,_){if(m===0&&c===0&&_===0)return e(f,p,g,y,x,v);var b=i.sqrt(i.pow(g-f,2)+i.pow(y-p,2)+i.pow(c-m,2)),M=i.sqrt(i.pow(x-f,2)+i.pow(v-p,2)+i.pow(_-m,2)),A=i.sqrt(i.pow(x-g,2)+i.pow(v-y,2)+i.pow(_-c,2)),R;return b>M?b>A?R=b-M-A:R=A-M-b:A>M?R=A-M-b:R=M-b-A,R>-1e-4&&R<1e-4}var n=(function(){return function(f,p,m,g){var y=getDefaultCurveSegments(),c,x,v,_,b,M=0,A,R=[],w=[],P=bezierLengthPool.newElement();for(v=m.length,c=0;c<y;c+=1){for(b=c/(y-1),A=0,x=0;x<v;x+=1)_=bmPow(1-b,3)*f[x]+3*bmPow(1-b,2)*b*m[x]+3*(1-b)*bmPow(b,2)*g[x]+bmPow(b,3)*p[x],R[x]=_,w[x]!==null&&(A+=bmPow(R[x]-w[x],2)),w[x]=R[x];A&&(A=bmSqrt(A),M+=A),P.percents[c]=b,P.lengths[c]=M}return P.addedLength=M,P}})();function r(f){var p=segmentsLengthPool.newElement(),m=f.c,g=f.v,y=f.o,c=f.i,x,v=f._length,_=p.lengths,b=0;for(x=0;x<v-1;x+=1)_[x]=n(g[x],g[x+1],y[x],c[x+1]),b+=_[x].addedLength;return m&&v&&(_[x]=n(g[x],g[0],y[x],c[0]),b+=_[x].addedLength),p.totalLength=b,p}function s(f){this.segmentLength=0,this.points=new Array(f)}function a(f,p){this.partialLength=f,this.point=p}var o=(function(){var f={};return function(p,m,g,y){var c=(p[0]+"_"+p[1]+"_"+m[0]+"_"+m[1]+"_"+g[0]+"_"+g[1]+"_"+y[0]+"_"+y[1]).replace(/\./g,"p");if(!f[c]){var x=getDefaultCurveSegments(),v,_,b,M,A,R=0,w,P,N=null;p.length===2&&(p[0]!==m[0]||p[1]!==m[1])&&e(p[0],p[1],m[0],m[1],p[0]+g[0],p[1]+g[1])&&e(p[0],p[1],m[0],m[1],m[0]+y[0],m[1]+y[1])&&(x=2);var V=new s(x);for(b=g.length,v=0;v<x;v+=1){for(P=createSizedArray(b),A=v/(x-1),w=0,_=0;_<b;_+=1)M=bmPow(1-A,3)*p[_]+3*bmPow(1-A,2)*A*(p[_]+g[_])+3*(1-A)*bmPow(A,2)*(m[_]+y[_])+bmPow(A,3)*m[_],P[_]=M,N!==null&&(w+=bmPow(P[_]-N[_],2));w=bmSqrt(w),R+=w,V.points[v]=new a(w,P),N=P}V.segmentLength=R,f[c]=V}return f[c]}})();function l(f,p){var m=p.percents,g=p.lengths,y=m.length,c=bmFloor((y-1)*f),x=f*p.addedLength,v=0;if(c===y-1||c===0||x===g[c])return m[c];for(var _=g[c]>x?-1:1,b=!0;b;)if(g[c]<=x&&g[c+1]>x?(v=(x-g[c])/(g[c+1]-g[c]),b=!1):c+=_,c<0||c>=y-1){if(c===y-1)return m[c];b=!1}return m[c]+(m[c+1]-m[c])*v}function h(f,p,m,g,y,c){var x=l(y,c),v=1-x,_=i.round((v*v*v*f[0]+(x*v*v+v*x*v+v*v*x)*m[0]+(x*x*v+v*x*x+x*v*x)*g[0]+x*x*x*p[0])*1e3)/1e3,b=i.round((v*v*v*f[1]+(x*v*v+v*x*v+v*v*x)*m[1]+(x*x*v+v*x*x+x*v*x)*g[1]+x*x*x*p[1])*1e3)/1e3;return[_,b]}var u=createTypedArray("float32",8);function d(f,p,m,g,y,c,x){y<0?y=0:y>1&&(y=1);var v=l(y,x);c=c>1?1:c;var _=l(c,x),b,M=f.length,A=1-v,R=1-_,w=A*A*A,P=v*A*A*3,N=v*v*A*3,V=v*v*v,G=A*A*R,H=v*A*R+A*v*R+A*A*_,O=v*v*R+A*v*_+v*A*_,C=v*v*_,L=A*R*R,E=v*R*R+A*_*R+A*R*_,T=v*_*R+A*_*_+v*R*_,k=v*_*_,B=R*R*R,ee=_*R*R+R*_*R+R*R*_,oe=_*_*R+R*_*_+_*R*_,X=_*_*_;for(b=0;b<M;b+=1)u[b*4]=i.round((w*f[b]+P*m[b]+N*g[b]+V*p[b])*1e3)/1e3,u[b*4+1]=i.round((G*f[b]+H*m[b]+O*g[b]+C*p[b])*1e3)/1e3,u[b*4+2]=i.round((L*f[b]+E*m[b]+T*g[b]+k*p[b])*1e3)/1e3,u[b*4+3]=i.round((B*f[b]+ee*m[b]+oe*g[b]+X*p[b])*1e3)/1e3;return u}return{getSegmentsLength:r,getNewSegment:d,getPointInSegment:h,buildBezierData:o,pointOnLine2D:e,pointOnLine3D:t}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(i,e){var t=this.offsetTime,n;this.propType==="multidimensional"&&(n=createTypedArray("float32",this.pv.length));for(var r=e.lastIndex,s=r,a=this.keyframes.length-1,o=!0,l,h,u;o;){if(l=this.keyframes[s],h=this.keyframes[s+1],s===a-1&&i>=h.t-t){l.h&&(l=h),r=0;break}if(h.t-t>i){r=s;break}s<a-1?s+=1:(r=0,o=!1)}u=this.keyframesMetadata[s]||{};var d,f,p,m,g,y,c=h.t-t,x=l.t-t,v;if(l.to){u.bezierData||(u.bezierData=bez.buildBezierData(l.s,h.s||l.e,l.to,l.ti));var _=u.bezierData;if(i>=c||i<x){var b=i>=c?_.points.length-1:0;for(f=_.points[b].point.length,d=0;d<f;d+=1)n[d]=_.points[b].point[d]}else{u.__fnct?y=u.__fnct:(y=BezierFactory.getBezierEasing(l.o.x,l.o.y,l.i.x,l.i.y,l.n).get,u.__fnct=y),p=y((i-x)/(c-x));var M=_.segmentLength*p,A,R=e.lastFrame<i&&e._lastKeyframeIndex===s?e._lastAddedLength:0;for(g=e.lastFrame<i&&e._lastKeyframeIndex===s?e._lastPoint:0,o=!0,m=_.points.length;o;){if(R+=_.points[g].partialLength,M===0||p===0||g===_.points.length-1){for(f=_.points[g].point.length,d=0;d<f;d+=1)n[d]=_.points[g].point[d];break}else if(M>=R&&M<R+_.points[g+1].partialLength){for(A=(M-R)/_.points[g+1].partialLength,f=_.points[g].point.length,d=0;d<f;d+=1)n[d]=_.points[g].point[d]+(_.points[g+1].point[d]-_.points[g].point[d])*A;break}g<m-1?g+=1:o=!1}e._lastPoint=g,e._lastAddedLength=R-_.points[g].partialLength,e._lastKeyframeIndex=s}}else{var w,P,N,V,G;if(a=l.s.length,v=h.s||l.e,this.sh&&l.h!==1)if(i>=c)n[0]=v[0],n[1]=v[1],n[2]=v[2];else if(i<=x)n[0]=l.s[0],n[1]=l.s[1],n[2]=l.s[2];else{var H=createQuaternion(l.s),O=createQuaternion(v),C=(i-x)/(c-x);quaternionToEuler(n,slerp(H,O,C))}else for(s=0;s<a;s+=1)l.h!==1&&(i>=c?p=1:i<x?p=0:(l.o.x.constructor===Array?(u.__fnct||(u.__fnct=[]),u.__fnct[s]?y=u.__fnct[s]:(w=l.o.x[s]===void 0?l.o.x[0]:l.o.x[s],P=l.o.y[s]===void 0?l.o.y[0]:l.o.y[s],N=l.i.x[s]===void 0?l.i.x[0]:l.i.x[s],V=l.i.y[s]===void 0?l.i.y[0]:l.i.y[s],y=BezierFactory.getBezierEasing(w,P,N,V).get,u.__fnct[s]=y)):u.__fnct?y=u.__fnct:(w=l.o.x,P=l.o.y,N=l.i.x,V=l.i.y,y=BezierFactory.getBezierEasing(w,P,N,V).get,l.keyframeMetadata=y),p=y((i-x)/(c-x)))),v=h.s||l.e,G=l.h===1?l.s[s]:l.s[s]+(v[s]-l.s[s])*p,this.propType==="multidimensional"?n[s]=G:n=G}return e.lastIndex=r,n}function slerp(i,e,t){var n=[],r=i[0],s=i[1],a=i[2],o=i[3],l=e[0],h=e[1],u=e[2],d=e[3],f,p,m,g,y;return p=r*l+s*h+a*u+o*d,p<0&&(p=-p,l=-l,h=-h,u=-u,d=-d),1-p>1e-6?(f=Math.acos(p),m=Math.sin(f),g=Math.sin((1-t)*f)/m,y=Math.sin(t*f)/m):(g=1-t,y=t),n[0]=g*r+y*l,n[1]=g*s+y*h,n[2]=g*a+y*u,n[3]=g*o+y*d,n}function quaternionToEuler(i,e){var t=e[0],n=e[1],r=e[2],s=e[3],a=Math.atan2(2*n*s-2*t*r,1-2*n*n-2*r*r),o=Math.asin(2*t*n+2*r*s),l=Math.atan2(2*t*s-2*n*r,1-2*t*t-2*r*r);i[0]=a/degToRads,i[1]=o/degToRads,i[2]=l/degToRads}function createQuaternion(i){var e=i[0]*degToRads,t=i[1]*degToRads,n=i[2]*degToRads,r=Math.cos(e/2),s=Math.cos(t/2),a=Math.cos(n/2),o=Math.sin(e/2),l=Math.sin(t/2),h=Math.sin(n/2),u=r*s*a-o*l*h,d=o*l*a+r*s*h,f=o*s*a+r*l*h,p=r*l*a-o*s*h;return[d,f,p,u]}function getValueAtCurrentTime(){var i=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,t=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(i===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=t&&i>=t||this._caching.lastFrame<e&&i<e))){this._caching.lastFrame>=i&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var n=this.interpolateValue(i,this._caching);this.pv=n}return this._caching.lastFrame=i,this.pv}function setVValue(i){var e;if(this.propType==="unidimensional")e=i*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var t=0,n=this.v.length;t<n;)e=i[t]*this.mult,mathAbs(this.v[t]-e)>1e-5&&(this.v[t]=e,this._mdf=!0),t+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var i,e=this.effectsSequence.length,t=this.kf?this.pv:this.data.k;for(i=0;i<e;i+=1)t=this.effectsSequence[i](t);this.setVValue(t),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(i){this.effectsSequence.push(i),this.container.addDynamicProperty(this)}function ValueProperty(i,e,t,n){this.propType="unidimensional",this.mult=t||1,this.data=e,this.v=t?e.k*t:e.k,this.pv=e.k,this._mdf=!1,this.elem=i,this.container=n,this.comp=i.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(i,e,t,n){this.propType="multidimensional",this.mult=t||1,this.data=e,this._mdf=!1,this.elem=i,this.container=n,this.comp=i.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r,s=e.k.length;for(this.v=createTypedArray("float32",s),this.pv=createTypedArray("float32",s),this.vel=createTypedArray("float32",s),r=0;r<s;r+=1)this.v[r]=e.k[r]*this.mult,this.pv[r]=e.k[r];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(i,e,t,n){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=i.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=t||1,this.elem=i,this.container=n,this.comp=i.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(i,e,t,n){this.propType="multidimensional";var r,s=e.k.length,a,o,l,h;for(r=0;r<s-1;r+=1)e.k[r].to&&e.k[r].s&&e.k[r+1]&&e.k[r+1].s&&(a=e.k[r].s,o=e.k[r+1].s,l=e.k[r].to,h=e.k[r].ti,(a.length===2&&!(a[0]===o[0]&&a[1]===o[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],a[0]+l[0],a[1]+l[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],o[0]+h[0],o[1]+h[1])||a.length===3&&!(a[0]===o[0]&&a[1]===o[1]&&a[2]===o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],a[0]+l[0],a[1]+l[1],a[2]+l[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],o[0]+h[0],o[1]+h[1],o[2]+h[2]))&&(e.k[r].to=null,e.k[r].ti=null),a[0]===o[0]&&a[1]===o[1]&&l[0]===0&&l[1]===0&&h[0]===0&&h[1]===0&&(a.length===2||a[2]===o[2]&&l[2]===0&&h[2]===0)&&(e.k[r].to=null,e.k[r].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=i.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=t||1,this.elem=i,this.container=n,this.comp=i.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var u=e.k[0].s.length;for(this.v=createTypedArray("float32",u),this.pv=createTypedArray("float32",u),r=0;r<u;r+=1)this.v[r]=initFrame,this.pv[r]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",u)},this.addEffect=addEffect}var PropertyFactory=(function(){function i(t,n,r,s,a){n.sid&&(n=t.globalData.slotManager.getProp(n));var o;if(!n.k.length)o=new ValueProperty(t,n,s,a);else if(typeof n.k[0]=="number")o=new MultiDimensionalProperty(t,n,s,a);else switch(r){case 0:o=new KeyframedValueProperty(t,n,s,a);break;case 1:o=new KeyframedMultidimensionalProperty(t,n,s,a);break}return o.effectsSequence.length&&a.addDynamicProperty(o),o}var e={getProp:i};return e})();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){this.dynamicProperties.indexOf(e)===-1&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var e,t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=(function(){function i(){return createTypedArray("float32",2)}return poolFactory(8,i)})();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(i,e){this.c=i,this.setLength(e);for(var t=0;t<e;)this.v[t]=pointPool.newElement(),this.o[t]=pointPool.newElement(),this.i[t]=pointPool.newElement(),t+=1},ShapePath.prototype.setLength=function(i){for(;this._maxLength<i;)this.doubleArrayLength();this._length=i},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(i,e,t,n,r){var s;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),t){case"v":s=this.v;break;case"i":s=this.i;break;case"o":s=this.o;break;default:s=[];break}(!s[n]||s[n]&&!r)&&(s[n]=pointPool.newElement()),s[n][0]=i,s[n][1]=e},ShapePath.prototype.setTripleAt=function(i,e,t,n,r,s,a,o){this.setXYAt(i,e,"v",a,o),this.setXYAt(t,n,"o",a,o),this.setXYAt(r,s,"i",a,o)},ShapePath.prototype.reverse=function(){var i=new ShapePath;i.setPathData(this.c,this._length);var e=this.v,t=this.o,n=this.i,r=0;this.c&&(i.setTripleAt(e[0][0],e[0][1],n[0][0],n[0][1],t[0][0],t[0][1],0,!1),r=1);var s=this._length-1,a=this._length,o;for(o=r;o<a;o+=1)i.setTripleAt(e[s][0],e[s][1],n[s][0],n[s][1],t[s][0],t[s][1],o,!1),s-=1;return i},ShapePath.prototype.length=function(){return this._length};var shapePool=(function(){function i(){return new ShapePath}function e(r){var s=r._length,a;for(a=0;a<s;a+=1)pointPool.release(r.v[a]),pointPool.release(r.i[a]),pointPool.release(r.o[a]),r.v[a]=null,r.i[a]=null,r.o[a]=null;r._length=0,r.c=!1}function t(r){var s=n.newElement(),a,o=r._length===void 0?r.v.length:r._length;for(s.setLength(o),s.c=r.c,a=0;a<o;a+=1)s.setTripleAt(r.v[a][0],r.v[a][1],r.o[a][0],r.o[a][1],r.i[a][0],r.i[a][1],a);return s}var n=poolFactory(4,i,e);return n.clone=t,n})();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(i){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=i,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var i;for(i=0;i<this._length;i+=1)shapePool.release(this.shapes[i]);this._length=0};var shapeCollectionPool=(function(){var i={newShapeCollection:r,release:s},e=0,t=4,n=createSizedArray(t);function r(){var a;return e?(e-=1,a=n[e]):a=new ShapeCollection,a}function s(a){var o,l=a._length;for(o=0;o<l;o+=1)shapePool.release(a.shapes[o]);a._length=0,e===t&&(n=pooling.double(n),t*=2),n[e]=a,e+=1}return i})(),ShapePropertyFactory=(function(){var i=-999999;function e(c,x,v){var _=v.lastIndex,b,M,A,R,w,P,N,V,G,H=this.keyframes;if(c<H[0].t-this.offsetTime)b=H[0].s[0],A=!0,_=0;else if(c>=H[H.length-1].t-this.offsetTime)b=H[H.length-1].s?H[H.length-1].s[0]:H[H.length-2].e[0],A=!0;else{for(var O=_,C=H.length-1,L=!0,E,T,k;L&&(E=H[O],T=H[O+1],!(T.t-this.offsetTime>c));)O<C-1?O+=1:L=!1;if(k=this.keyframesMetadata[O]||{},A=E.h===1,_=O,!A){if(c>=T.t-this.offsetTime)V=1;else if(c<E.t-this.offsetTime)V=0;else{var B;k.__fnct?B=k.__fnct:(B=BezierFactory.getBezierEasing(E.o.x,E.o.y,E.i.x,E.i.y).get,k.__fnct=B),V=B((c-(E.t-this.offsetTime))/(T.t-this.offsetTime-(E.t-this.offsetTime)))}M=T.s?T.s[0]:E.e[0]}b=E.s[0]}for(P=x._length,N=b.i[0].length,v.lastIndex=_,R=0;R<P;R+=1)for(w=0;w<N;w+=1)G=A?b.i[R][w]:b.i[R][w]+(M.i[R][w]-b.i[R][w])*V,x.i[R][w]=G,G=A?b.o[R][w]:b.o[R][w]+(M.o[R][w]-b.o[R][w])*V,x.o[R][w]=G,G=A?b.v[R][w]:b.v[R][w]+(M.v[R][w]-b.v[R][w])*V,x.v[R][w]=G}function t(){var c=this.comp.renderedFrame-this.offsetTime,x=this.keyframes[0].t-this.offsetTime,v=this.keyframes[this.keyframes.length-1].t-this.offsetTime,_=this._caching.lastFrame;return _!==i&&(_<x&&c<x||_>v&&c>v)||(this._caching.lastIndex=_<c?this._caching.lastIndex:0,this.interpolateShape(c,this.pv,this._caching)),this._caching.lastFrame=c,this.pv}function n(){this.paths=this.localShapeCollection}function r(c,x){if(c._length!==x._length||c.c!==x.c)return!1;var v,_=c._length;for(v=0;v<_;v+=1)if(c.v[v][0]!==x.v[v][0]||c.v[v][1]!==x.v[v][1]||c.o[v][0]!==x.o[v][0]||c.o[v][1]!==x.o[v][1]||c.i[v][0]!==x.i[v][0]||c.i[v][1]!==x.i[v][1])return!1;return!0}function s(c){r(this.v,c)||(this.v=shapePool.clone(c),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var c;this.kf?c=this.pv:this.data.ks?c=this.data.ks.k:c=this.data.pt.k;var x,v=this.effectsSequence.length;for(x=0;x<v;x+=1)c=this.effectsSequence[x](c);this.setVValue(c),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function o(c,x,v){this.propType="shape",this.comp=c.comp,this.container=c,this.elem=c,this.data=x,this.k=!1,this.kf=!1,this._mdf=!1;var _=v===3?x.pt.k:x.ks.k;this.v=shapePool.clone(_),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function l(c){this.effectsSequence.push(c),this.container.addDynamicProperty(this)}o.prototype.interpolateShape=e,o.prototype.getValue=a,o.prototype.setVValue=s,o.prototype.addEffect=l;function h(c,x,v){this.propType="shape",this.comp=c.comp,this.elem=c,this.container=c,this.offsetTime=c.data.st,this.keyframes=v===3?x.pt.k:x.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var _=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,_),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=i,this.reset=n,this._caching={lastFrame:i,lastIndex:0},this.effectsSequence=[t.bind(this)]}h.prototype.getValue=a,h.prototype.interpolateShape=e,h.prototype.setVValue=s,h.prototype.addEffect=l;var u=(function(){var c=roundCorner;function x(v,_){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=_.d,this.elem=v,this.comp=v.comp,this.frameId=-1,this.initDynamicPropertyContainer(v),this.p=PropertyFactory.getProp(v,_.p,1,0,this),this.s=PropertyFactory.getProp(v,_.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return x.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var _=this.p.v[0],b=this.p.v[1],M=this.s.v[0]/2,A=this.s.v[1]/2,R=this.d!==3,w=this.v;w.v[0][0]=_,w.v[0][1]=b-A,w.v[1][0]=R?_+M:_-M,w.v[1][1]=b,w.v[2][0]=_,w.v[2][1]=b+A,w.v[3][0]=R?_-M:_+M,w.v[3][1]=b,w.i[0][0]=R?_-M*c:_+M*c,w.i[0][1]=b-A,w.i[1][0]=R?_+M:_-M,w.i[1][1]=b-A*c,w.i[2][0]=R?_+M*c:_-M*c,w.i[2][1]=b+A,w.i[3][0]=R?_-M:_+M,w.i[3][1]=b+A*c,w.o[0][0]=R?_+M*c:_-M*c,w.o[0][1]=b-A,w.o[1][0]=R?_+M:_-M,w.o[1][1]=b+A*c,w.o[2][0]=R?_-M*c:_+M*c,w.o[2][1]=b+A,w.o[3][0]=R?_-M:_+M,w.o[3][1]=b-A*c}},extendPrototype([DynamicPropertyContainer],x),x})(),d=(function(){function c(x,v){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=x,this.comp=x.comp,this.data=v,this.frameId=-1,this.d=v.d,this.initDynamicPropertyContainer(x),v.sy===1?(this.ir=PropertyFactory.getProp(x,v.ir,0,0,this),this.is=PropertyFactory.getProp(x,v.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(x,v.pt,0,0,this),this.p=PropertyFactory.getProp(x,v.p,1,0,this),this.r=PropertyFactory.getProp(x,v.r,0,degToRads,this),this.or=PropertyFactory.getProp(x,v.or,0,0,this),this.os=PropertyFactory.getProp(x,v.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return c.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var v=Math.floor(this.pt.v)*2,_=Math.PI*2/v,b=!0,M=this.or.v,A=this.ir.v,R=this.os.v,w=this.is.v,P=2*Math.PI*M/(v*2),N=2*Math.PI*A/(v*2),V,G,H,O,C=-Math.PI/2;C+=this.r.v;var L=this.data.d===3?-1:1;for(this.v._length=0,V=0;V<v;V+=1){G=b?M:A,H=b?R:w,O=b?P:N;var E=G*Math.cos(C),T=G*Math.sin(C),k=E===0&&T===0?0:T/Math.sqrt(E*E+T*T),B=E===0&&T===0?0:-E/Math.sqrt(E*E+T*T);E+=+this.p.v[0],T+=+this.p.v[1],this.v.setTripleAt(E,T,E-k*O*H*L,T-B*O*H*L,E+k*O*H*L,T+B*O*H*L,V,!0),b=!b,C+=_*L}},convertPolygonToPath:function(){var v=Math.floor(this.pt.v),_=Math.PI*2/v,b=this.or.v,M=this.os.v,A=2*Math.PI*b/(v*4),R,w=-Math.PI*.5,P=this.data.d===3?-1:1;for(w+=this.r.v,this.v._length=0,R=0;R<v;R+=1){var N=b*Math.cos(w),V=b*Math.sin(w),G=N===0&&V===0?0:V/Math.sqrt(N*N+V*V),H=N===0&&V===0?0:-N/Math.sqrt(N*N+V*V);N+=+this.p.v[0],V+=+this.p.v[1],this.v.setTripleAt(N,V,N-G*A*M*P,V-H*A*M*P,N+G*A*M*P,V+H*A*M*P,R,!0),w+=_*P}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],c),c})(),f=(function(){function c(x,v){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=x,this.comp=x.comp,this.frameId=-1,this.d=v.d,this.initDynamicPropertyContainer(x),this.p=PropertyFactory.getProp(x,v.p,1,0,this),this.s=PropertyFactory.getProp(x,v.s,1,0,this),this.r=PropertyFactory.getProp(x,v.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return c.prototype={convertRectToPath:function(){var v=this.p.v[0],_=this.p.v[1],b=this.s.v[0]/2,M=this.s.v[1]/2,A=bmMin(b,M,this.r.v),R=A*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(v+b,_-M+A,v+b,_-M+A,v+b,_-M+R,0,!0),this.v.setTripleAt(v+b,_+M-A,v+b,_+M-R,v+b,_+M-A,1,!0),A!==0?(this.v.setTripleAt(v+b-A,_+M,v+b-A,_+M,v+b-R,_+M,2,!0),this.v.setTripleAt(v-b+A,_+M,v-b+R,_+M,v-b+A,_+M,3,!0),this.v.setTripleAt(v-b,_+M-A,v-b,_+M-A,v-b,_+M-R,4,!0),this.v.setTripleAt(v-b,_-M+A,v-b,_-M+R,v-b,_-M+A,5,!0),this.v.setTripleAt(v-b+A,_-M,v-b+A,_-M,v-b+R,_-M,6,!0),this.v.setTripleAt(v+b-A,_-M,v+b-R,_-M,v+b-A,_-M,7,!0)):(this.v.setTripleAt(v-b,_+M,v-b+R,_+M,v-b,_+M,2),this.v.setTripleAt(v-b,_-M,v-b,_-M+R,v-b,_-M,3))):(this.v.setTripleAt(v+b,_-M+A,v+b,_-M+R,v+b,_-M+A,0,!0),A!==0?(this.v.setTripleAt(v+b-A,_-M,v+b-A,_-M,v+b-R,_-M,1,!0),this.v.setTripleAt(v-b+A,_-M,v-b+R,_-M,v-b+A,_-M,2,!0),this.v.setTripleAt(v-b,_-M+A,v-b,_-M+A,v-b,_-M+R,3,!0),this.v.setTripleAt(v-b,_+M-A,v-b,_+M-R,v-b,_+M-A,4,!0),this.v.setTripleAt(v-b+A,_+M,v-b+A,_+M,v-b+R,_+M,5,!0),this.v.setTripleAt(v+b-A,_+M,v+b-R,_+M,v+b-A,_+M,6,!0),this.v.setTripleAt(v+b,_+M-A,v+b,_+M-A,v+b,_+M-R,7,!0)):(this.v.setTripleAt(v-b,_-M,v-b+R,_-M,v-b,_-M,1,!0),this.v.setTripleAt(v-b,_+M,v-b,_+M-R,v-b,_+M,2,!0),this.v.setTripleAt(v+b,_+M,v+b-R,_+M,v+b,_+M,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],c),c})();function p(c,x,v){var _;if(v===3||v===4){var b=v===3?x.pt:x.ks,M=b.k;M.length?_=new h(c,x,v):_=new o(c,x,v)}else v===5?_=new f(c,x):v===6?_=new u(c,x):v===7&&(_=new d(c,x));return _.k&&c.addDynamicProperty(_),_}function m(){return o}function g(){return h}var y={};return y.getShapeProp=p,y.getConstructorFunction=m,y.getKeyframedConstructorFunction=g,y})();var Matrix=(function(){var i=Math.cos,e=Math.sin,t=Math.tan,n=Math.round;function r(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function s(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(T,-k,0,0,k,T,0,0,0,0,1,0,0,0,0,1)}function a(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(1,0,0,0,0,T,-k,0,0,k,T,0,0,0,0,1)}function o(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(T,0,k,0,0,1,0,0,-k,0,T,0,0,0,0,1)}function l(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(T,-k,0,0,k,T,0,0,0,0,1,0,0,0,0,1)}function h(E,T){return this._t(1,T,E,1,0,0)}function u(E,T){return this.shear(t(E),t(T))}function d(E,T){var k=i(T),B=e(T);return this._t(k,B,0,0,-B,k,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,t(E),1,0,0,0,0,1,0,0,0,0,1)._t(k,-B,0,0,B,k,0,0,0,0,1,0,0,0,0,1)}function f(E,T,k){return!k&&k!==0&&(k=1),E===1&&T===1&&k===1?this:this._t(E,0,0,0,0,T,0,0,0,0,k,0,0,0,0,1)}function p(E,T,k,B,ee,oe,X,Q,ne,re,me,Fe,Ee,Ne,Be,_e){return this.props[0]=E,this.props[1]=T,this.props[2]=k,this.props[3]=B,this.props[4]=ee,this.props[5]=oe,this.props[6]=X,this.props[7]=Q,this.props[8]=ne,this.props[9]=re,this.props[10]=me,this.props[11]=Fe,this.props[12]=Ee,this.props[13]=Ne,this.props[14]=Be,this.props[15]=_e,this}function m(E,T,k){return k=k||0,E!==0||T!==0||k!==0?this._t(1,0,0,0,0,1,0,0,0,0,1,0,E,T,k,1):this}function g(E,T,k,B,ee,oe,X,Q,ne,re,me,Fe,Ee,Ne,Be,_e){var U=this.props;if(E===1&&T===0&&k===0&&B===0&&ee===0&&oe===1&&X===0&&Q===0&&ne===0&&re===0&&me===1&&Fe===0)return U[12]=U[12]*E+U[15]*Ee,U[13]=U[13]*oe+U[15]*Ne,U[14]=U[14]*me+U[15]*Be,U[15]*=_e,this._identityCalculated=!1,this;var qe=U[0],Le=U[1],Ie=U[2],ge=U[3],ke=U[4],ve=U[5],D=U[6],I=U[7],q=U[8],J=U[9],te=U[10],K=U[11],de=U[12],le=U[13],Me=U[14],be=U[15];return U[0]=qe*E+Le*ee+Ie*ne+ge*Ee,U[1]=qe*T+Le*oe+Ie*re+ge*Ne,U[2]=qe*k+Le*X+Ie*me+ge*Be,U[3]=qe*B+Le*Q+Ie*Fe+ge*_e,U[4]=ke*E+ve*ee+D*ne+I*Ee,U[5]=ke*T+ve*oe+D*re+I*Ne,U[6]=ke*k+ve*X+D*me+I*Be,U[7]=ke*B+ve*Q+D*Fe+I*_e,U[8]=q*E+J*ee+te*ne+K*Ee,U[9]=q*T+J*oe+te*re+K*Ne,U[10]=q*k+J*X+te*me+K*Be,U[11]=q*B+J*Q+te*Fe+K*_e,U[12]=de*E+le*ee+Me*ne+be*Ee,U[13]=de*T+le*oe+Me*re+be*Ne,U[14]=de*k+le*X+Me*me+be*Be,U[15]=de*B+le*Q+Me*Fe+be*_e,this._identityCalculated=!1,this}function y(E){var T=E.props;return this.transform(T[0],T[1],T[2],T[3],T[4],T[5],T[6],T[7],T[8],T[9],T[10],T[11],T[12],T[13],T[14],T[15])}function c(){return this._identityCalculated||(this._identity=!(this.props[0]!==1||this.props[1]!==0||this.props[2]!==0||this.props[3]!==0||this.props[4]!==0||this.props[5]!==1||this.props[6]!==0||this.props[7]!==0||this.props[8]!==0||this.props[9]!==0||this.props[10]!==1||this.props[11]!==0||this.props[12]!==0||this.props[13]!==0||this.props[14]!==0||this.props[15]!==1),this._identityCalculated=!0),this._identity}function x(E){for(var T=0;T<16;){if(E.props[T]!==this.props[T])return!1;T+=1}return!0}function v(E){var T;for(T=0;T<16;T+=1)E.props[T]=this.props[T];return E}function _(E){var T;for(T=0;T<16;T+=1)this.props[T]=E[T]}function b(E,T,k){return{x:E*this.props[0]+T*this.props[4]+k*this.props[8]+this.props[12],y:E*this.props[1]+T*this.props[5]+k*this.props[9]+this.props[13],z:E*this.props[2]+T*this.props[6]+k*this.props[10]+this.props[14]}}function M(E,T,k){return E*this.props[0]+T*this.props[4]+k*this.props[8]+this.props[12]}function A(E,T,k){return E*this.props[1]+T*this.props[5]+k*this.props[9]+this.props[13]}function R(E,T,k){return E*this.props[2]+T*this.props[6]+k*this.props[10]+this.props[14]}function w(){var E=this.props[0]*this.props[5]-this.props[1]*this.props[4],T=this.props[5]/E,k=-this.props[1]/E,B=-this.props[4]/E,ee=this.props[0]/E,oe=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/E,X=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/E,Q=new Matrix;return Q.props[0]=T,Q.props[1]=k,Q.props[4]=B,Q.props[5]=ee,Q.props[12]=oe,Q.props[13]=X,Q}function P(E){var T=this.getInverseMatrix();return T.applyToPointArray(E[0],E[1],E[2]||0)}function N(E){var T,k=E.length,B=[];for(T=0;T<k;T+=1)B[T]=P(E[T]);return B}function V(E,T,k){var B=createTypedArray("float32",6);if(this.isIdentity())B[0]=E[0],B[1]=E[1],B[2]=T[0],B[3]=T[1],B[4]=k[0],B[5]=k[1];else{var ee=this.props[0],oe=this.props[1],X=this.props[4],Q=this.props[5],ne=this.props[12],re=this.props[13];B[0]=E[0]*ee+E[1]*X+ne,B[1]=E[0]*oe+E[1]*Q+re,B[2]=T[0]*ee+T[1]*X+ne,B[3]=T[0]*oe+T[1]*Q+re,B[4]=k[0]*ee+k[1]*X+ne,B[5]=k[0]*oe+k[1]*Q+re}return B}function G(E,T,k){var B;return this.isIdentity()?B=[E,T,k]:B=[E*this.props[0]+T*this.props[4]+k*this.props[8]+this.props[12],E*this.props[1]+T*this.props[5]+k*this.props[9]+this.props[13],E*this.props[2]+T*this.props[6]+k*this.props[10]+this.props[14]],B}function H(E,T){if(this.isIdentity())return E+","+T;var k=this.props;return Math.round((E*k[0]+T*k[4]+k[12])*100)/100+","+Math.round((E*k[1]+T*k[5]+k[13])*100)/100}function O(){for(var E=0,T=this.props,k="matrix3d(",B=1e4;E<16;)k+=n(T[E]*B)/B,k+=E===15?")":",",E+=1;return k}function C(E){var T=1e4;return E<1e-6&&E>0||E>-1e-6&&E<0?n(E*T)/T:E}function L(){var E=this.props,T=C(E[0]),k=C(E[1]),B=C(E[4]),ee=C(E[5]),oe=C(E[12]),X=C(E[13]);return"matrix("+T+","+k+","+B+","+ee+","+oe+","+X+")"}return function(){this.reset=r,this.rotate=s,this.rotateX=a,this.rotateY=o,this.rotateZ=l,this.skew=u,this.skewFromAxis=d,this.shear=h,this.scale=f,this.setTransform=p,this.translate=m,this.transform=g,this.multiply=y,this.applyToPoint=b,this.applyToX=M,this.applyToY=A,this.applyToZ=R,this.applyToPointArray=G,this.applyToTriplePoints=V,this.applyToPointStringified=H,this.toCSS=O,this.to2dCSS=L,this.clone=v,this.cloneFromProps=_,this.equals=x,this.inversePoints=N,this.inversePoint=P,this.getInverseMatrix=w,this._t=this.transform,this.isIdentity=c,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}})();function _typeof$3(i){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(i)}var lottie={};function setLocation(i){setLocationHref(i)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(i){setSubframeEnabled(i)}function setPrefix(i){setIdPrefix(i)}function loadAnimation(i){return animationManager.loadAnimation(i)}function setQuality(i){if(typeof i=="string")switch(i){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(i)&&i>1&&setDefaultCurveSegments(i)}function inBrowser(){return typeof navigator<"u"}function installPlugin(i,e){i==="expressions"&&setExpressionsPlugin(e)}function getFactory(i){switch(i){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(i){for(var e=queryString.split("&"),t=0;t<e.length;t+=1){var n=e[t].split("=");if(decodeURIComponent(n[0])==i)return decodeURIComponent(n[1])}return null}var queryString="";{var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);try{_typeof$3(exports)!=="object"&&(window.bodymovin=lottie)}catch(i){}var ShapeModifiers=(function(){var i={},e={};i.registerModifier=t,i.getModifier=n;function t(r,s){e[r]||(e[r]=s)}function n(r,s,a){return new e[r](s,a)}return i})();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(i){if(!this.closed){i.sh.container.addDynamicProperty(i.sh);var e={shape:i.sh,data:i,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&i.setAsAnimated()}},ShapeModifier.prototype.init=function(i,e){this.shapes=[],this.elem=i,this.initDynamicPropertyContainer(i),this.initModifierProperties(i,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(i,e){this.s=PropertyFactory.getProp(i,e.s,0,.01,this),this.e=PropertyFactory.getProp(i,e.e,0,.01,this),this.o=PropertyFactory.getProp(i,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(i){i.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(i,e,t,n,r){var s=[];e<=1?s.push({s:i,e}):i>=1?s.push({s:i-1,e:e-1}):(s.push({s:i,e:1}),s.push({s:0,e:e-1}));var a=[],o,l=s.length,h;for(o=0;o<l;o+=1)if(h=s[o],!(h.e*r<n||h.s*r>n+t)){var u,d;h.s*r<=n?u=0:u=(h.s*r-n)/t,h.e*r>=n+t?d=1:d=(h.e*r-n)/t,a.push([u,d])}return a.length||a.push([0,0]),a},TrimModifier.prototype.releasePathsData=function(i){var e,t=i.length;for(e=0;e<t;e+=1)segmentsLengthPool.release(i[e]);return i.length=0,i},TrimModifier.prototype.processShapes=function(i){var e,t;if(this._mdf||i){var n=this.o.v%360/360;if(n<0&&(n+=1),this.s.v>1?e=1+n:this.s.v<0?e=0+n:e=this.s.v+n,this.e.v>1?t=1+n:this.e.v<0?t=0+n:t=this.e.v+n,e>t){var r=e;e=t,t=r}e=Math.round(e*1e4)*1e-4,t=Math.round(t*1e4)*1e-4,this.sValue=e,this.eValue=t}else e=this.sValue,t=this.eValue;var s,a,o=this.shapes.length,l,h,u,d,f,p=0;if(t===e)for(a=0;a<o;a+=1)this.shapes[a].localShapeCollection.releaseShapes(),this.shapes[a].shape._mdf=!0,this.shapes[a].shape.paths=this.shapes[a].localShapeCollection,this._mdf&&(this.shapes[a].pathsData.length=0);else if(t===1&&e===0||t===0&&e===1){if(this._mdf)for(a=0;a<o;a+=1)this.shapes[a].pathsData.length=0,this.shapes[a].shape._mdf=!0}else{var m=[],g,y;for(a=0;a<o;a+=1)if(g=this.shapes[a],!g.shape._mdf&&!this._mdf&&!i&&this.m!==2)g.shape.paths=g.localShapeCollection;else{if(s=g.shape.paths,h=s._length,f=0,!g.shape._mdf&&g.pathsData.length)f=g.totalShapeLength;else{for(u=this.releasePathsData(g.pathsData),l=0;l<h;l+=1)d=bez.getSegmentsLength(s.shapes[l]),u.push(d),f+=d.totalLength;g.totalShapeLength=f,g.pathsData=u}p+=f,g.shape._mdf=!0}var c=e,x=t,v=0,_;for(a=o-1;a>=0;a-=1)if(g=this.shapes[a],g.shape._mdf){for(y=g.localShapeCollection,y.releaseShapes(),this.m===2&&o>1?(_=this.calculateShapeEdges(e,t,g.totalShapeLength,v,p),v+=g.totalShapeLength):_=[[c,x]],h=_.length,l=0;l<h;l+=1){c=_[l][0],x=_[l][1],m.length=0,x<=1?m.push({s:g.totalShapeLength*c,e:g.totalShapeLength*x}):c>=1?m.push({s:g.totalShapeLength*(c-1),e:g.totalShapeLength*(x-1)}):(m.push({s:g.totalShapeLength*c,e:g.totalShapeLength}),m.push({s:0,e:g.totalShapeLength*(x-1)}));var b=this.addShapes(g,m[0]);if(m[0].s!==m[0].e){if(m.length>1){var M=g.shape.paths.shapes[g.shape.paths._length-1];if(M.c){var A=b.pop();this.addPaths(b,y),b=this.addShapes(g,m[1],A)}else this.addPaths(b,y),b=this.addShapes(g,m[1])}this.addPaths(b,y)}}g.shape.paths=y}}},TrimModifier.prototype.addPaths=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)e.addShape(i[t])},TrimModifier.prototype.addSegment=function(i,e,t,n,r,s,a){r.setXYAt(e[0],e[1],"o",s),r.setXYAt(t[0],t[1],"i",s+1),a&&r.setXYAt(i[0],i[1],"v",s),r.setXYAt(n[0],n[1],"v",s+1)},TrimModifier.prototype.addSegmentFromArray=function(i,e,t,n){e.setXYAt(i[1],i[5],"o",t),e.setXYAt(i[2],i[6],"i",t+1),n&&e.setXYAt(i[0],i[4],"v",t),e.setXYAt(i[3],i[7],"v",t+1)},TrimModifier.prototype.addShapes=function(i,e,t){var n=i.pathsData,r=i.shape.paths.shapes,s,a=i.shape.paths._length,o,l,h=0,u,d,f,p,m=[],g,y=!0;for(t?(d=t._length,g=t._length):(t=shapePool.newElement(),d=0,g=0),m.push(t),s=0;s<a;s+=1){for(f=n[s].lengths,t.c=r[s].c,l=r[s].c?f.length:f.length+1,o=1;o<l;o+=1)if(u=f[o-1],h+u.addedLength<e.s)h+=u.addedLength,t.c=!1;else if(h>e.e){t.c=!1;break}else e.s<=h&&e.e>=h+u.addedLength?(this.addSegment(r[s].v[o-1],r[s].o[o-1],r[s].i[o],r[s].v[o],t,d,y),y=!1):(p=bez.getNewSegment(r[s].v[o-1],r[s].v[o],r[s].o[o-1],r[s].i[o],(e.s-h)/u.addedLength,(e.e-h)/u.addedLength,f[o-1]),this.addSegmentFromArray(p,t,d,y),y=!1,t.c=!1),h+=u.addedLength,d+=1;if(r[s].c&&f.length){if(u=f[o-1],h<=e.e){var c=f[o-1].addedLength;e.s<=h&&e.e>=h+c?(this.addSegment(r[s].v[o-1],r[s].o[o-1],r[s].i[0],r[s].v[0],t,d,y),y=!1):(p=bez.getNewSegment(r[s].v[o-1],r[s].v[0],r[s].o[o-1],r[s].i[0],(e.s-h)/c,(e.e-h)/c,f[o-1]),this.addSegmentFromArray(p,t,d,y),y=!1,t.c=!1)}else t.c=!1;h+=u.addedLength,d+=1}if(t._length&&(t.setXYAt(t.v[g][0],t.v[g][1],"i",g),t.setXYAt(t.v[t._length-1][0],t.v[t._length-1][1],"o",t._length-1)),h>e.e)break;s<a-1&&(t=shapePool.newElement(),y=!0,m.push(t),d=0)}return m};function PuckerAndBloatModifier(){}extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(i,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(i,e){var t=e/100,n=[0,0],r=i._length,s=0;for(s=0;s<r;s+=1)n[0]+=i.v[s][0],n[1]+=i.v[s][1];n[0]/=r,n[1]/=r;var a=shapePool.newElement();a.c=i.c;var o,l,h,u,d,f;for(s=0;s<r;s+=1)o=i.v[s][0]+(n[0]-i.v[s][0])*t,l=i.v[s][1]+(n[1]-i.v[s][1])*t,h=i.o[s][0]+(n[0]-i.o[s][0])*-t,u=i.o[s][1]+(n[1]-i.o[s][1])*-t,d=i.i[s][0]+(n[0]-i.i[s][0])*-t,f=i.i[s][1]+(n[1]-i.i[s][1])*-t,a.setTripleAt(o,l,h,u,d,f,s);return a},PuckerAndBloatModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.amount.v;if(a!==0){var o,l;for(t=0;t<n;t+=1){if(o=this.shapes[t],l=o.localShapeCollection,!(!o.shape._mdf&&!this._mdf&&!i))for(l.releaseShapes(),o.shape._mdf=!0,e=o.shape.paths.shapes,s=o.shape.paths._length,r=0;r<s;r+=1)l.addShape(this.processPath(e[r],a));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=(function(){var i=[0,0];function e(l){var h=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||h,this.a&&l.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&l.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&l.skewFromAxis(-this.sk.v,this.sa.v),this.r?l.rotate(-this.r.v):l.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?l.translate(this.px.v,this.py.v,-this.pz.v):l.translate(this.px.v,this.py.v,0):l.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function t(l){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||l){var h;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var u,d;if(h=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(u=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/h,0),d=this.p.getValueAtTime(this.p.keyframes[0].t/h,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(u=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/h,0),d=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/h,0)):(u=this.p.pv,d=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/h,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){u=[],d=[];var f=this.px,p=this.py;f._caching.lastFrame+f.offsetTime<=f.keyframes[0].t?(u[0]=f.getValueAtTime((f.keyframes[0].t+.01)/h,0),u[1]=p.getValueAtTime((p.keyframes[0].t+.01)/h,0),d[0]=f.getValueAtTime(f.keyframes[0].t/h,0),d[1]=p.getValueAtTime(p.keyframes[0].t/h,0)):f._caching.lastFrame+f.offsetTime>=f.keyframes[f.keyframes.length-1].t?(u[0]=f.getValueAtTime(f.keyframes[f.keyframes.length-1].t/h,0),u[1]=p.getValueAtTime(p.keyframes[p.keyframes.length-1].t/h,0),d[0]=f.getValueAtTime((f.keyframes[f.keyframes.length-1].t-.01)/h,0),d[1]=p.getValueAtTime((p.keyframes[p.keyframes.length-1].t-.01)/h,0)):(u=[f.pv,p.pv],d[0]=f.getValueAtTime((f._caching.lastFrame+f.offsetTime-.01)/h,f.offsetTime),d[1]=p.getValueAtTime((p._caching.lastFrame+p.offsetTime-.01)/h,p.offsetTime))}else d=i,u=d;this.v.rotate(-Math.atan2(u[1]-d[1],u[0]-d[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function n(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function r(){}function s(l){this._addDynamicProperty(l),this.elem.addDynamicProperty(l),this._isDirty=!0}function a(l,h,u){if(this.elem=l,this.frameId=-1,this.propType="transform",this.data=h,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(u||l),h.p&&h.p.s?(this.px=PropertyFactory.getProp(l,h.p.x,0,0,this),this.py=PropertyFactory.getProp(l,h.p.y,0,0,this),h.p.z&&(this.pz=PropertyFactory.getProp(l,h.p.z,0,0,this))):this.p=PropertyFactory.getProp(l,h.p||{k:[0,0,0]},1,0,this),h.rx){if(this.rx=PropertyFactory.getProp(l,h.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(l,h.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(l,h.rz,0,degToRads,this),h.or.k[0].ti){var d,f=h.or.k.length;for(d=0;d<f;d+=1)h.or.k[d].to=null,h.or.k[d].ti=null}this.or=PropertyFactory.getProp(l,h.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(l,h.r||{k:0},0,degToRads,this);h.sk&&(this.sk=PropertyFactory.getProp(l,h.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(l,h.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(l,h.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(l,h.s||{k:[100,100,100]},1,.01,this),h.o?this.o=PropertyFactory.getProp(l,h.o,0,.01,l):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}a.prototype={applyToMatrix:e,getValue:t,precalculateMatrix:n,autoOrient:r},extendPrototype([DynamicPropertyContainer],a),a.prototype.addDynamicProperty=s,a.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty;function o(l,h,u){return new a(l,h,u)}return{getTransformProperty:o}})();function RepeaterModifier(){}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(i,e.c,0,null,this),this.o=PropertyFactory.getProp(i,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(i,e.tr,this),this.so=PropertyFactory.getProp(i,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(i,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(i,e,t,n,r,s){var a=s?-1:1,o=n.s.v[0]+(1-n.s.v[0])*(1-r),l=n.s.v[1]+(1-n.s.v[1])*(1-r);i.translate(n.p.v[0]*a*r,n.p.v[1]*a*r,n.p.v[2]),e.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),e.rotate(-n.r.v*a*r),e.translate(n.a.v[0],n.a.v[1],n.a.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.scale(s?1/o:o,s?1/l:l),t.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(i,e,t,n){for(this.elem=i,this.arr=e,this.pos=t,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(i),this.initModifierProperties(i,e[t]);t>0;)t-=1,this._elements.unshift(e[t]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(i){var e,t=i.length;for(e=0;e<t;e+=1)i[e]._processed=!1,i[e].ty==="gr"&&this.resetElements(i[e].it)},RepeaterModifier.prototype.cloneElements=function(i){var e=JSON.parse(JSON.stringify(i));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)i[t]._render=e,i[t].ty==="gr"&&this.changeGroupRender(i[t].it,e)},RepeaterModifier.prototype.processShapes=function(i){var e,t,n,r,s,a=!1;if(this._mdf||i){var o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var l={it:this.cloneElements(this._elements),ty:"gr"};l.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,l),this._groups.splice(0,0,l),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}s=0;var h;for(n=0;n<=this._groups.length-1;n+=1){if(h=s<o,this._groups[n]._render=h,this.changeGroupRender(this._groups[n].it,h),!h){var u=this.elemsData[n].it,d=u[u.length-1];d.transform.op.v!==0?(d.transform.op._mdf=!0,d.transform.op.v=0):d.transform.op._mdf=!1}s+=1}this._currentCopies=o;var f=this.o.v,p=f%1,m=f>0?Math.floor(f):Math.ceil(f),g=this.pMatrix.props,y=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var x=0;if(f>0){for(;x<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),x+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),x+=p)}else if(f<0){for(;x>m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),x-=p)}n=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,s=this._currentCopies;for(var v,_;s;){if(e=this.elemsData[n].it,t=e[e.length-1].transform.mProps.v.props,_=t.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),x!==0){for((n!==0&&r===1||n!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),v=0;v<_;v+=1)t[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<_;v+=1)t[v]=this.matrix.props[v];x+=1,s-=1,n+=r}}else for(s=this._currentCopies,n=0,r=1;s;)e=this.elemsData[n].it,t=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,s-=1,n+=r;return a},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(i,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(i,e){var t=shapePool.newElement();t.c=i.c;var n,r=i._length,s,a,o,l,h,u,d=0,f,p,m,g,y,c;for(n=0;n<r;n+=1)s=i.v[n],o=i.o[n],a=i.i[n],s[0]===o[0]&&s[1]===o[1]&&s[0]===a[0]&&s[1]===a[1]?(n===0||n===r-1)&&!i.c?(t.setTripleAt(s[0],s[1],o[0],o[1],a[0],a[1],d),d+=1):(n===0?l=i.v[r-1]:l=i.v[n-1],h=Math.sqrt(Math.pow(s[0]-l[0],2)+Math.pow(s[1]-l[1],2)),u=h?Math.min(h/2,e)/h:0,y=s[0]+(l[0]-s[0])*u,f=y,c=s[1]-(s[1]-l[1])*u,p=c,m=f-(f-s[0])*roundCorner,g=p-(p-s[1])*roundCorner,t.setTripleAt(f,p,m,g,y,c,d),d+=1,n===r-1?l=i.v[0]:l=i.v[n+1],h=Math.sqrt(Math.pow(s[0]-l[0],2)+Math.pow(s[1]-l[1],2)),u=h?Math.min(h/2,e)/h:0,m=s[0]+(l[0]-s[0])*u,f=m,g=s[1]+(l[1]-s[1])*u,p=g,y=f-(f-s[0])*roundCorner,c=p-(p-s[1])*roundCorner,t.setTripleAt(f,p,m,g,y,c,d),d+=1):(t.setTripleAt(i.v[n][0],i.v[n][1],i.o[n][0],i.o[n][1],i.i[n][0],i.i[n][1],d),d+=1);return t},RoundCornersModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.rd.v;if(a!==0){var o,l;for(t=0;t<n;t+=1){if(o=this.shapes[t],l=o.localShapeCollection,!(!o.shape._mdf&&!this._mdf&&!i))for(l.releaseShapes(),o.shape._mdf=!0,e=o.shape.paths.shapes,s=o.shape.paths._length,r=0;r<s;r+=1)l.addShape(this.processPath(e[r],a));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function floatEqual(i,e){return Math.abs(i-e)*1e5<=Math.min(Math.abs(i),Math.abs(e))}function floatZero(i){return Math.abs(i)<=1e-5}function lerp(i,e,t){return i*(1-t)+e*t}function lerpPoint(i,e,t){return[lerp(i[0],e[0],t),lerp(i[1],e[1],t)]}function quadRoots(i,e,t){if(i===0)return[];var n=e*e-4*i*t;if(n<0)return[];var r=-e/(2*i);if(n===0)return[r];var s=Math.sqrt(n)/(2*i);return[r-s,r+s]}function polynomialCoefficients(i,e,t,n){return[-i+3*e-3*t+n,3*i-6*e+3*t,-3*i+3*e,i]}function singlePoint(i){return new PolynomialBezier(i,i,i,i,!1)}function PolynomialBezier(i,e,t,n,r){r&&pointEqual(i,e)&&(e=lerpPoint(i,n,1/3)),r&&pointEqual(t,n)&&(t=lerpPoint(i,n,2/3));var s=polynomialCoefficients(i[0],e[0],t[0],n[0]),a=polynomialCoefficients(i[1],e[1],t[1],n[1]);this.a=[s[0],a[0]],this.b=[s[1],a[1]],this.c=[s[2],a[2]],this.d=[s[3],a[3]],this.points=[i,e,t,n]}PolynomialBezier.prototype.point=function(i){return[((this.a[0]*i+this.b[0])*i+this.c[0])*i+this.d[0],((this.a[1]*i+this.b[1])*i+this.c[1])*i+this.d[1]]},PolynomialBezier.prototype.derivative=function(i){return[(3*i*this.a[0]+2*this.b[0])*i+this.c[0],(3*i*this.a[1]+2*this.b[1])*i+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(i){var e=this.derivative(i);return Math.atan2(e[1],e[0])},PolynomialBezier.prototype.normalAngle=function(i){var e=this.derivative(i);return Math.atan2(e[0],e[1])},PolynomialBezier.prototype.inflectionPoints=function(){var i=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(i))return[];var e=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/i,t=e*e-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/i;if(t<0)return[];var n=Math.sqrt(t);return floatZero(n)?n>0&&n<1?[e]:[]:[e-n,e+n].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(i){if(i<=0)return[singlePoint(this.points[0]),this];if(i>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],i),t=lerpPoint(this.points[1],this.points[2],i),n=lerpPoint(this.points[2],this.points[3],i),r=lerpPoint(e,t,i),s=lerpPoint(t,n,i),a=lerpPoint(r,s,i);return[new PolynomialBezier(this.points[0],e,r,a,!0),new PolynomialBezier(a,s,n,this.points[3],!0)]};function extrema(i,e){var t=i.points[0][e],n=i.points[i.points.length-1][e];if(t>n){var r=n;n=t,t=r}for(var s=quadRoots(3*i.a[e],2*i.b[e],i.c[e]),a=0;a<s.length;a+=1)if(s[a]>0&&s[a]<1){var o=i.point(s[a])[e];o<t?t=o:o>n&&(n=o)}return{min:t,max:n}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var i=this.bounds();return{left:i.x.min,right:i.x.max,top:i.y.min,bottom:i.y.max,width:i.x.max-i.x.min,height:i.y.max-i.y.min,cx:(i.x.max+i.x.min)/2,cy:(i.y.max+i.y.min)/2}};function intersectData(i,e,t){var n=i.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:i,t:(e+t)/2,t1:e,t2:t}}function splitData(i){var e=i.bez.split(.5);return[intersectData(e[0],i.t1,i.t),intersectData(e[1],i.t,i.t2)]}function boxIntersect(i,e){return Math.abs(i.cx-e.cx)*2<i.width+e.width&&Math.abs(i.cy-e.cy)*2<i.height+e.height}function intersectsImpl(i,e,t,n,r,s){if(boxIntersect(i,e)){if(t>=s||i.width<=n&&i.height<=n&&e.width<=n&&e.height<=n){r.push([i.t,e.t]);return}var a=splitData(i),o=splitData(e);intersectsImpl(a[0],o[0],t+1,n,r,s),intersectsImpl(a[0],o[1],t+1,n,r,s),intersectsImpl(a[1],o[0],t+1,n,r,s),intersectsImpl(a[1],o[1],t+1,n,r,s)}}PolynomialBezier.prototype.intersections=function(i,e,t){e===void 0&&(e=2),t===void 0&&(t=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(i,0,1),0,e,n,t),n},PolynomialBezier.shapeSegment=function(i,e){var t=(e+1)%i.length();return new PolynomialBezier(i.v[e],i.o[e],i.i[t],i.v[t],!0)},PolynomialBezier.shapeSegmentInverted=function(i,e){var t=(e+1)%i.length();return new PolynomialBezier(i.v[t],i.i[t],i.o[e],i.v[e],!0)};function crossProduct(i,e){return[i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function lineIntersection(i,e,t,n){var r=[i[0],i[1],1],s=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],l=crossProduct(crossProduct(r,s),crossProduct(a,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(i,e,t){return[i[0]+Math.cos(e)*t,i[1]-Math.sin(e)*t]}function pointDistance(i,e){return Math.hypot(i[0]-e[0],i[1]-e[1])}function pointEqual(i,e){return floatEqual(i[0],e[0])&&floatEqual(i[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(i,e.s,0,null,this),this.frequency=PropertyFactory.getProp(i,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(i,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(i,e,t,n,r,s,a){var o=t-Math.PI/2,l=t+Math.PI/2,h=e[0]+Math.cos(t)*n*r,u=e[1]-Math.sin(t)*n*r;i.setTripleAt(h,u,h+Math.cos(o)*s,u-Math.sin(o)*s,h+Math.cos(l)*a,u-Math.sin(l)*a,i.length())}function getPerpendicularVector(i,e){var t=[e[0]-i[0],e[1]-i[1]],n=-Math.PI*.5,r=[Math.cos(n)*t[0]-Math.sin(n)*t[1],Math.sin(n)*t[0]+Math.cos(n)*t[1]];return r}function getProjectingAngle(i,e){var t=e===0?i.length()-1:e-1,n=(e+1)%i.length(),r=i.v[t],s=i.v[n],a=getPerpendicularVector(r,s);return Math.atan2(0,1)-Math.atan2(a[1],a[0])}function zigZagCorner(i,e,t,n,r,s,a){var o=getProjectingAngle(e,t),l=e.v[t%e._length],h=e.v[t===0?e._length-1:t-1],u=e.v[(t+1)%e._length],d=s===2?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0,f=s===2?Math.sqrt(Math.pow(l[0]-u[0],2)+Math.pow(l[1]-u[1],2)):0;setPoint(i,e.v[t%e._length],o,a,n,f/((r+1)*2),d/((r+1)*2))}function zigZagSegment(i,e,t,n,r,s){for(var a=0;a<n;a+=1){var o=(a+1)/(n+1),l=r===2?Math.sqrt(Math.pow(e.points[3][0]-e.points[0][0],2)+Math.pow(e.points[3][1]-e.points[0][1],2)):0,h=e.normalAngle(o),u=e.point(o);setPoint(i,u,h,s,t,l/((n+1)*2),l/((n+1)*2)),s=-s}return s}ZigZagModifier.prototype.processPath=function(i,e,t,n){var r=i._length,s=shapePool.newElement();if(s.c=i.c,i.c||(r-=1),r===0)return s;var a=-1,o=PolynomialBezier.shapeSegment(i,0);zigZagCorner(s,i,0,e,t,n,a);for(var l=0;l<r;l+=1)a=zigZagSegment(s,o,e,t,n,-a),l===r-1&&!i.c?o=null:o=PolynomialBezier.shapeSegment(i,(l+1)%r),zigZagCorner(s,i,l+1,e,t,n,a);return s},ZigZagModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.amplitude.v,o=Math.max(0,Math.round(this.frequency.v)),l=this.pointsType.v;if(a!==0){var h,u;for(t=0;t<n;t+=1){if(h=this.shapes[t],u=h.localShapeCollection,!(!h.shape._mdf&&!this._mdf&&!i))for(u.releaseShapes(),h.shape._mdf=!0,e=h.shape.paths.shapes,s=h.shape.paths._length,r=0;r<s;r+=1)u.addShape(this.processPath(e[r],a,o,l));h.shape.paths=h.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function linearOffset(i,e,t){var n=Math.atan2(e[0]-i[0],e[1]-i[1]);return[polarOffset(i,n,t),polarOffset(e,n,t)]}function offsetSegment(i,e){var t,n,r,s,a,o,l;l=linearOffset(i.points[0],i.points[1],e),t=l[0],n=l[1],l=linearOffset(i.points[1],i.points[2],e),r=l[0],s=l[1],l=linearOffset(i.points[2],i.points[3],e),a=l[0],o=l[1];var h=lineIntersection(t,n,r,s);h===null&&(h=n);var u=lineIntersection(a,o,r,s);return u===null&&(u=a),new PolynomialBezier(t,h,u,o)}function joinLines(i,e,t,n,r){var s=e.points[3],a=t.points[0];if(n===3||pointEqual(s,a))return s;if(n===2){var o=-e.tangentAngle(1),l=-t.tangentAngle(0)+Math.PI,h=lineIntersection(s,polarOffset(s,o+Math.PI/2,100),a,polarOffset(a,o+Math.PI/2,100)),u=h?pointDistance(h,s):pointDistance(s,a)/2,d=polarOffset(s,o,2*u*roundCorner);return i.setXYAt(d[0],d[1],"o",i.length()-1),d=polarOffset(a,l,2*u*roundCorner),i.setTripleAt(a[0],a[1],a[0],a[1],d[0],d[1],i.length()),a}var f=pointEqual(s,e.points[2])?e.points[0]:e.points[2],p=pointEqual(a,t.points[1])?t.points[3]:t.points[1],m=lineIntersection(f,s,a,p);return m&&pointDistance(m,s)<r?(i.setTripleAt(m[0],m[1],m[0],m[1],m[0],m[1],i.length()),m):s}function getIntersection(i,e){var t=i.intersections(e);return t.length&&floatEqual(t[0][0],1)&&t.shift(),t.length?t[0]:null}function pruneSegmentIntersection(i,e){var t=i.slice(),n=e.slice(),r=getIntersection(i[i.length-1],e[0]);return r&&(t[i.length-1]=i[i.length-1].split(r[0])[0],n[0]=e[0].split(r[1])[1]),i.length>1&&e.length>1&&(r=getIntersection(i[0],e[e.length-1]),r)?[[i[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[t,n]}function pruneIntersections(i){for(var e,t=1;t<i.length;t+=1)e=pruneSegmentIntersection(i[t-1],i[t]),i[t-1]=e[0],i[t]=e[1];return i.length>1&&(e=pruneSegmentIntersection(i[i.length-1],i[0]),i[i.length-1]=e[0],i[0]=e[1]),i}function offsetSegmentSplit(i,e){var t=i.inflectionPoints(),n,r,s,a;if(t.length===0)return[offsetSegment(i,e)];if(t.length===1||floatEqual(t[1],1))return s=i.split(t[0]),n=s[0],r=s[1],[offsetSegment(n,e),offsetSegment(r,e)];s=i.split(t[0]),n=s[0];var o=(t[1]-t[0])/(1-t[0]);return s=s[1].split(o),a=s[0],r=s[1],[offsetSegment(n,e),offsetSegment(a,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(i,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(i,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(i,e,t,n){var r=shapePool.newElement();r.c=i.c;var s=i.length();i.c||(s-=1);var a,o,l,h=[];for(a=0;a<s;a+=1)l=PolynomialBezier.shapeSegment(i,a),h.push(offsetSegmentSplit(l,e));if(!i.c)for(a=s-1;a>=0;a-=1)l=PolynomialBezier.shapeSegmentInverted(i,a),h.push(offsetSegmentSplit(l,e));h=pruneIntersections(h);var u=null,d=null;for(a=0;a<h.length;a+=1){var f=h[a];for(d&&(u=joinLines(r,d,f[0],t,n)),d=f[f.length-1],o=0;o<f.length;o+=1)l=f[o],u&&pointEqual(l.points[0],u)?r.setXYAt(l.points[1][0],l.points[1][1],"o",r.length()-1):r.setTripleAt(l.points[0][0],l.points[0][1],l.points[1][0],l.points[1][1],l.points[0][0],l.points[0][1],r.length()),r.setTripleAt(l.points[3][0],l.points[3][1],l.points[3][0],l.points[3][1],l.points[2][0],l.points[2][1],r.length()),u=l.points[3]}return h.length&&joinLines(r,d,h[0][0],t,n),r},OffsetPathModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.amount.v,o=this.miterLimit.v,l=this.lineJoin;if(a!==0){var h,u;for(t=0;t<n;t+=1){if(h=this.shapes[t],u=h.localShapeCollection,!(!h.shape._mdf&&!this._mdf&&!i))for(u.releaseShapes(),h.shape._mdf=!0,e=h.shape.paths.shapes,s=h.shape.paths._length,r=0;r<s;r+=1)u.addShape(this.processPath(e[r],a,l,o));h.shape.paths=h.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function getFontProperties(i){for(var e=i.fStyle?i.fStyle.split(" "):[],t="normal",n="normal",r=e.length,s,a=0;a<r;a+=1)switch(s=e[a].toLowerCase(),s){case"italic":n="italic";break;case"bold":t="700";break;case"black":t="900";break;case"medium":t="500";break;case"regular":case"normal":t="400";break;case"light":case"thin":t="200";break}return{style:n,weight:i.fWeight||t}}var FontManager=(function(){var i=5e3,e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var n=127988,r=917631,s=917601,a=917626,o=65039,l=8205,h=127462,u=127487,d=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function f(C){var L=C.split(","),E,T=L.length,k=[];for(E=0;E<T;E+=1)L[E]!=="sans-serif"&&L[E]!=="monospace"&&k.push(L[E]);return k.join(",")}function p(C,L){var E=createTag("span");E.setAttribute("aria-hidden",!0),E.style.fontFamily=L;var T=createTag("span");T.innerText="giItT1WQy@!-/#",E.style.position="absolute",E.style.left="-10000px",E.style.top="-10000px",E.style.fontSize="300px",E.style.fontVariant="normal",E.style.fontStyle="normal",E.style.fontWeight="normal",E.style.letterSpacing="0",E.appendChild(T),document.body.appendChild(E);var k=T.offsetWidth;return T.style.fontFamily=f(C)+", "+L,{node:T,w:k,parent:E}}function m(){var C,L=this.fonts.length,E,T,k=L;for(C=0;C<L;C+=1)this.fonts[C].loaded?k-=1:this.fonts[C].fOrigin==="n"||this.fonts[C].origin===0?this.fonts[C].loaded=!0:(E=this.fonts[C].monoCase.node,T=this.fonts[C].monoCase.w,E.offsetWidth!==T?(k-=1,this.fonts[C].loaded=!0):(E=this.fonts[C].sansCase.node,T=this.fonts[C].sansCase.w,E.offsetWidth!==T&&(k-=1,this.fonts[C].loaded=!0)),this.fonts[C].loaded&&(this.fonts[C].sansCase.parent.parentNode.removeChild(this.fonts[C].sansCase.parent),this.fonts[C].monoCase.parent.parentNode.removeChild(this.fonts[C].monoCase.parent)));k!==0&&Date.now()-this.initTime<i?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}function g(C,L){var E=document.body&&L?"svg":"canvas",T,k=getFontProperties(C);if(E==="svg"){var B=createNS("text");B.style.fontSize="100px",B.setAttribute("font-family",C.fFamily),B.setAttribute("font-style",k.style),B.setAttribute("font-weight",k.weight),B.textContent="1",C.fClass?(B.style.fontFamily="inherit",B.setAttribute("class",C.fClass)):B.style.fontFamily=C.fFamily,L.appendChild(B),T=B}else{var ee=new OffscreenCanvas(500,500).getContext("2d");ee.font=k.style+" "+k.weight+" 100px "+C.fFamily,T=ee}function oe(X){return E==="svg"?(T.textContent=X,T.getComputedTextLength()):T.measureText(X).width}return{measureText:oe}}function y(C,L){if(!C){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=C.list;return}if(!document.body){this.isLoaded=!0,C.list.forEach(function(me){me.helper=g(me),me.cache={}}),this.fonts=C.list;return}var E=C.list,T,k=E.length,B=k;for(T=0;T<k;T+=1){var ee=!0,oe,X;if(E[T].loaded=!1,E[T].monoCase=p(E[T].fFamily,"monospace"),E[T].sansCase=p(E[T].fFamily,"sans-serif"),!E[T].fPath)E[T].loaded=!0,B-=1;else if(E[T].fOrigin==="p"||E[T].origin===3){if(oe=document.querySelectorAll('style[f-forigin="p"][f-family="'+E[T].fFamily+'"], style[f-origin="3"][f-family="'+E[T].fFamily+'"]'),oe.length>0&&(ee=!1),ee){var Q=createTag("style");Q.setAttribute("f-forigin",E[T].fOrigin),Q.setAttribute("f-origin",E[T].origin),Q.setAttribute("f-family",E[T].fFamily),Q.type="text/css",Q.innerText="@font-face {font-family: "+E[T].fFamily+"; font-style: normal; src: url('"+E[T].fPath+"');}",L.appendChild(Q)}}else if(E[T].fOrigin==="g"||E[T].origin===1){for(oe=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),X=0;X<oe.length;X+=1)oe[X].href.indexOf(E[T].fPath)!==-1&&(ee=!1);if(ee){var ne=createTag("link");ne.setAttribute("f-forigin",E[T].fOrigin),ne.setAttribute("f-origin",E[T].origin),ne.type="text/css",ne.rel="stylesheet",ne.href=E[T].fPath,document.body.appendChild(ne)}}else if(E[T].fOrigin==="t"||E[T].origin===2){for(oe=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),X=0;X<oe.length;X+=1)E[T].fPath===oe[X].src&&(ee=!1);if(ee){var re=createTag("link");re.setAttribute("f-forigin",E[T].fOrigin),re.setAttribute("f-origin",E[T].origin),re.setAttribute("rel","stylesheet"),re.setAttribute("href",E[T].fPath),L.appendChild(re)}}E[T].helper=g(E[T],L),E[T].cache={},this.fonts.push(E[T])}B===0?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}function c(C){if(C){this.chars||(this.chars=[]);var L,E=C.length,T,k=this.chars.length,B;for(L=0;L<E;L+=1){for(T=0,B=!1;T<k;)this.chars[T].style===C[L].style&&this.chars[T].fFamily===C[L].fFamily&&this.chars[T].ch===C[L].ch&&(B=!0),T+=1;B||(this.chars.push(C[L]),k+=1)}}}function x(C,L,E){for(var T=0,k=this.chars.length;T<k;){if(this.chars[T].ch===C&&this.chars[T].style===L&&this.chars[T].fFamily===E)return this.chars[T];T+=1}return(typeof C=="string"&&C.charCodeAt(0)!==13||!C)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",C,L,E)),e}function v(C,L,E){var T=this.getFontByName(L),k=C;if(!T.cache[k]){var B=T.helper;if(C===" "){var ee=B.measureText("|"+C+"|"),oe=B.measureText("||");T.cache[k]=(ee-oe)/100}else T.cache[k]=B.measureText(C)/100}return T.cache[k]*E}function _(C){for(var L=0,E=this.fonts.length;L<E;){if(this.fonts[L].fName===C)return this.fonts[L];L+=1}return this.fonts[0]}function b(C){var L=0,E=C.charCodeAt(0);if(E>=55296&&E<=56319){var T=C.charCodeAt(1);T>=56320&&T<=57343&&(L=(E-55296)*1024+T-56320+65536)}return L}function M(C,L){var E=C.toString(16)+L.toString(16);return d.indexOf(E)!==-1}function A(C){return C===l}function R(C){return C===o}function w(C){var L=b(C);return L>=h&&L<=u}function P(C){return w(C.substr(0,2))&&w(C.substr(2,2))}function N(C){return t.indexOf(C)!==-1}function V(C,L){var E=b(C.substr(L,2));if(E!==n)return!1;var T=0;for(L+=2;T<5;){if(E=b(C.substr(L,2)),E<s||E>a)return!1;T+=1,L+=2}return b(C.substr(L,2))===r}function G(){this.isLoaded=!0}var H=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};H.isModifier=M,H.isZeroWidthJoiner=A,H.isFlagEmoji=P,H.isRegionalCode=w,H.isCombinedCharacter=N,H.isRegionalFlag=V,H.isVariationSelector=R,H.BLACK_FLAG_CODE_POINT=n;var O={addChars:c,addFonts:y,getCharData:x,getFontByName:_,measureText:v,checkLoadedFonts:m,setIsLoaded:G};return H.prototype=O,H})();function SlotManager(i){this.animationData=i}SlotManager.prototype.getProp=function(i){return this.animationData.slots&&this.animationData.slots[i.sid]?Object.assign(i,this.animationData.slots[i.sid].p):i};function slotFactory(i){return new SlotManager(i)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return this.data.ty===5?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(function(){var i={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(e){return i[e]||""}})();function SliderEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function AngleEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function ColorEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,1,0,t)}function PointEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,1,0,t)}function LayerIndexEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function MaskIndexEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function CheckboxEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function NoValueEffect(){this.p={}}function EffectsManager(i,e){var t=i.ef||[];this.effectElements=[];var n,r=t.length,s;for(n=0;n<r;n+=1)s=new GroupEffect(t[n],e),this.effectElements.push(s)}function GroupEffect(i,e){this.init(i,e)}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(i,e){this.data=i,this.effectElements=[],this.initDynamicPropertyContainer(e);var t,n=this.data.ef.length,r,s=this.data.ef;for(t=0;t<n;t+=1){switch(r=null,s[t].ty){case 0:r=new SliderEffect(s[t],e,this);break;case 1:r=new AngleEffect(s[t],e,this);break;case 2:r=new ColorEffect(s[t],e,this);break;case 3:r=new PointEffect(s[t],e,this);break;case 4:case 7:r=new CheckboxEffect(s[t],e,this);break;case 10:r=new LayerIndexEffect(s[t],e,this);break;case 11:r=new MaskIndexEffect(s[t],e,this);break;case 5:r=new EffectsManager(s[t],e);break;default:r=new NoValueEffect(s[t]);break}r&&this.effectElements.push(r)}};function BaseElement(){}BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if(this.data.masksProperties[e].mode!=="n"&&this.data.masksProperties[e].cl!==!1)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),n=e("effects"),r=e("shape"),s=e("text"),a=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var o=n.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(o),this.data.ty===0||this.data.xt?this.compInterface=a(this):this.data.ty===4?(this.layerInterface.shapeInterface=r(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):this.data.ty===5&&(this.layerInterface.textInterface=s(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm),t=this.baseElement||this.layerElement;t.style["mix-blend-mode"]=e},initBaseData:function(e,t,n){this.globalData=t,this.comp=n,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}};function FrameElement(){}FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var n,r=this.dynamicProperties.length;for(n=0;n<r;n+=1)(t||this._isParent&&this.dynamicProperties[n].propType==="transform")&&(this.dynamicProperties[n].getValue(),this.dynamicProperties[n]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){this.dynamicProperties.indexOf(e)===-1&&this.dynamicProperties.push(e)}};function FootageElement(i,e,t){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(i.refId),this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(i,e,t)}FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var i=getExpressionInterfaces();if(i){var e=i("footage");this.layerInterface=e(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData};function AudioElement(i,e,t){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(i.refId),this.initBaseData(i,e,t),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,i.au&&i.au.lv?i.au.lv:{k:[100]},1,.01,this)}AudioElement.prototype.prepareFrame=function(i){if(this.prepareRenderableFrame(i,!0),this.prepareProperties(i,!0),this.tm._placeholder)this._currentTime=i/this.data.sr;else{var e=this.tm.v;this._currentTime=e}this._volume=this.lv.v[0];var t=this._volume*this._volumeMultiplier;this._previousVolume!==t&&(this._previousVolume=t,this.audio.volume(t))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(i){this.audio.rate(i)},AudioElement.prototype.volume=function(i){this._volumeMultiplier=i,this._previousVolume=i*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(i){var e,t=this.layers.length,n;for(this.completeLayers=!0,e=t-1;e>=0;e-=1)this.elements[e]||(n=this.layers[e],n.ip-n.st<=i-this.layers[e].st&&n.op-n.st>i-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(i){switch(i.ty){case 2:return this.createImage(i);case 0:return this.createComp(i);case 1:return this.createSolid(i);case 3:return this.createNull(i);case 4:return this.createShape(i);case 5:return this.createText(i);case 6:return this.createAudio(i);case 13:return this.createCamera(i);case 15:return this.createFootage(i);default:return this.createNull(i)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(i){return new AudioElement(i,this.globalData,this)},BaseRenderer.prototype.createFootage=function(i){return new FootageElement(i,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var i,e=this.layers.length;for(i=0;i<e;i+=1)this.buildItem(i);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(i){this.completeLayers=!1;var e,t=i.length,n,r=this.layers.length;for(e=0;e<t;e+=1)for(n=0;n<r;){if(this.layers[n].id===i[e].id){this.layers[n]=i[e];break}n+=1}},BaseRenderer.prototype.setProjectInterface=function(i){this.globalData.projectInterface=i},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(i,e,t){for(var n=this.elements,r=this.layers,s=0,a=r.length;s<a;)r[s].ind==e&&(!n[s]||n[s]===!0?(this.buildItem(s),this.addPendingElement(i)):(t.push(n[s]),n[s].setAsParent(),r[s].parent!==void 0?this.buildElementParenting(i,r[s].parent,t):i.setHierarchy(t))),s+=1},BaseRenderer.prototype.addPendingElement=function(i){this.pendingElements.push(i)},BaseRenderer.prototype.searchExtraCompositions=function(i){var e,t=i.length;for(e=0;e<t;e+=1)if(i[e].xt){var n=this.createComp(i[e]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(i){var e,t=this.elements.length;for(e=0;e<t;e+=1)if(this.elements[e].data.ind===i)return this.elements[e];return null},BaseRenderer.prototype.getElementByPath=function(i){var e=i.shift(),t;if(typeof e=="number")t=this.elements[e];else{var n,r=this.elements.length;for(n=0;n<r;n+=1)if(this.elements[n].data.nm===e){t=this.elements[n];break}}return i.length===0?t:t.getElementByPath(i)},BaseRenderer.prototype.setupGlobalData=function(i,e){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(i),this.globalData.fontManager.addChars(i.chars),this.globalData.fontManager.addFonts(i.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=i.fr,this.globalData.nm=i.nm,this.globalData.compSize={w:i.w,h:i.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}TransformElement.prototype={initTransform:function(){var e=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:e,localMat:e,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,n=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;n<r;){if(this.hierarchy[n].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}n+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),n=0;n<r;n+=1)t.multiply(this.hierarchy[n].finalTransform.mProp.v)}(!this.localTransforms||this.finalTransform._matMdf)&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var e=0,t=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;e<t;)this.localTransforms[e]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[e]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),e+=1;if(this.finalTransform._localMatMdf){var n=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(n),e=1;e<t;e+=1){var r=this.localTransforms[e].matrix;n.multiply(r)}n.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var s=this.finalTransform.localOpacity;for(e=0;e<t;e+=1)s*=this.localTransforms[e].opacity*.01;this.finalTransform.localOpacity=s}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var e=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(e.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var t=0,n=e.length;for(t=0;t<n;t+=1)this.localTransforms.push(e[t])}}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var n=!0,r=this.comp;n;)r.finalTransform?(r.data.hasMask&&t.splice(0,0,r.finalTransform),r=r.comp):n=!1;var s,a=t.length,o;for(s=0;s<a;s+=1)o=t[s].mat.applyToPointArray(0,0,0),e=[e[0]-o[0],e[1]-o[1],0];return e},mHelper:new Matrix};function MaskElement(i,e,t){this.data=i,this.element=e,this.globalData=t,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n=this.globalData.defs,r,s=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(s),this.solidPath="";var a,o=this.masksProperties,l=0,h=[],u,d,f=createElementID(),p,m,g,y,c="clipPath",x="clip-path";for(r=0;r<s;r+=1)if((o[r].mode!=="a"&&o[r].mode!=="n"||o[r].inv||o[r].o.k!==100||o[r].o.x)&&(c="mask",x="mask"),(o[r].mode==="s"||o[r].mode==="i")&&l===0?(p=createNS("rect"),p.setAttribute("fill","#ffffff"),p.setAttribute("width",this.element.comp.data.w||0),p.setAttribute("height",this.element.comp.data.h||0),h.push(p)):p=null,a=createNS("path"),o[r].mode==="n")this.viewData[r]={op:PropertyFactory.getProp(this.element,o[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,o[r],3),elem:a,lastPath:""},n.appendChild(a);else{l+=1,a.setAttribute("fill",o[r].mode==="s"?"#000000":"#ffffff"),a.setAttribute("clip-rule","nonzero");var v;if(o[r].x.k!==0?(c="mask",x="mask",y=PropertyFactory.getProp(this.element,o[r].x,0,null,this.element),v=createElementID(),m=createNS("filter"),m.setAttribute("id",v),g=createNS("feMorphology"),g.setAttribute("operator","erode"),g.setAttribute("in","SourceGraphic"),g.setAttribute("radius","0"),m.appendChild(g),n.appendChild(m),a.setAttribute("stroke",o[r].mode==="s"?"#000000":"#ffffff")):(g=null,y=null),this.storedData[r]={elem:a,x:y,expan:g,lastPath:"",lastOperator:"",filterId:v,lastRadius:0},o[r].mode==="i"){d=h.length;var _=createNS("g");for(u=0;u<d;u+=1)_.appendChild(h[u]);var b=createNS("mask");b.setAttribute("mask-type","alpha"),b.setAttribute("id",f+"_"+l),b.appendChild(a),n.appendChild(b),_.setAttribute("mask","url("+getLocationHref()+"#"+f+"_"+l+")"),h.length=0,h.push(_)}else h.push(a);o[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:a,lastPath:"",op:PropertyFactory.getProp(this.element,o[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,o[r],3),invRect:p},this.viewData[r].prop.k||this.drawPath(o[r],this.viewData[r].prop.v,this.viewData[r])}for(this.maskElement=createNS(c),s=h.length,r=0;r<s;r+=1)this.maskElement.appendChild(h[r]);l>0&&(this.maskElement.setAttribute("id",f),this.element.maskedElement.setAttribute(x,"url("+getLocationHref()+"#"+f+")"),n.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(i){return this.viewData[i].prop},MaskElement.prototype.renderFrame=function(i){var e=this.element.finalTransform.mat,t,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||i)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||i)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),this.masksProperties[t].mode!=="n"&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||i)&&this.viewData[t].invRect.setAttribute("transform",e.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||i))){var r=this.storedData[t].expan;this.storedData[t].x.v<0?(this.storedData[t].lastOperator!=="erode"&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),r.setAttribute("radius",-this.storedData[t].x.v)):(this.storedData[t].lastOperator!=="dilate"&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",this.storedData[t].x.v*2))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var i="M0,0 ";return i+=" h"+this.globalData.compSize.w,i+=" v"+this.globalData.compSize.h,i+=" h-"+this.globalData.compSize.w,i+=" v-"+this.globalData.compSize.h+" ",i},MaskElement.prototype.drawPath=function(i,e,t){var n=" M"+e.v[0][0]+","+e.v[0][1],r,s;for(s=e._length,r=1;r<s;r+=1)n+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[r][0]+","+e.i[r][1]+" "+e.v[r][0]+","+e.v[r][1];if(e.c&&s>1&&(n+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),t.lastPath!==n){var a="";t.elem&&(e.c&&(a=i.inv?this.solidPath+n:n),t.elem.setAttribute("d",a)),t.lastPath=n}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=(function(){var i={};i.createFilter=e,i.createAlphaToLuminanceFilter=t;function e(n,r){var s=createNS("filter");return s.setAttribute("id",n),r!==!0&&(s.setAttribute("filterUnits","objectBoundingBox"),s.setAttribute("x","0%"),s.setAttribute("y","0%"),s.setAttribute("width","100%"),s.setAttribute("height","100%")),s}function t(){var n=createNS("feColorMatrix");return n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),n}return i})(),featureSupport=(function(){var i={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(i.maskType=!1),/firefox/i.test(navigator.userAgent)&&(i.svgLumaHidden=!1),i})(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(i){var e,t="SourceGraphic",n=i.data.ef?i.data.ef.length:0,r=createElementID(),s=filtersFactory.createFilter(r,!0),a=0;this.filters=[];var o;for(e=0;e<n;e+=1){o=null;var l=i.data.ef[e].ty;if(registeredEffects$1[l]){var h=registeredEffects$1[l].effect;o=new h(s,i.effectsManager.effectElements[e],i,idPrefix+a,t),t=idPrefix+a,registeredEffects$1[l].countsAsEffect&&(a+=1)}o&&this.filters.push(o)}a&&(i.globalData.defs.appendChild(s),i.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+r+")")),this.filters.length&&i.addRenderableComponent(this)}SVGEffects.prototype.renderFrame=function(i){var e,t=this.filters.length;for(e=0;e<t;e+=1)this.filters[e].renderFrame(i)},SVGEffects.prototype.getEffects=function(i){var e,t=this.filters.length,n=[];for(e=0;e<t;e+=1)this.filters[e].type===i&&n.push(this.filters[e]);return n};function registerEffect$1(i,e,t){registeredEffects$1[i]={effect:e,countsAsEffect:t}}function SVGBaseElement(){}SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.ty===0&&!this.data.hd){var n=createNS("clipPath"),r=createNS("path");r.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var s=createElementID();if(n.setAttribute("id",s),n.appendChild(r),this.globalData.defs.appendChild(n),this.checkMasks()){var a=createNS("g");a.setAttribute("clip-path","url("+getLocationHref()+"#"+s+")"),a.appendChild(this.layerElement),this.transformedElement=a,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+s+")")}this.data.bm!==0&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t=this.layerId+"_"+e,n,r,s,a;if(e===1||e===3){var o=createNS("mask");o.setAttribute("id",t),o.setAttribute("mask-type",e===3?"luminance":"alpha"),s=createNS("use"),s.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),o.appendChild(s),this.globalData.defs.appendChild(o),!featureSupport.maskType&&e===1&&(o.setAttribute("mask-type","luminance"),n=createElementID(),r=filtersFactory.createFilter(n),this.globalData.defs.appendChild(r),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),a=createNS("g"),a.appendChild(s),o.appendChild(a),a.setAttribute("filter","url("+getLocationHref()+"#"+n+")"))}else if(e===2){var l=createNS("mask");l.setAttribute("id",t),l.setAttribute("mask-type","alpha");var h=createNS("g");l.appendChild(h),n=createElementID(),r=filtersFactory.createFilter(n);var u=createNS("feComponentTransfer");u.setAttribute("in","SourceGraphic"),r.appendChild(u);var d=createNS("feFuncA");d.setAttribute("type","table"),d.setAttribute("tableValues","1.0 0.0"),u.appendChild(d),this.globalData.defs.appendChild(r);var f=createNS("rect");f.setAttribute("width",this.comp.data.w),f.setAttribute("height",this.comp.data.h),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("fill","#ffffff"),f.setAttribute("opacity","0"),h.setAttribute("filter","url("+getLocationHref()+"#"+n+")"),h.appendChild(f),s=createNS("use"),s.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),h.appendChild(s),featureSupport.maskType||(l.setAttribute("mask-type","luminance"),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),a=createNS("g"),h.appendChild(f),a.appendChild(this.layerElement),h.appendChild(a)),this.globalData.defs.appendChild(l)}this.matteMasks[e]=t}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}};function HierarchyElement(){}HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){this.data.parent!==void 0&&this.comp.buildElementParenting(this,this.data.parent,[])}};function RenderableDOMElement(){}(function(){var i={initElement:function(t,n,r){this.initFrame(),this.initBaseData(t,n,r),this.initTransform(t,n,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){if(!this.hidden&&(!this.isInRange||this.isTransparent)){var t=this.baseElement||this.layerElement;t.style.display="none",this.hidden=!0}},show:function(){if(this.isInRange&&!this.isTransparent){if(!this.data.hd){var t=this.baseElement||this.layerElement;t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}};extendPrototype([RenderableElement,createProxyFunction(i)],RenderableDOMElement)})();function IImageElement(i,e,t){this.assetData=e.getAssetData(i.refId),this.assetData&&this.assetData.sid&&(this.assetData=e.slotManager.getProp(this.assetData)),this.initElement(i,e,t),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var i=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect};function ProcessedElement(i,e){this.elem=i,this.pos=e}function IShapeElement(){}IShapeElement.prototype={addShapeToModifiers:function(e){var t,n=this.shapeModifiers.length;for(t=0;t<n;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=0,n=this.shapeModifiers.length;t<n;)if(this.shapeModifiers[t].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();t=this.shapeModifiers.length;var n;for(e=t-1;e>=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n<r;){if(t[n].elem===e)return t[n].pos;n+=1}return 0},addProcessedElement:function(e,t){for(var n=this.processedElements,r=n.length;r;)if(r-=1,n[r].elem===e){n[r].pos=t;return}n.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(i,e,t){this.caches=[],this.styles=[],this.transformers=i,this.lStr="",this.sh=t,this.lvl=e,this._isAnimated=!!t.k;for(var n=0,r=i.length;n<r;){if(i[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0};function SVGStyleData(i,e){this.data=i,this.type=i.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=i.hd===!0,this.pElem=createNS("path"),this.msElem=null}SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1};function DashProperty(i,e,t,n){this.elem=i,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=t,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var r,s=e.length||0,a;for(r=0;r<s;r+=1)a=PropertyFactory.getProp(i,e[r].v,0,0,this),this.k=a.k||this.k,this.dataProps[r]={n:e[r].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}DashProperty.prototype.getValue=function(i){if(!(this.elem.globalData.frameId===this.frameId&&!i)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||i,this._mdf)){var e=0,t=this.dataProps.length;for(this.renderer==="svg"&&(this.dashStr=""),e=0;e<t;e+=1)this.dataProps[e].n!=="o"?this.renderer==="svg"?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty);function SVGStrokeStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(i,e.o,0,.01,this),this.w=PropertyFactory.getProp(i,e.w,0,null,this),this.d=new DashProperty(i,e.d||{},"svg",this),this.c=PropertyFactory.getProp(i,e.c,1,255,this),this.style=t,this._isAnimated=!!this._isAnimated}extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData);function SVGFillStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(i,e.o,0,.01,this),this.c=PropertyFactory.getProp(i,e.c,1,255,this),this.style=t}extendPrototype([DynamicPropertyContainer],SVGFillStyleData);function SVGNoStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.style=t}extendPrototype([DynamicPropertyContainer],SVGNoStyleData);function GradientProperty(i,e,t){this.data=e,this.c=createTypedArray("uint8c",e.p*4);var n=e.k.k[0].s?e.k.k[0].s.length-e.p*4:e.k.k.length-e.p*4;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(t),this.prop=PropertyFactory.getProp(i,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}GradientProperty.prototype.comparePoints=function(i,e){for(var t=0,n=this.o.length/2,r;t<n;){if(r=Math.abs(i[t*4]-i[e*4+t*2]),r>.01)return!1;t+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var i=0,e=this.data.k.k.length;i<e;){if(!this.comparePoints(this.data.k.k[i].s,this.data.p))return!1;i+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(i){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||i){var e,t=this.data.p*4,n,r;for(e=0;e<t;e+=1)n=e%4===0?100:255,r=Math.round(this.prop.v[e]*n),this.c[e]!==r&&(this.c[e]=r,this._cmdf=!i);if(this.o.length)for(t=this.prop.v.length,e=this.data.p*4;e<t;e+=1)n=e%2===0?100:1,r=e%2===0?Math.round(this.prop.v[e]*100):this.prop.v[e],this.o[e-this.data.p*4]!==r&&(this.o[e-this.data.p*4]=r,this._omdf=!i);this._mdf=!i}},extendPrototype([DynamicPropertyContainer],GradientProperty);function SVGGradientFillStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.initGradientData(i,e,t)}SVGGradientFillStyleData.prototype.initGradientData=function(i,e,t){this.o=PropertyFactory.getProp(i,e.o,0,.01,this),this.s=PropertyFactory.getProp(i,e.s,1,null,this),this.e=PropertyFactory.getProp(i,e.e,1,null,this),this.h=PropertyFactory.getProp(i,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(i,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(i,e.g,this),this.style=t,this.stops=[],this.setGradientData(t.pElem,e),this.setGradientOpacity(e,t),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(i,e){var t=createElementID(),n=createNS(e.t===1?"linearGradient":"radialGradient");n.setAttribute("id",t),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var r=[],s,a,o;for(o=e.g.p*4,a=0;a<o;a+=4)s=createNS("stop"),n.appendChild(s),r.push(s);i.setAttribute(e.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+t+")"),this.gf=n,this.cst=r},SVGGradientFillStyleData.prototype.setGradientOpacity=function(i,e){if(this.g._hasOpacity&&!this.g._collapsable){var t,n,r,s=createNS("mask"),a=createNS("path");s.appendChild(a);var o=createElementID(),l=createElementID();s.setAttribute("id",l);var h=createNS(i.t===1?"linearGradient":"radialGradient");h.setAttribute("id",o),h.setAttribute("spreadMethod","pad"),h.setAttribute("gradientUnits","userSpaceOnUse"),r=i.g.k.k[0].s?i.g.k.k[0].s.length:i.g.k.k.length;var u=this.stops;for(n=i.g.p*4;n<r;n+=2)t=createNS("stop"),t.setAttribute("stop-color","rgb(255,255,255)"),h.appendChild(t),u.push(t);a.setAttribute(i.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),i.ty==="gs"&&(a.setAttribute("stroke-linecap",lineCapEnum[i.lc||2]),a.setAttribute("stroke-linejoin",lineJoinEnum[i.lj||2]),i.lj===1&&a.setAttribute("stroke-miterlimit",i.ml)),this.of=h,this.ms=s,this.ost=u,this.maskId=l,e.msElem=a}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData);function SVGGradientStrokeStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(i,e.w,0,null,this),this.d=new DashProperty(i,e.d||{},"svg",this),this.initGradientData(i,e,t),this._isAnimated=!!this._isAnimated}extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(i,e,t){this.transform={mProps:i,op:e,container:t},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}var buildShapeString=function(e,t,n,r){if(t===0)return"";var s=e.o,a=e.i,o=e.v,l,h=" M"+r.applyToPointStringified(o[0][0],o[0][1]);for(l=1;l<t;l+=1)h+=" C"+r.applyToPointStringified(s[l-1][0],s[l-1][1])+" "+r.applyToPointStringified(a[l][0],a[l][1])+" "+r.applyToPointStringified(o[l][0],o[l][1]);return n&&t&&(h+=" C"+r.applyToPointStringified(s[l-1][0],s[l-1][1])+" "+r.applyToPointStringified(a[0][0],a[0][1])+" "+r.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},SVGElementsRenderer=(function(){var i=new Matrix,e=new Matrix,t={createRenderFunction:n};function n(d){switch(d.ty){case"fl":return o;case"gf":return h;case"gs":return l;case"st":return u;case"sh":case"el":case"rc":case"sr":return a;case"tr":return r;case"no":return s;default:return null}}function r(d,f,p){(p||f.transform.op._mdf)&&f.transform.container.setAttribute("opacity",f.transform.op.v),(p||f.transform.mProps._mdf)&&f.transform.container.setAttribute("transform",f.transform.mProps.v.to2dCSS())}function s(){}function a(d,f,p){var m,g,y,c,x,v,_=f.styles.length,b=f.lvl,M,A,R,w;for(v=0;v<_;v+=1){if(c=f.sh._mdf||p,f.styles[v].lvl<b){for(A=e.reset(),R=b-f.styles[v].lvl,w=f.transformers.length-1;!c&&R>0;)c=f.transformers[w].mProps._mdf||c,R-=1,w-=1;if(c)for(R=b-f.styles[v].lvl,w=f.transformers.length-1;R>0;)A.multiply(f.transformers[w].mProps.v),R-=1,w-=1}else A=i;if(M=f.sh.paths,g=M._length,c){for(y="",m=0;m<g;m+=1)x=M.shapes[m],x&&x._length&&(y+=buildShapeString(x,x._length,x.c,A));f.caches[v]=y}else y=f.caches[v];f.styles[v].d+=d.hd===!0?"":y,f.styles[v]._mdf=c||f.styles[v]._mdf}}function o(d,f,p){var m=f.style;(f.c._mdf||p)&&m.pElem.setAttribute("fill","rgb("+bmFloor(f.c.v[0])+","+bmFloor(f.c.v[1])+","+bmFloor(f.c.v[2])+")"),(f.o._mdf||p)&&m.pElem.setAttribute("fill-opacity",f.o.v)}function l(d,f,p){h(d,f,p),u(d,f,p)}function h(d,f,p){var m=f.gf,g=f.g._hasOpacity,y=f.s.v,c=f.e.v;if(f.o._mdf||p){var x=d.ty==="gf"?"fill-opacity":"stroke-opacity";f.style.pElem.setAttribute(x,f.o.v)}if(f.s._mdf||p){var v=d.t===1?"x1":"cx",_=v==="x1"?"y1":"cy";m.setAttribute(v,y[0]),m.setAttribute(_,y[1]),g&&!f.g._collapsable&&(f.of.setAttribute(v,y[0]),f.of.setAttribute(_,y[1]))}var b,M,A,R;if(f.g._cmdf||p){b=f.cst;var w=f.g.c;for(A=b.length,M=0;M<A;M+=1)R=b[M],R.setAttribute("offset",w[M*4]+"%"),R.setAttribute("stop-color","rgb("+w[M*4+1]+","+w[M*4+2]+","+w[M*4+3]+")")}if(g&&(f.g._omdf||p)){var P=f.g.o;for(f.g._collapsable?b=f.cst:b=f.ost,A=b.length,M=0;M<A;M+=1)R=b[M],f.g._collapsable||R.setAttribute("offset",P[M*2]+"%"),R.setAttribute("stop-opacity",P[M*2+1])}if(d.t===1)(f.e._mdf||p)&&(m.setAttribute("x2",c[0]),m.setAttribute("y2",c[1]),g&&!f.g._collapsable&&(f.of.setAttribute("x2",c[0]),f.of.setAttribute("y2",c[1])));else{var N;if((f.s._mdf||f.e._mdf||p)&&(N=Math.sqrt(Math.pow(y[0]-c[0],2)+Math.pow(y[1]-c[1],2)),m.setAttribute("r",N),g&&!f.g._collapsable&&f.of.setAttribute("r",N)),f.s._mdf||f.e._mdf||f.h._mdf||f.a._mdf||p){N||(N=Math.sqrt(Math.pow(y[0]-c[0],2)+Math.pow(y[1]-c[1],2)));var V=Math.atan2(c[1]-y[1],c[0]-y[0]),G=f.h.v;G>=1?G=.99:G<=-1&&(G=-.99);var H=N*G,O=Math.cos(V+f.a.v)*H+y[0],C=Math.sin(V+f.a.v)*H+y[1];m.setAttribute("fx",O),m.setAttribute("fy",C),g&&!f.g._collapsable&&(f.of.setAttribute("fx",O),f.of.setAttribute("fy",C))}}}function u(d,f,p){var m=f.style,g=f.d;g&&(g._mdf||p)&&g.dashStr&&(m.pElem.setAttribute("stroke-dasharray",g.dashStr),m.pElem.setAttribute("stroke-dashoffset",g.dashoffset[0])),f.c&&(f.c._mdf||p)&&m.pElem.setAttribute("stroke","rgb("+bmFloor(f.c.v[0])+","+bmFloor(f.c.v[1])+","+bmFloor(f.c.v[2])+")"),(f.o._mdf||p)&&m.pElem.setAttribute("stroke-opacity",f.o.v),(f.w._mdf||p)&&(m.pElem.setAttribute("stroke-width",f.w.v),m.msElem&&m.msElem.setAttribute("stroke-width",f.w.v))}return t})();function SVGShapeElement(i,e,t){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(i,e,t),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var i,e=this.shapes.length,t,n,r=this.stylesList.length,s,a=[],o=!1;for(n=0;n<r;n+=1){for(s=this.stylesList[n],o=!1,a.length=0,i=0;i<e;i+=1)t=this.shapes[i],t.styles.indexOf(s)!==-1&&(a.push(t),o=t._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(i){var e,t=i.length;for(e=0;e<t;e+=1)i[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(i,e){var t,n=new SVGStyleData(i,e),r=n.pElem;if(i.ty==="st")t=new SVGStrokeStyleData(this,i,n);else if(i.ty==="fl")t=new SVGFillStyleData(this,i,n);else if(i.ty==="gf"||i.ty==="gs"){var s=i.ty==="gf"?SVGGradientFillStyleData:SVGGradientStrokeStyleData;t=new s(this,i,n),this.globalData.defs.appendChild(t.gf),t.maskId&&(this.globalData.defs.appendChild(t.ms),this.globalData.defs.appendChild(t.of),r.setAttribute("mask","url("+getLocationHref()+"#"+t.maskId+")"))}else i.ty==="no"&&(t=new SVGNoStyleData(this,i,n));return(i.ty==="st"||i.ty==="gs")&&(r.setAttribute("stroke-linecap",lineCapEnum[i.lc||2]),r.setAttribute("stroke-linejoin",lineJoinEnum[i.lj||2]),r.setAttribute("fill-opacity","0"),i.lj===1&&r.setAttribute("stroke-miterlimit",i.ml)),i.r===2&&r.setAttribute("fill-rule","evenodd"),i.ln&&r.setAttribute("id",i.ln),i.cl&&r.setAttribute("class",i.cl),i.bm&&(r.style["mix-blend-mode"]=getBlendMode(i.bm)),this.stylesList.push(n),this.addToAnimatedContents(i,t),t},SVGShapeElement.prototype.createGroupElement=function(i){var e=new ShapeGroupData;return i.ln&&e.gr.setAttribute("id",i.ln),i.cl&&e.gr.setAttribute("class",i.cl),i.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(i.bm)),e},SVGShapeElement.prototype.createTransformElement=function(i,e){var t=TransformPropertyFactory.getTransformProperty(this,i,this),n=new SVGTransformData(t,t.o,e);return this.addToAnimatedContents(i,n),n},SVGShapeElement.prototype.createShapeElement=function(i,e,t){var n=4;i.ty==="rc"?n=5:i.ty==="el"?n=6:i.ty==="sr"&&(n=7);var r=ShapePropertyFactory.getShapeProp(this,i,n,this),s=new SVGShapeData(e,t,r);return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(i,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(i,e){for(var t=0,n=this.animatedContents.length;t<n;){if(this.animatedContents[t].element===e)return;t+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(i),element:e,data:i})},SVGShapeElement.prototype.setElementStyles=function(i){var e=i.styles,t,n=this.stylesList.length;for(t=0;t<n;t+=1)e.indexOf(this.stylesList[t])===-1&&!this.stylesList[t].closed&&e.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var i,e=this.itemsData.length;for(i=0;i<e;i+=1)this.prevViewData[i]=this.itemsData[i];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,i=0;i<e;i+=1)this.dynamicProperties[i].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(i,e,t,n,r,s,a){var o=[].concat(s),l,h=i.length-1,u,d,f=[],p=[],m,g,y;for(l=h;l>=0;l-=1){if(y=this.searchProcessedElement(i[l]),y?e[l]=t[y-1]:i[l]._render=a,i[l].ty==="fl"||i[l].ty==="st"||i[l].ty==="gf"||i[l].ty==="gs"||i[l].ty==="no")y?e[l].style.closed=i[l].hd:e[l]=this.createStyleElement(i[l],r),i[l]._render&&e[l].style.pElem.parentNode!==n&&n.appendChild(e[l].style.pElem),f.push(e[l].style);else if(i[l].ty==="gr"){if(!y)e[l]=this.createGroupElement(i[l]);else for(d=e[l].it.length,u=0;u<d;u+=1)e[l].prevViewData[u]=e[l].it[u];this.searchShapes(i[l].it,e[l].it,e[l].prevViewData,e[l].gr,r+1,o,a),i[l]._render&&e[l].gr.parentNode!==n&&n.appendChild(e[l].gr)}else i[l].ty==="tr"?(y||(e[l]=this.createTransformElement(i[l],n)),m=e[l].transform,o.push(m)):i[l].ty==="sh"||i[l].ty==="rc"||i[l].ty==="el"||i[l].ty==="sr"?(y||(e[l]=this.createShapeElement(i[l],o,r)),this.setElementStyles(e[l])):i[l].ty==="tm"||i[l].ty==="rd"||i[l].ty==="ms"||i[l].ty==="pb"||i[l].ty==="zz"||i[l].ty==="op"?(y?(g=e[l],g.closed=!1):(g=ShapeModifiers.getModifier(i[l].ty),g.init(this,i[l]),e[l]=g,this.shapeModifiers.push(g)),p.push(g)):i[l].ty==="rp"&&(y?(g=e[l],g.closed=!0):(g=ShapeModifiers.getModifier(i[l].ty),e[l]=g,g.init(this,i,l,e),this.shapeModifiers.push(g),a=!1),p.push(g));this.addProcessedElement(i[l],l+1)}for(h=f.length,l=0;l<h;l+=1)f[l].closed=!0;for(h=p.length,l=0;l<h;l+=1)p[l].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var i,e=this.stylesList.length;for(i=0;i<e;i+=1)this.stylesList[i].reset();for(this.renderShape(),i=0;i<e;i+=1)(this.stylesList[i]._mdf||this._isFirstFrame)&&(this.stylesList[i].msElem&&(this.stylesList[i].msElem.setAttribute("d",this.stylesList[i].d),this.stylesList[i].d="M0 0"+this.stylesList[i].d),this.stylesList[i].pElem.setAttribute("d",this.stylesList[i].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var i,e=this.animatedContents.length,t;for(i=0;i<e;i+=1)t=this.animatedContents[i],(this._isFirstFrame||t.element._isAnimated)&&t.data!==!0&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};function LetterProps(i,e,t,n,r,s){this.o=i,this.sw=e,this.sc=t,this.fc=n,this.m=r,this.p=s,this._mdf={o:!0,sw:!!e,sc:!!t,fc:!!n,m:!0,p:!0}}LetterProps.prototype.update=function(i,e,t,n,r,s){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==i&&(this.o=i,this._mdf.o=!0,a=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,a=!0),this.sc!==t&&(this.sc=t,this._mdf.sc=!0,a=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,a=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,a=!0),s.length&&(this.p[0]!==s[0]||this.p[1]!==s[1]||this.p[4]!==s[4]||this.p[5]!==s[5]||this.p[12]!==s[12]||this.p[13]!==s[13])&&(this.p=s,this._mdf.p=!0,a=!0),a};function TextProperty(i,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=i.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=i,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(i,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i},TextProperty.prototype.setCurrentData=function(i){i.__complete||this.completeTextData(i),this.currentData=i,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(i){this.effectsSequence.push(i),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(i){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!i)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,t=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var n,r=this.effectsSequence.length,s=i||this.data.d.k[this.keysIndex].s;for(n=0;n<r;n+=1)t!==this.keysIndex?s=this.effectsSequence[n](s,s.t):s=this.effectsSequence[n](this.currentData,s.t);e!==s&&this.setCurrentData(s),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}},TextProperty.prototype.getKeyframeValue=function(){for(var i=this.data.d.k,e=this.elem.comp.renderedFrame,t=0,n=i.length;t<=n-1&&!(t===n-1||i[t+1].t>e);)t+=1;return this.keysIndex!==t&&(this.keysIndex=t),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(i){for(var e=[],t=0,n=i.length,r,s,a=!1,o=!1,l="";t<n;)a=o,o=!1,r=i.charCodeAt(t),l=i.charAt(t),FontManager.isCombinedCharacter(r)?a=!0:r>=55296&&r<=56319?FontManager.isRegionalFlag(i,t)?l=i.substr(t,14):(s=i.charCodeAt(t+1),s>=56320&&s<=57343&&(FontManager.isModifier(r,s)?(l=i.substr(t,2),a=!0):FontManager.isFlagEmoji(i.substr(t,4))?l=i.substr(t,4):l=i.substr(t,2))):r>56319?(s=i.charCodeAt(t+1),FontManager.isVariationSelector(r)&&(a=!0)):FontManager.isZeroWidthJoiner(r)&&(a=!0,o=!0),a?(e[e.length-1]+=l,a=!1):e.push(l),t+=l.length;return e},TextProperty.prototype.completeTextData=function(i){i.__complete=!0;var e=this.elem.globalData.fontManager,t=this.data,n=[],r,s,a,o=0,l,h=t.m.g,u=0,d=0,f=0,p=[],m=0,g=0,y,c,x=e.getFontByName(i.f),v,_=0,b=getFontProperties(x);i.fWeight=b.weight,i.fStyle=b.style,i.finalSize=i.s,i.finalText=this.buildFinalText(i.t),s=i.finalText.length,i.finalLineHeight=i.lh;var M=i.tr/1e3*i.finalSize,A;if(i.sz)for(var R=!0,w=i.sz[0],P=i.sz[1],N,V;R;){V=this.buildFinalText(i.t),N=0,m=0,s=V.length,M=i.tr/1e3*i.finalSize;var G=-1;for(r=0;r<s;r+=1)A=V[r].charCodeAt(0),a=!1,V[r]===" "?G=r:(A===13||A===3)&&(m=0,a=!0,N+=i.finalLineHeight||i.finalSize*1.2),e.chars?(v=e.getCharData(V[r],x.fStyle,x.fFamily),_=a?0:v.w*i.finalSize/100):_=e.measureText(V[r],i.f,i.finalSize),m+_>w&&V[r]!==" "?(G===-1?s+=1:r=G,N+=i.finalLineHeight||i.finalSize*1.2,V.splice(r,G===r?1:0,"\r"),G=-1,m=0):(m+=_,m+=M);N+=x.ascent*i.finalSize/100,this.canResize&&i.finalSize>this.minimumFontSize&&P<N?(i.finalSize-=1,i.finalLineHeight=i.finalSize*i.lh/i.s):(i.finalText=V,s=i.finalText.length,R=!1)}m=-M,_=0;var H=0,O;for(r=0;r<s;r+=1)if(a=!1,O=i.finalText[r],A=O.charCodeAt(0),A===13||A===3?(H=0,p.push(m),g=m>g?m:g,m=-2*M,l="",a=!0,f+=1):l=O,e.chars?(v=e.getCharData(O,x.fStyle,e.getFontByName(i.f).fFamily),_=a?0:v.w*i.finalSize/100):_=e.measureText(l,i.f,i.finalSize),O===" "?H+=_+M:(m+=_+M+H,H=0),n.push({l:_,an:_,add:u,n:a,anIndexes:[],val:l,line:f,animatorJustifyOffset:0}),h==2){if(u+=_,l===""||l===" "||r===s-1){for((l===""||l===" ")&&(u-=_);d<=r;)n[d].an=u,n[d].ind=o,n[d].extra=_,d+=1;o+=1,u=0}}else if(h==3){if(u+=_,l===""||r===s-1){for(l===""&&(u-=_);d<=r;)n[d].an=u,n[d].ind=o,n[d].extra=_,d+=1;u=0,o+=1}}else n[o].ind=o,n[o].extra=0,o+=1;if(i.l=n,g=m>g?m:g,p.push(m),i.sz)i.boxWidth=i.sz[0],i.justifyOffset=0;else switch(i.boxWidth=g,i.j){case 1:i.justifyOffset=-i.boxWidth;break;case 2:i.justifyOffset=-i.boxWidth/2;break;default:i.justifyOffset=0}i.lineWidths=p;var C=t.a,L,E;c=C.length;var T,k,B=[];for(y=0;y<c;y+=1){for(L=C[y],L.a.sc&&(i.strokeColorAnim=!0),L.a.sw&&(i.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(i.fillColorAnim=!0),k=0,T=L.s.b,r=0;r<s;r+=1)E=n[r],E.anIndexes[y]=k,(T==1&&E.val!==""||T==2&&E.val!==""&&E.val!==" "||T==3&&(E.n||E.val==" "||r==s-1)||T==4&&(E.n||r==s-1))&&(L.s.rn===1&&B.push(k),k+=1);t.a[y].s.totalChars=k;var ee=-1,oe;if(L.s.rn===1)for(r=0;r<s;r+=1)E=n[r],ee!=E.anIndexes[y]&&(ee=E.anIndexes[y],oe=B.splice(Math.floor(Math.random()*B.length),1)[0]),E.anIndexes[y]=oe}i.yOffset=i.finalLineHeight||i.finalSize*1.2,i.ls=i.ls||0,i.ascent=x.ascent*i.finalSize/100},TextProperty.prototype.updateDocumentData=function(i,e){e=e===void 0?this.keysIndex:e;var t=this.copyData({},this.data.d.k[e].s);t=this.copyData(t,i),this.data.d.k[e].s=t,this.recalculate(e),this.setCurrentData(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(i){var e=this.data.d.k[i].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(i){this.canResize=i,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(i){this.minimumFontSize=Math.floor(i)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=(function(){var i=Math.max,e=Math.min,t=Math.floor;function n(s,a){this._currentTextLength=-1,this.k=!1,this.data=a,this.elem=s,this.comp=s.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(s),this.s=PropertyFactory.getProp(s,a.s||{k:0},0,0,this),"e"in a?this.e=PropertyFactory.getProp(s,a.e,0,0,this):this.e={v:100},this.o=PropertyFactory.getProp(s,a.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(s,a.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(s,a.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(s,a.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(s,a.a,0,.01,this),this.dynamicProperties.length||this.getValue()}n.prototype={getMult:function(a){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var o=0,l=0,h=1,u=1;this.ne.v>0?o=this.ne.v/100:l=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:u=1+this.xe.v/100;var d=BezierFactory.getBezierEasing(o,l,h,u).get,f=0,p=this.finalS,m=this.finalE,g=this.data.sh;if(g===2)m===p?f=a>=m?1:0:f=i(0,e(.5/(m-p)+(a-p)/(m-p),1)),f=d(f);else if(g===3)m===p?f=a>=m?0:1:f=1-i(0,e(.5/(m-p)+(a-p)/(m-p),1)),f=d(f);else if(g===4)m===p?f=0:(f=i(0,e(.5/(m-p)+(a-p)/(m-p),1)),f<.5?f*=2:f=1-2*(f-.5)),f=d(f);else if(g===5){if(m===p)f=0;else{var y=m-p;a=e(i(0,a+.5-p),m-p);var c=-y/2+a,x=y/2;f=Math.sqrt(1-c*c/(x*x))}f=d(f)}else g===6?(m===p?f=0:(a=e(i(0,a+.5-p),m-p),f=(1+Math.cos(Math.PI+Math.PI*2*a/(m-p)))/2),f=d(f)):(a>=t(p)&&(a-p<0?f=i(0,e(e(m,1)-(p-a),1)):f=i(0,e(m-a,1))),f=d(f));if(this.sm.v!==100){var v=this.sm.v*.01;v===0&&(v=1e-8);var _=.5-v*.5;f<_?f=0:(f=(f-_)/v,f>1&&(f=1))}return f*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var o=this.data.r===2?1:100/this.data.totalChars,l=this.o.v/o,h=this.s.v/o+l,u=this.e.v/o+l;if(h>u){var d=h;h=u,u=d}this.finalS=h,this.finalE=u}},extendPrototype([DynamicPropertyContainer],n);function r(s,a,o){return new n(s,a)}return{getTextSelectorProp:r}})();function TextAnimatorDataProperty(i,e,t){var n={propType:!1},r=PropertyFactory.getProp,s=e.a;this.a={r:s.r?r(i,s.r,0,degToRads,t):n,rx:s.rx?r(i,s.rx,0,degToRads,t):n,ry:s.ry?r(i,s.ry,0,degToRads,t):n,sk:s.sk?r(i,s.sk,0,degToRads,t):n,sa:s.sa?r(i,s.sa,0,degToRads,t):n,s:s.s?r(i,s.s,1,.01,t):n,a:s.a?r(i,s.a,1,0,t):n,o:s.o?r(i,s.o,0,.01,t):n,p:s.p?r(i,s.p,1,0,t):n,sw:s.sw?r(i,s.sw,0,0,t):n,sc:s.sc?r(i,s.sc,1,0,t):n,fc:s.fc?r(i,s.fc,1,0,t):n,fh:s.fh?r(i,s.fh,0,0,t):n,fs:s.fs?r(i,s.fs,0,.01,t):n,fb:s.fb?r(i,s.fb,0,.01,t):n,t:s.t?r(i,s.t,0,0,t):n},this.s=TextSelectorProp.getTextSelectorProp(i,e.s,t),this.s.t=e.s.t}function TextAnimatorProperty(i,e,t){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=i,this._renderType=e,this._elem=t,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(t)}TextAnimatorProperty.prototype.searchProperties=function(){var i,e=this._textData.a.length,t,n=PropertyFactory.getProp;for(i=0;i<e;i+=1)t=this._textData.a[i],this._animatorsData[i]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(i,e){if(this.lettersChangedFlag=e,!(!this._mdf&&!this._isFirstFrame&&!e&&(!this._hasMaskedPath||!this._pathData.m._mdf))){this._isFirstFrame=!1;var t=this._moreOptions.alignment.v,n=this._animatorsData,r=this._textData,s=this.mHelper,a=this._renderType,o=this.renderedLetters.length,l,h,u,d,f=i.l,p,m,g,y,c,x,v,_,b,M,A,R,w,P,N;if(this._hasMaskedPath){if(N=this._pathData.m,!this._pathData.n||this._pathData._mdf){var V=N.v;this._pathData.r.v&&(V=V.reverse()),p={tLength:0,segments:[]},d=V._length-1;var G;for(R=0,u=0;u<d;u+=1)G=bez.buildBezierData(V.v[u],V.v[u+1],[V.o[u][0]-V.v[u][0],V.o[u][1]-V.v[u][1]],[V.i[u+1][0]-V.v[u+1][0],V.i[u+1][1]-V.v[u+1][1]]),p.tLength+=G.segmentLength,p.segments.push(G),R+=G.segmentLength;u=d,N.v.c&&(G=bez.buildBezierData(V.v[u],V.v[0],[V.o[u][0]-V.v[u][0],V.o[u][1]-V.v[u][1]],[V.i[0][0]-V.v[0][0],V.i[0][1]-V.v[0][1]]),p.tLength+=G.segmentLength,p.segments.push(G),R+=G.segmentLength),this._pathData.pi=p}if(p=this._pathData.pi,m=this._pathData.f.v,v=0,x=1,y=0,c=!0,M=p.segments,m<0&&N.v.c)for(p.tLength<Math.abs(m)&&(m=-Math.abs(m)%p.tLength),v=M.length-1,b=M[v].points,x=b.length-1;m<0;)m+=b[x].partialLength,x-=1,x<0&&(v-=1,b=M[v].points,x=b.length-1);b=M[v].points,_=b[x-1],g=b[x],A=g.partialLength}d=f.length,l=0,h=0;var H=i.finalSize*1.2*.714,O=!0,C,L,E,T,k;T=n.length;var B,ee=-1,oe,X,Q,ne=m,re=v,me=x,Fe=-1,Ee,Ne,Be,_e,U,qe,Le,Ie,ge="",ke=this.defaultPropsArray,ve;if(i.j===2||i.j===1){var D=0,I=0,q=i.j===2?-.5:-1,J=0,te=!0;for(u=0;u<d;u+=1)if(f[u].n){for(D&&(D+=I);J<u;)f[J].animatorJustifyOffset=D,J+=1;D=0,te=!0}else{for(E=0;E<T;E+=1)C=n[E].a,C.t.propType&&(te&&i.j===2&&(I+=C.t.v*q),L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?D+=C.t.v*B[0]*q:D+=C.t.v*B*q);te=!1}for(D&&(D+=I);J<u;)f[J].animatorJustifyOffset=D,J+=1}for(u=0;u<d;u+=1){if(s.reset(),Ee=1,f[u].n)l=0,h+=i.yOffset,h+=O?1:0,m=ne,O=!1,this._hasMaskedPath&&(v=re,x=me,b=M[v].points,_=b[x-1],g=b[x],A=g.partialLength,y=0),ge="",Ie="",qe="",ve="",ke=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Fe!==f[u].line){switch(i.j){case 1:m+=R-i.lineWidths[f[u].line];break;case 2:m+=(R-i.lineWidths[f[u].line])/2;break}Fe=f[u].line}ee!==f[u].ind&&(f[ee]&&(m+=f[ee].extra),m+=f[u].an/2,ee=f[u].ind),m+=t[0]*f[u].an*.005;var K=0;for(E=0;E<T;E+=1)C=n[E].a,C.p.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?K+=C.p.v[0]*B[0]:K+=C.p.v[0]*B),C.a.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?K+=C.a.v[0]*B[0]:K+=C.a.v[0]*B);for(c=!0,this._pathData.a.v&&(m=f[0].an*.5+(R-this._pathData.f.v-f[0].an*.5-f[f.length-1].an*.5)*ee/(d-1),m+=this._pathData.f.v);c;)y+A>=m+K||!b?(w=(m+K-y)/g.partialLength,X=_.point[0]+(g.point[0]-_.point[0])*w,Q=_.point[1]+(g.point[1]-_.point[1])*w,s.translate(-t[0]*f[u].an*.005,-(t[1]*H)*.01),c=!1):b&&(y+=g.partialLength,x+=1,x>=b.length&&(x=0,v+=1,M[v]?b=M[v].points:N.v.c?(x=0,v=0,b=M[v].points):(y-=g.partialLength,b=null)),b&&(_=g,g=b[x],A=g.partialLength));oe=f[u].an/2-f[u].add,s.translate(-oe,0,0)}else oe=f[u].an/2-f[u].add,s.translate(-oe,0,0),s.translate(-t[0]*f[u].an*.005,-t[1]*H*.01,0);for(E=0;E<T;E+=1)C=n[E].a,C.t.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),(l!==0||i.j!==0)&&(this._hasMaskedPath?B.length?m+=C.t.v*B[0]:m+=C.t.v*B:B.length?l+=C.t.v*B[0]:l+=C.t.v*B));for(i.strokeWidthAnim&&(Be=i.sw||0),i.strokeColorAnim&&(i.sc?Ne=[i.sc[0],i.sc[1],i.sc[2]]:Ne=[0,0,0]),i.fillColorAnim&&i.fc&&(_e=[i.fc[0],i.fc[1],i.fc[2]]),E=0;E<T;E+=1)C=n[E].a,C.a.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?s.translate(-C.a.v[0]*B[0],-C.a.v[1]*B[1],C.a.v[2]*B[2]):s.translate(-C.a.v[0]*B,-C.a.v[1]*B,C.a.v[2]*B));for(E=0;E<T;E+=1)C=n[E].a,C.s.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?s.scale(1+(C.s.v[0]-1)*B[0],1+(C.s.v[1]-1)*B[1],1):s.scale(1+(C.s.v[0]-1)*B,1+(C.s.v[1]-1)*B,1));for(E=0;E<T;E+=1){if(C=n[E].a,L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),C.sk.propType&&(B.length?s.skewFromAxis(-C.sk.v*B[0],C.sa.v*B[1]):s.skewFromAxis(-C.sk.v*B,C.sa.v*B)),C.r.propType&&(B.length?s.rotateZ(-C.r.v*B[2]):s.rotateZ(-C.r.v*B)),C.ry.propType&&(B.length?s.rotateY(C.ry.v*B[1]):s.rotateY(C.ry.v*B)),C.rx.propType&&(B.length?s.rotateX(C.rx.v*B[0]):s.rotateX(C.rx.v*B)),C.o.propType&&(B.length?Ee+=(C.o.v*B[0]-Ee)*B[0]:Ee+=(C.o.v*B-Ee)*B),i.strokeWidthAnim&&C.sw.propType&&(B.length?Be+=C.sw.v*B[0]:Be+=C.sw.v*B),i.strokeColorAnim&&C.sc.propType)for(U=0;U<3;U+=1)B.length?Ne[U]+=(C.sc.v[U]-Ne[U])*B[0]:Ne[U]+=(C.sc.v[U]-Ne[U])*B;if(i.fillColorAnim&&i.fc){if(C.fc.propType)for(U=0;U<3;U+=1)B.length?_e[U]+=(C.fc.v[U]-_e[U])*B[0]:_e[U]+=(C.fc.v[U]-_e[U])*B;C.fh.propType&&(B.length?_e=addHueToRGB(_e,C.fh.v*B[0]):_e=addHueToRGB(_e,C.fh.v*B)),C.fs.propType&&(B.length?_e=addSaturationToRGB(_e,C.fs.v*B[0]):_e=addSaturationToRGB(_e,C.fs.v*B)),C.fb.propType&&(B.length?_e=addBrightnessToRGB(_e,C.fb.v*B[0]):_e=addBrightnessToRGB(_e,C.fb.v*B))}}for(E=0;E<T;E+=1)C=n[E].a,C.p.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),this._hasMaskedPath?B.length?s.translate(0,C.p.v[1]*B[0],-C.p.v[2]*B[1]):s.translate(0,C.p.v[1]*B,-C.p.v[2]*B):B.length?s.translate(C.p.v[0]*B[0],C.p.v[1]*B[1],-C.p.v[2]*B[2]):s.translate(C.p.v[0]*B,C.p.v[1]*B,-C.p.v[2]*B));if(i.strokeWidthAnim&&(qe=Be<0?0:Be),i.strokeColorAnim&&(Le="rgb("+Math.round(Ne[0]*255)+","+Math.round(Ne[1]*255)+","+Math.round(Ne[2]*255)+")"),i.fillColorAnim&&i.fc&&(Ie="rgb("+Math.round(_e[0]*255)+","+Math.round(_e[1]*255)+","+Math.round(_e[2]*255)+")"),this._hasMaskedPath){if(s.translate(0,-i.ls),s.translate(0,t[1]*H*.01+h,0),this._pathData.p.v){P=(g.point[1]-_.point[1])/(g.point[0]-_.point[0]);var de=Math.atan(P)*180/Math.PI;g.point[0]<_.point[0]&&(de+=180),s.rotate(-de*Math.PI/180)}s.translate(X,Q,0),m-=t[0]*f[u].an*.005,f[u+1]&&ee!==f[u+1].ind&&(m+=f[u].an/2,m+=i.tr*.001*i.finalSize)}else{switch(s.translate(l,h,0),i.ps&&s.translate(i.ps[0],i.ps[1]+i.ascent,0),i.j){case 1:s.translate(f[u].animatorJustifyOffset+i.justifyOffset+(i.boxWidth-i.lineWidths[f[u].line]),0,0);break;case 2:s.translate(f[u].animatorJustifyOffset+i.justifyOffset+(i.boxWidth-i.lineWidths[f[u].line])/2,0,0);break}s.translate(0,-i.ls),s.translate(oe,0,0),s.translate(t[0]*f[u].an*.005,t[1]*H*.01,0),l+=f[u].l+i.tr*.001*i.finalSize}a==="html"?ge=s.toCSS():a==="svg"?ge=s.to2dCSS():ke=[s.props[0],s.props[1],s.props[2],s.props[3],s.props[4],s.props[5],s.props[6],s.props[7],s.props[8],s.props[9],s.props[10],s.props[11],s.props[12],s.props[13],s.props[14],s.props[15]],ve=Ee}o<=u?(k=new LetterProps(ve,qe,Le,Ie,ge,ke),this.renderedLetters.push(k),o+=1,this.lettersChangedFlag=!0):(k=this.renderedLetters[u],this.lettersChangedFlag=k.update(ve,qe,Le,Ie,ge,ke)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty);function ITextElement(){}ITextElement.prototype.initElement=function(i,e,t){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(i,e,t),this.textProperty=new TextProperty(this,i.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(i.t,this.renderType,this),this.initTransform(i,e,t),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(i){this._mdf=!1,this.prepareRenderableFrame(i),this.prepareProperties(i,this.isInRange)},ITextElement.prototype.createPathShape=function(i,e){var t,n=e.length,r,s="";for(t=0;t<n;t+=1)e[t].ty==="sh"&&(r=e[t].ks.k,s+=buildShapeString(r,r.i.length,!0,i));return s},ITextElement.prototype.updateDocumentData=function(i,e){this.textProperty.updateDocumentData(i,e)},ITextElement.prototype.canResizeFont=function(i){this.textProperty.canResizeFont(i)},ITextElement.prototype.setMinimumFontSize=function(i){this.textProperty.setMinimumFontSize(i)},ITextElement.prototype.applyTextPropertiesToMatrix=function(i,e,t,n,r){switch(i.ps&&e.translate(i.ps[0],i.ps[1]+i.ascent,0),e.translate(0,-i.ls,0),i.j){case 1:e.translate(i.justifyOffset+(i.boxWidth-i.lineWidths[t]),0,0);break;case 2:e.translate(i.justifyOffset+(i.boxWidth-i.lineWidths[t])/2,0,0);break}e.translate(n,r,0)},ITextElement.prototype.buildColor=function(i){return"rgb("+Math.round(i[0]*255)+","+Math.round(i[1]*255)+","+Math.round(i[2]*255)+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(i,e,t){this.textSpans=[],this.renderType="svg",this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(i){for(var e=0,t=i.length,n=[],r="";e<t;)i[e]==="\r"||i[e]===""?(n.push(r),r=""):r+=i[e],e+=1;return n.push(r),n},SVGTextLottieElement.prototype.buildShapeData=function(i,e){if(i.shapes&&i.shapes.length){var t=i.shapes[0];if(t.it){var n=t.it[t.it.length-1];n.s&&(n.s.k[0]=e,n.s.k[1]=e)}}return i},SVGTextLottieElement.prototype.buildNewText=function(){this.addDynamicProperty(this);var i,e,t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t?t.l.length:0),t.fc?this.layerElement.setAttribute("fill",this.buildColor(t.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),t.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(t.sc)),this.layerElement.setAttribute("stroke-width",t.sw)),this.layerElement.setAttribute("font-size",t.finalSize);var n=this.globalData.fontManager.getFontByName(t.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var r=t.fWeight,s=t.fStyle;this.layerElement.setAttribute("font-style",s),this.layerElement.setAttribute("font-weight",r)}this.layerElement.setAttribute("aria-label",t.t);var a=t.l||[],o=!!this.globalData.fontManager.chars;e=a.length;var l,h=this.mHelper,u="",d=this.data.singleShape,f=0,p=0,m=!0,g=t.tr*.001*t.finalSize;if(d&&!o&&!t.sz){var y=this.textContainer,c="start";switch(t.j){case 1:c="end";break;case 2:c="middle";break;default:c="start";break}y.setAttribute("text-anchor",c),y.setAttribute("letter-spacing",g);var x=this.buildTextContents(t.finalText);for(e=x.length,p=t.ps?t.ps[1]+t.ascent:0,i=0;i<e;i+=1)l=this.textSpans[i].span||createNS("tspan"),l.textContent=x[i],l.setAttribute("x",0),l.setAttribute("y",p),l.style.display="inherit",y.appendChild(l),this.textSpans[i]||(this.textSpans[i]={span:null,glyph:null}),this.textSpans[i].span=l,p+=t.finalLineHeight;this.layerElement.appendChild(y)}else{var v=this.textSpans.length,_;for(i=0;i<e;i+=1){if(this.textSpans[i]||(this.textSpans[i]={span:null,childSpan:null,glyph:null}),!o||!d||i===0){if(l=v>i?this.textSpans[i].span:createNS(o?"g":"text"),v<=i){if(l.setAttribute("stroke-linecap","butt"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("stroke-miterlimit","4"),this.textSpans[i].span=l,o){var b=createNS("g");l.appendChild(b),this.textSpans[i].childSpan=b}this.textSpans[i].span=l,this.layerElement.appendChild(l)}l.style.display="inherit"}if(h.reset(),d&&(a[i].n&&(f=-g,p+=t.yOffset,p+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(t,h,a[i].line,f,p),f+=a[i].l||0,f+=g),o){_=this.globalData.fontManager.getCharData(t.finalText[i],n.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);var M;if(_.t===1)M=new SVGCompElement(_.data,this.globalData,this);else{var A=emptyShapeData;_.data&&_.data.shapes&&(A=this.buildShapeData(_.data,t.finalSize)),M=new SVGShapeElement(A,this.globalData,this)}if(this.textSpans[i].glyph){var R=this.textSpans[i].glyph;this.textSpans[i].childSpan.removeChild(R.layerElement),R.destroy()}this.textSpans[i].glyph=M,M._debug=!0,M.prepareFrame(0),M.renderFrame(),this.textSpans[i].childSpan.appendChild(M.layerElement),_.t===1&&this.textSpans[i].childSpan.setAttribute("transform","scale("+t.finalSize/100+","+t.finalSize/100+")")}else d&&l.setAttribute("transform","translate("+h.props[12]+","+h.props[13]+")"),l.textContent=a[i].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}d&&l&&l.setAttribute("d",u)}for(;i<this.textSpans.length;)this.textSpans[i].span.style.display="none",i+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var i=this.layerElement.getBBox();this.bbox={top:i.y,left:i.x,width:i.width,height:i.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var i,e=this.textSpans.length,t;for(this.renderedFrame=this.comp.renderedFrame,i=0;i<e;i+=1)t=this.textSpans[i].glyph,t&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){this._sizeChanged=!0;var i,e,t=this.textAnimator.renderedLetters,n=this.textProperty.currentData.l;e=n.length;var r,s,a;for(i=0;i<e;i+=1)n[i].n||(r=t[i],s=this.textSpans[i].span,a=this.textSpans[i].glyph,a&&a.renderFrame(),r._mdf.m&&s.setAttribute("transform",r.m),r._mdf.o&&s.setAttribute("opacity",r.o),r._mdf.sw&&s.setAttribute("stroke-width",r.sw),r._mdf.sc&&s.setAttribute("stroke",r.sc),r._mdf.fc&&s.setAttribute("fill",r.fc))}};function ISolidElement(i,e,t){this.initElement(i,e,t)}extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var i=createNS("rect");i.setAttribute("width",this.data.sw),i.setAttribute("height",this.data.sh),i.setAttribute("fill",this.data.sc),this.layerElement.appendChild(i)};function NullElement(i,e,t){this.initFrame(),this.initBaseData(i,e,t),this.initFrame(),this.initTransform(i,e,t),this.initHierarchy()}NullElement.prototype.prepareFrame=function(i){this.prepareProperties(i,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement);function SVGRendererBase(){}extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(i){return new NullElement(i,this.globalData,this)},SVGRendererBase.prototype.createShape=function(i){return new SVGShapeElement(i,this.globalData,this)},SVGRendererBase.prototype.createText=function(i){return new SVGTextLottieElement(i,this.globalData,this)},SVGRendererBase.prototype.createImage=function(i){return new IImageElement(i,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(i){return new ISolidElement(i,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(i){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+i.w+" "+i.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",i.w),this.svgElement.setAttribute("height",i.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),this.renderConfig.focusable!==void 0&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(i,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=i;var t=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",i.w),n.setAttribute("height",i.h),n.setAttribute("x",0),n.setAttribute("y",0);var r=createElementID();t.setAttribute("id",r),t.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+r+")"),e.appendChild(t),this.layers=i.layers,this.elements=createSizedArray(i.layers.length)},SVGRendererBase.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var i,e=this.layers?this.layers.length:0;for(i=0;i<e;i+=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(i){var e=0,t=this.layers.length;for(e=0;e<t;e+=1)if(this.layers[e].ind===i)return e;return-1},SVGRendererBase.prototype.buildItem=function(i){var e=this.elements;if(!(e[i]||this.layers[i].ty===99)){e[i]=!0;var t=this.createItem(this.layers[i]);if(e[i]=t,getExpressionsPlugin()&&(this.layers[i].ty===0&&this.globalData.projectInterface.registerComposition(t),t.initExpressions()),this.appendElementInPos(t,i),this.layers[i].tt){var n="tp"in this.layers[i]?this.findIndexByInd(this.layers[i].tp):i-1;if(n===-1)return;if(!this.elements[n]||this.elements[n]===!0)this.buildItem(n),this.addPendingElement(t);else{var r=e[n],s=r.getMatte(this.layers[i].tt);t.setMatte(s)}}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();if(i.checkParenting(),i.data.tt)for(var e=0,t=this.elements.length;e<t;){if(this.elements[e]===i){var n="tp"in i.data?this.findIndexByInd(i.data.tp):e-1,r=this.elements[n],s=r.getMatte(this.layers[e].tt);i.setMatte(s);break}e+=1}}},SVGRendererBase.prototype.renderFrame=function(i){if(!(this.renderedFrame===i||this.destroyed)){i===null?i=this.renderedFrame:this.renderedFrame=i,this.globalData.frameNum=i,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=i,this.globalData._mdf=!1;var e,t=this.layers.length;for(this.completeLayers||this.checkLayers(i),e=t-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(i-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(i,e){var t=i.getBaseElement();if(t){for(var n=0,r;n<e;)this.elements[n]&&this.elements[n]!==!0&&this.elements[n].getBaseElement()&&(r=this.elements[n].getBaseElement()),n+=1;r?this.layerElement.insertBefore(t,r):this.layerElement.appendChild(t)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"};function ICompElement(){}extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(i,e,t){this.initFrame(),this.initBaseData(i,e,t),this.initTransform(i,e,t),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),(this.data.xt||!e.progressiveLoad)&&this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(i){if(this._mdf=!1,this.prepareRenderableFrame(i),this.prepareProperties(i,this.isInRange),!(!this.isInRange&&!this.data.xt)){if(this.tm._placeholder)this.renderedFrame=i/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var t,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&(this.elements[t].prepareFrame(this.renderedFrame-this.layers[t].st),this.elements[t]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var i,e=this.layers.length;for(i=0;i<e;i+=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame()},ICompElement.prototype.setElements=function(i){this.elements=i},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var i,e=this.layers.length;for(i=0;i<e;i+=1)this.elements[i]&&this.elements[i].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()};function SVGCompElement(i,e,t){this.layers=i.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(i,e,t),this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0}}extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(i){return new SVGCompElement(i,this.globalData,this)};function SVGRenderer(i,e){this.animationItem=i,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var t="";if(e&&e.title){var n=createNS("title"),r=createElementID();n.setAttribute("id",r),n.textContent=e.title,this.svgElement.appendChild(n),t+=r}if(e&&e.description){var s=createNS("desc"),a=createElementID();s.setAttribute("id",a),s.textContent=e.description,this.svgElement.appendChild(s),t+=" "+a}t&&this.svgElement.setAttribute("aria-labelledby",t);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&e.hideOnTransparent===!1),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"},width:e&&e.width,height:e&&e.height,runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(i){return new SVGCompElement(i,this.globalData,this)};function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}ShapeTransformManager.prototype={addTransformSequence:function(e){var t,n=e.length,r="_";for(t=0;t<n;t+=1)r+=e[t].transform.key+"_";var s=this.sequences[r];return s||(s={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[r]=s,this.sequenceList.push(s)),s},processSequence:function(e,t){for(var n=0,r=e.transforms.length,s=t;n<r&&!t;){if(e.transforms[n].transform.mProps._mdf){s=!0;break}n+=1}if(s)for(e.finalTransform.reset(),n=r-1;n>=0;n-=1)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=s},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t<n;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,n=null,r=null;function s(){var l=createNS("svg"),h=createNS("filter"),u=createNS("feColorMatrix");return h.setAttribute("id",e),u.setAttribute("type","matrix"),u.setAttribute("color-interpolation-filters","sRGB"),u.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),h.appendChild(u),l.appendChild(h),l.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(l.style.display="none"),l}function a(){t||(r=s(),document.body.appendChild(r),t=createTag("canvas"),n=t.getContext("2d"),n.filter="url(#"+e+")",n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1))}function o(l){return t||a(),t.width=l.width,t.height=l.height,n.filter="url(#"+e+")",t}return{load:a,get:o}};function createCanvas(i,e){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(i,e);var t=createTag("canvas");return t.width=i,t.height=e,t}var assetLoader=(function(){return{loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas}})(),registeredEffects={};function CVEffects(i){var e,t=i.data.ef?i.data.ef.length:0;this.filters=[];var n;for(e=0;e<t;e+=1){n=null;var r=i.data.ef[e].ty;if(registeredEffects[r]){var s=registeredEffects[r].effect;n=new s(i.effectsManager.effectElements[e],i)}n&&this.filters.push(n)}this.filters.length&&i.addRenderableComponent(this)}CVEffects.prototype.renderFrame=function(i){var e,t=this.filters.length;for(e=0;e<t;e+=1)this.filters[e].renderFrame(i)},CVEffects.prototype.getEffects=function(i){var e,t=this.filters.length,n=[];for(e=0;e<t;e+=1)this.filters[e].type===i&&n.push(this.filters[e]);return n};function registerEffect(i,e){registeredEffects[i]={effect:e}}function CVMaskElement(i,e){this.data=i,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var t,n=this.masksProperties.length,r=!1;for(t=0;t<n;t+=1)this.masksProperties[t].mode!=="n"&&(r=!0),this.viewData[t]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[t],3);this.hasMasks=r,r&&this.element.addRenderableComponent(this)}CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var i=this.element.finalTransform.mat,e=this.element.canvasContext,t,n=this.masksProperties.length,r,s,a;for(e.beginPath(),t=0;t<n;t+=1)if(this.masksProperties[t].mode!=="n"){this.masksProperties[t].inv&&(e.moveTo(0,0),e.lineTo(this.element.globalData.compSize.w,0),e.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),e.lineTo(0,this.element.globalData.compSize.h),e.lineTo(0,0)),a=this.viewData[t].v,r=i.applyToPointArray(a.v[0][0],a.v[0][1],0),e.moveTo(r[0],r[1]);var o,l=a._length;for(o=1;o<l;o+=1)s=i.applyToTriplePoints(a.o[o-1],a.i[o],a.v[o]),e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);s=i.applyToTriplePoints(a.o[o-1],a.i[0],a.v[0]),e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}this.element.globalData.renderer.save(!0),e.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};function CVBaseElement(){}var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0],t=e.getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var n=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(n.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas),s=r.getContext("2d");s.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(i,e,t,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;e.ty==="rc"?r=5:e.ty==="el"?r=6:e.ty==="sr"&&(r=7),this.sh=ShapePropertyFactory.getShapeProp(i,e,r,i);var s,a=t.length,o;for(s=0;s<a;s+=1)t[s].closed||(o={transforms:n.addTransformSequence(t[s].transforms),trNodes:[]},this.styledShapes.push(o),t[s].elements.push(o))}CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated;function CVShapeElement(i,e,t){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(i,e){var t={data:i,type:i.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:i.hd===!0},n={};if(i.ty==="fl"||i.ty==="st"?(n.c=PropertyFactory.getProp(this,i.c,1,255,this),n.c.k||(t.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):(i.ty==="gf"||i.ty==="gs")&&(n.s=PropertyFactory.getProp(this,i.s,1,null,this),n.e=PropertyFactory.getProp(this,i.e,1,null,this),n.h=PropertyFactory.getProp(this,i.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,i.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,i.g,this)),n.o=PropertyFactory.getProp(this,i.o,0,.01,this),i.ty==="st"||i.ty==="gs"){if(t.lc=lineCapEnum[i.lc||2],t.lj=lineJoinEnum[i.lj||2],i.lj==1&&(t.ml=i.ml),n.w=PropertyFactory.getProp(this,i.w,0,null,this),n.w.k||(t.wi=n.w.v),i.d){var r=new DashProperty(this,i.d,"canvas",this);n.d=r,n.d.k||(t.da=n.d.dashArray,t.do=n.d.dashoffset[0])}}else t.r=i.r===2?"evenodd":"nonzero";return this.stylesList.push(t),n.style=t,n},CVShapeElement.prototype.createGroupElement=function(){var i={it:[],prevViewData:[]};return i},CVShapeElement.prototype.createTransformElement=function(i){var e={transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,i.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,i,this)}};return e},CVShapeElement.prototype.createShapeElement=function(i){var e=new CVShapeData(this,i,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var i,e=this.itemsData.length;for(i=0;i<e;i+=1)this.prevViewData[i]=this.itemsData[i];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,i=0;i<e;i+=1)this.dynamicProperties[i].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(i){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(i)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var i,e=this.stylesList.length;for(i=0;i<e;i+=1)this.stylesList[i].closed||this.stylesList[i].transforms.pop()},CVShapeElement.prototype.closeStyles=function(i){var e,t=i.length;for(e=0;e<t;e+=1)i[e].closed=!0},CVShapeElement.prototype.searchShapes=function(i,e,t,n,r){var s,a=i.length-1,o,l,h=[],u=[],d,f,p,m=[].concat(r);for(s=a;s>=0;s-=1){if(d=this.searchProcessedElement(i[s]),d?e[s]=t[d-1]:i[s]._shouldRender=n,i[s].ty==="fl"||i[s].ty==="st"||i[s].ty==="gf"||i[s].ty==="gs")d?e[s].style.closed=!1:e[s]=this.createStyleElement(i[s],m),h.push(e[s].style);else if(i[s].ty==="gr"){if(!d)e[s]=this.createGroupElement(i[s]);else for(l=e[s].it.length,o=0;o<l;o+=1)e[s].prevViewData[o]=e[s].it[o];this.searchShapes(i[s].it,e[s].it,e[s].prevViewData,n,m)}else i[s].ty==="tr"?(d||(p=this.createTransformElement(i[s]),e[s]=p),m.push(e[s]),this.addTransformToStyleList(e[s])):i[s].ty==="sh"||i[s].ty==="rc"||i[s].ty==="el"||i[s].ty==="sr"?d||(e[s]=this.createShapeElement(i[s])):i[s].ty==="tm"||i[s].ty==="rd"||i[s].ty==="pb"||i[s].ty==="zz"||i[s].ty==="op"?(d?(f=e[s],f.closed=!1):(f=ShapeModifiers.getModifier(i[s].ty),f.init(this,i[s]),e[s]=f,this.shapeModifiers.push(f)),u.push(f)):i[s].ty==="rp"&&(d?(f=e[s],f.closed=!0):(f=ShapeModifiers.getModifier(i[s].ty),e[s]=f,f.init(this,i,s,e),this.shapeModifiers.push(f),n=!1),u.push(f));this.addProcessedElement(i[s],s+1)}for(this.removeTransformFromStyleList(),this.closeStyles(h),a=u.length,s=0;s<a;s+=1)u[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(i,e){(i._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=i.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var i,e=this.stylesList.length,t,n,r,s,a,o,l=this.globalData.renderer,h=this.globalData.canvasContext,u,d;for(i=0;i<e;i+=1)if(d=this.stylesList[i],u=d.type,!((u==="st"||u==="gs")&&d.wi===0||!d.data._shouldRender||d.coOp===0||this.globalData.currentGlobalAlpha===0)){for(l.save(),a=d.elements,u==="st"||u==="gs"?(l.ctxStrokeStyle(u==="st"?d.co:d.grd),l.ctxLineWidth(d.wi),l.ctxLineCap(d.lc),l.ctxLineJoin(d.lj),l.ctxMiterLimit(d.ml||0)):l.ctxFillStyle(u==="fl"?d.co:d.grd),l.ctxOpacity(d.coOp),u!=="st"&&u!=="gs"&&h.beginPath(),l.ctxTransform(d.preTransforms.finalTransform.props),n=a.length,t=0;t<n;t+=1){for((u==="st"||u==="gs")&&(h.beginPath(),d.da&&(h.setLineDash(d.da),h.lineDashOffset=d.do)),o=a[t].trNodes,s=o.length,r=0;r<s;r+=1)o[r].t==="m"?h.moveTo(o[r].p[0],o[r].p[1]):o[r].t==="c"?h.bezierCurveTo(o[r].pts[0],o[r].pts[1],o[r].pts[2],o[r].pts[3],o[r].pts[4],o[r].pts[5]):h.closePath();(u==="st"||u==="gs")&&(l.ctxStroke(),d.da&&h.setLineDash(this.dashResetter))}u!=="st"&&u!=="gs"&&this.globalData.renderer.ctxFill(d.r),l.restore()}},CVShapeElement.prototype.renderShape=function(i,e,t,n){var r,s=e.length-1,a;for(a=i,r=s;r>=0;r-=1)e[r].ty==="tr"?(a=t[r].transform,this.renderShapeTransform(i,a)):e[r].ty==="sh"||e[r].ty==="el"||e[r].ty==="rc"||e[r].ty==="sr"?this.renderPath(e[r],t[r]):e[r].ty==="fl"?this.renderFill(e[r],t[r],a):e[r].ty==="st"?this.renderStroke(e[r],t[r],a):e[r].ty==="gf"||e[r].ty==="gs"?this.renderGradientFill(e[r],t[r],a):e[r].ty==="gr"?this.renderShape(a,e[r].it,t[r].it):e[r].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(i,e){if(this._isFirstFrame||e._mdf||i.transforms._mdf){var t=i.trNodes,n=e.paths,r,s,a,o=n._length;t.length=0;var l=i.transforms.finalTransform;for(a=0;a<o;a+=1){var h=n.shapes[a];if(h&&h.v){for(s=h._length,r=1;r<s;r+=1)r===1&&t.push({t:"m",p:l.applyToPointArray(h.v[0][0],h.v[0][1],0)}),t.push({t:"c",pts:l.applyToTriplePoints(h.o[r-1],h.i[r],h.v[r])});s===1&&t.push({t:"m",p:l.applyToPointArray(h.v[0][0],h.v[0][1],0)}),h.c&&s&&(t.push({t:"c",pts:l.applyToTriplePoints(h.o[r-1],h.i[0],h.v[0])}),t.push({t:"z"}))}}i.trNodes=t}},CVShapeElement.prototype.renderPath=function(i,e){if(i.hd!==!0&&i._shouldRender){var t,n=e.styledShapes.length;for(t=0;t<n;t+=1)this.renderStyledShape(e.styledShapes[t],e.sh)}},CVShapeElement.prototype.renderFill=function(i,e,t){var n=e.style;(e.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||t._opMdf||this._isFirstFrame)&&(n.coOp=e.o.v*t.opacity)},CVShapeElement.prototype.renderGradientFill=function(i,e,t){var n=e.style,r;if(!n.grd||e.g._mdf||e.s._mdf||e.e._mdf||i.t!==1&&(e.h._mdf||e.a._mdf)){var s=this.globalData.canvasContext,a=e.s.v,o=e.e.v;if(i.t===1)r=s.createLinearGradient(a[0],a[1],o[0],o[1]);else{var l=Math.sqrt(Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)),h=Math.atan2(o[1]-a[1],o[0]-a[0]),u=e.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var d=l*u,f=Math.cos(h+e.a.v)*d+a[0],p=Math.sin(h+e.a.v)*d+a[1];r=s.createRadialGradient(f,p,0,a[0],a[1],l)}var m,g=i.g.p,y=e.g.c,c=1;for(m=0;m<g;m+=1)e.g._hasOpacity&&e.g._collapsable&&(c=e.g.o[m*2+1]),r.addColorStop(y[m*4]/100,"rgba("+y[m*4+1]+","+y[m*4+2]+","+y[m*4+3]+","+c+")");n.grd=r}n.coOp=e.o.v*t.opacity},CVShapeElement.prototype.renderStroke=function(i,e,t){var n=e.style,r=e.d;r&&(r._mdf||this._isFirstFrame)&&(n.da=r.dashArray,n.do=r.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||t._opMdf||this._isFirstFrame)&&(n.coOp=e.o.v*t.opacity),(e.w._mdf||this._isFirstFrame)&&(n.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0};function CVTextElement(i,e,t){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i.l?i.l.length:0);var e=!1;i.fc?(e=!0,this.values.fill=this.buildColor(i.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var t=!1;i.sc&&(t=!0,this.values.stroke=this.buildColor(i.sc),this.values.sWidth=i.sw);var n=this.globalData.fontManager.getFontByName(i.f),r,s,a=i.l,o=this.mHelper;this.stroke=t,this.values.fValue=i.finalSize+"px "+this.globalData.fontManager.getFontByName(i.f).fFamily,s=i.finalText.length;var l,h,u,d,f,p,m,g,y,c,x=this.data.singleShape,v=i.tr*.001*i.finalSize,_=0,b=0,M=!0,A=0;for(r=0;r<s;r+=1){l=this.globalData.fontManager.getCharData(i.finalText[r],n.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily),h=l&&l.data||{},o.reset(),x&&a[r].n&&(_=-v,b+=i.yOffset,b+=M?1:0,M=!1),f=h.shapes?h.shapes[0].it:[],m=f.length,o.scale(i.finalSize/100,i.finalSize/100),x&&this.applyTextPropertiesToMatrix(i,o,a[r].line,_,b),y=createSizedArray(m-1);var R=0;for(p=0;p<m;p+=1)if(f[p].ty==="sh"){for(d=f[p].ks.k.i.length,g=f[p].ks.k,c=[],u=1;u<d;u+=1)u===1&&c.push(o.applyToX(g.v[0][0],g.v[0][1],0),o.applyToY(g.v[0][0],g.v[0][1],0)),c.push(o.applyToX(g.o[u-1][0],g.o[u-1][1],0),o.applyToY(g.o[u-1][0],g.o[u-1][1],0),o.applyToX(g.i[u][0],g.i[u][1],0),o.applyToY(g.i[u][0],g.i[u][1],0),o.applyToX(g.v[u][0],g.v[u][1],0),o.applyToY(g.v[u][0],g.v[u][1],0));c.push(o.applyToX(g.o[u-1][0],g.o[u-1][1],0),o.applyToY(g.o[u-1][0],g.o[u-1][1],0),o.applyToX(g.i[0][0],g.i[0][1],0),o.applyToY(g.i[0][0],g.i[0][1],0),o.applyToX(g.v[0][0],g.v[0][1],0),o.applyToY(g.v[0][0],g.v[0][1],0)),y[R]=c,R+=1}x&&(_+=a[r].l,_+=v),this.textSpans[A]?this.textSpans[A].elem=y:this.textSpans[A]={elem:y},A+=1}},CVTextElement.prototype.renderInnerContent=function(){this.validateText();var i=this.canvasContext;i.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var e,t,n,r,s,a,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;t=l.length;var h,u=null,d=null,f=null,p,m,g=this.globalData.renderer;for(e=0;e<t;e+=1)if(!l[e].n){if(h=o[e],h&&(g.save(),g.ctxTransform(h.p),g.ctxOpacity(h.o)),this.fill){for(h&&h.fc?u!==h.fc&&(g.ctxFillStyle(h.fc),u=h.fc):u!==this.values.fill&&(u=this.values.fill,g.ctxFillStyle(this.values.fill)),p=this.textSpans[e].elem,r=p.length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(m=p[n],a=m.length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),g.ctxFill()}if(this.stroke){for(h&&h.sw?f!==h.sw&&(f=h.sw,g.ctxLineWidth(h.sw)):f!==this.values.sWidth&&(f=this.values.sWidth,g.ctxLineWidth(this.values.sWidth)),h&&h.sc?d!==h.sc&&(d=h.sc,g.ctxStrokeStyle(h.sc)):d!==this.values.stroke&&(d=this.values.stroke,g.ctxStrokeStyle(this.values.stroke)),p=this.textSpans[e].elem,r=p.length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(m=p[n],a=m.length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),g.ctxStroke()}h&&this.globalData.renderer.restore()}};function CVImageElement(i,e,t){this.assetData=e.getAssetData(i.refId),this.img=e.imageLoader.getAsset(this.assetData),this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var i=createTag("canvas");i.width=this.assetData.w,i.height=this.assetData.h;var e=i.getContext("2d"),t=this.img.width,n=this.img.height,r=t/n,s=this.assetData.w/this.assetData.h,a,o,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;r>s&&l==="xMidYMid slice"||r<s&&l!=="xMidYMid slice"?(o=n,a=o*s):(a=t,o=a/s),e.drawImage(this.img,(t-a)/2,(n-o)/2,a,o,0,0,this.assetData.w,this.assetData.h),this.img=i}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null};function CVSolidElement(i,e,t){this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)};function CanvasRendererBase(){}extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(i){return new CVShapeElement(i,this.globalData,this)},CanvasRendererBase.prototype.createText=function(i){return new CVTextElement(i,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(i){return new CVImageElement(i,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(i){return new CVSolidElement(i,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(i){i[0]===1&&i[1]===0&&i[4]===0&&i[5]===1&&i[12]===0&&i[13]===0||this.canvasContext.transform(i[0],i[1],i[4],i[5],i[12],i[13])},CanvasRendererBase.prototype.ctxOpacity=function(i){this.canvasContext.globalAlpha*=i<0?0:i},CanvasRendererBase.prototype.ctxFillStyle=function(i){this.canvasContext.fillStyle=i},CanvasRendererBase.prototype.ctxStrokeStyle=function(i){this.canvasContext.strokeStyle=i},CanvasRendererBase.prototype.ctxLineWidth=function(i){this.canvasContext.lineWidth=i},CanvasRendererBase.prototype.ctxLineCap=function(i){this.canvasContext.lineCap=i},CanvasRendererBase.prototype.ctxLineJoin=function(i){this.canvasContext.lineJoin=i},CanvasRendererBase.prototype.ctxMiterLimit=function(i){this.canvasContext.miterLimit=i},CanvasRendererBase.prototype.ctxFill=function(i){this.canvasContext.fill(i)},CanvasRendererBase.prototype.ctxFillRect=function(i,e,t,n){this.canvasContext.fillRect(i,e,t,n)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){if(!this.renderConfig.clearCanvas){this.canvasContext.restore();return}this.contextData.reset()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(i){if(!this.renderConfig.clearCanvas){this.canvasContext.restore();return}i&&(this.globalData.blendMode="source-over"),this.contextData.restore(i)},CanvasRendererBase.prototype.configAnimation=function(i){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var t="0px 0px 0px";e.transformOrigin=t,e.mozTransformOrigin=t,e.webkitTransformOrigin=t,e["-webkit-transform"]=t,e.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=i,this.layers=i.layers,this.transformCanvas={w:i.w,h:i.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(i,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(i.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(i,e){this.reset();var t,n;i?(t=i,n=e,this.canvasContext.canvas.width=t,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(t=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=t*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr);var r,s;if(this.renderConfig.preserveAspectRatio.indexOf("meet")!==-1||this.renderConfig.preserveAspectRatio.indexOf("slice")!==-1){var a=this.renderConfig.preserveAspectRatio.split(" "),o=a[1]||"meet",l=a[0]||"xMidYMid",h=l.substr(0,4),u=l.substr(4);r=t/n,s=this.transformCanvas.w/this.transformCanvas.h,s>r&&o==="meet"||s<r&&o==="slice"?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),h==="xMid"&&(s<r&&o==="meet"||s>r&&o==="slice")?this.transformCanvas.tx=(t-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:h==="xMax"&&(s<r&&o==="meet"||s>r&&o==="slice")?this.transformCanvas.tx=(t-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u==="YMid"&&(s>r&&o==="meet"||s<r&&o==="slice")?this.transformCanvas.ty=(n-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:u==="YMax"&&(s>r&&o==="meet"||s<r&&o==="slice")?this.transformCanvas.ty=(n-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:this.transformCanvas.ty=0}else this.renderConfig.preserveAspectRatio==="none"?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText="");var i,e=this.layers?this.layers.length:0;for(i=e-1;i>=0;i-=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(i,e){if(!(this.renderedFrame===i&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||i===-1)){this.renderedFrame=i,this.globalData.frameNum=i-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=i;var t,n=this.layers.length;for(this.completeLayers||this.checkLayers(i),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(i-this.layers[t].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(i){var e=this.elements;if(!(e[i]||this.layers[i].ty===99)){var t=this.createItem(this.layers[i],this,this.globalData);e[i]=t,t.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();i.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var i,e=15;for(i=0;i<e;i+=1){var t=new CanvasContext;this.stack[i]=t}this._length=e,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}CVContextData.prototype.duplicate=function(){var i=this._length*2,e=0;for(e=this._length;e<i;e+=1)this.stack[e]=new CanvasContext;this._length=i},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(i){this.cArrPos-=1;var e=this.stack[this.cArrPos],t=e.transform,n,r=this.cTr.props;for(n=0;n<16;n+=1)r[n]=t[n];if(i){this.nativeContext.restore();var s=this.stack[this.cArrPos+1];this.appliedFillStyle=s.fillStyle,this.appliedStrokeStyle=s.strokeStyle,this.appliedLineWidth=s.lineWidth,this.appliedLineCap=s.lineCap,this.appliedLineJoin=s.lineJoin,this.appliedMiterLimit=s.miterLimit}this.nativeContext.setTransform(t[0],t[1],t[4],t[5],t[12],t[13]),(i||e.opacity!==-1&&this.currentOpacity!==e.opacity)&&(this.nativeContext.globalAlpha=e.opacity,this.currentOpacity=e.opacity),this.currentFillStyle=e.fillStyle,this.currentStrokeStyle=e.strokeStyle,this.currentLineWidth=e.lineWidth,this.currentLineCap=e.lineCap,this.currentLineJoin=e.lineJoin,this.currentMiterLimit=e.miterLimit},CVContextData.prototype.save=function(i){i&&this.nativeContext.save();var e=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var t=this.stack[this.cArrPos],n;for(n=0;n<16;n+=1)t.transform[n]=e[n];this.cArrPos+=1;var r=this.stack[this.cArrPos];r.opacity=t.opacity,r.fillStyle=t.fillStyle,r.strokeStyle=t.strokeStyle,r.lineWidth=t.lineWidth,r.lineCap=t.lineCap,r.lineJoin=t.lineJoin,r.miterLimit=t.miterLimit},CVContextData.prototype.setOpacity=function(i){this.stack[this.cArrPos].opacity=i},CVContextData.prototype.setContext=function(i){this.nativeContext=i},CVContextData.prototype.fillStyle=function(i){this.stack[this.cArrPos].fillStyle!==i&&(this.currentFillStyle=i,this.stack[this.cArrPos].fillStyle=i)},CVContextData.prototype.strokeStyle=function(i){this.stack[this.cArrPos].strokeStyle!==i&&(this.currentStrokeStyle=i,this.stack[this.cArrPos].strokeStyle=i)},CVContextData.prototype.lineWidth=function(i){this.stack[this.cArrPos].lineWidth!==i&&(this.currentLineWidth=i,this.stack[this.cArrPos].lineWidth=i)},CVContextData.prototype.lineCap=function(i){this.stack[this.cArrPos].lineCap!==i&&(this.currentLineCap=i,this.stack[this.cArrPos].lineCap=i)},CVContextData.prototype.lineJoin=function(i){this.stack[this.cArrPos].lineJoin!==i&&(this.currentLineJoin=i,this.stack[this.cArrPos].lineJoin=i)},CVContextData.prototype.miterLimit=function(i){this.stack[this.cArrPos].miterLimit!==i&&(this.currentMiterLimit=i,this.stack[this.cArrPos].miterLimit=i)},CVContextData.prototype.transform=function(i){this.transformMat.cloneFromProps(i);var e=this.cTr;this.transformMat.multiply(e),e.cloneFromProps(this.transformMat.props);var t=e.props;this.nativeContext.setTransform(t[0],t[1],t[4],t[5],t[12],t[13])},CVContextData.prototype.opacity=function(i){var e=this.stack[this.cArrPos].opacity;e*=i<0?0:i,this.stack[this.cArrPos].opacity!==e&&(this.currentOpacity!==i&&(this.nativeContext.globalAlpha=i,this.currentOpacity=i),this.stack[this.cArrPos].opacity=e)},CVContextData.prototype.fill=function(i){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(i)},CVContextData.prototype.fillRect=function(i,e,t,n){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(i,e,t,n)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()};function CVCompElement(i,e,t){this.completeLayers=!1,this.layers=i.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(i,e,t),this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0}}extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var i=this.canvasContext;i.beginPath(),i.moveTo(0,0),i.lineTo(this.data.w,0),i.lineTo(this.data.w,this.data.h),i.lineTo(0,this.data.h),i.lineTo(0,0),i.clip();var e,t=this.layers.length;for(e=t-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var i,e=this.layers.length;for(i=e-1;i>=0;i-=1)this.elements[i]&&this.elements[i].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(i){return new CVCompElement(i,this.globalData,this)};function CanvasRenderer(i,e){this.animationItem=i,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(i){return new CVCompElement(i,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(i,e,t){this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var i;this.data.hasMask?(i=createNS("rect"),i.setAttribute("width",this.data.sw),i.setAttribute("height",this.data.sh),i.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(i=createTag("div"),i.style.width=this.data.sw+"px",i.style.height=this.data.sh+"px",i.style.backgroundColor=this.data.sc),this.layerElement.appendChild(i)};function HShapeElement(i,e,t){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(i,e,t),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var i;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),i=this.svgElement;else{i=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;i.setAttribute("width",e.w),i.setAttribute("height",e.h),i.appendChild(this.shapesContainer),this.layerElement.appendChild(i)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=i},HShapeElement.prototype.getTransformedPoint=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)e=i[t].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(i,e){var t=i.sh.v,n=i.transformers,r,s=t._length,a,o,l,h;if(!(s<=1)){for(r=0;r<s-1;r+=1)a=this.getTransformedPoint(n,t.v[r]),o=this.getTransformedPoint(n,t.o[r]),l=this.getTransformedPoint(n,t.i[r+1]),h=this.getTransformedPoint(n,t.v[r+1]),this.checkBounds(a,o,l,h,e);t.c&&(a=this.getTransformedPoint(n,t.v[r]),o=this.getTransformedPoint(n,t.o[r]),l=this.getTransformedPoint(n,t.i[0]),h=this.getTransformedPoint(n,t.v[0]),this.checkBounds(a,o,l,h,e))}},HShapeElement.prototype.checkBounds=function(i,e,t,n,r){this.getBoundsOfCurve(i,e,t,n);var s=this.shapeBoundingBox;r.x=bmMin(s.left,r.x),r.xMax=bmMax(s.right,r.xMax),r.y=bmMin(s.top,r.y),r.yMax=bmMax(s.bottom,r.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(i,e,t,n){for(var r=[[i[0],n[0]],[i[1],n[1]]],s,a,o,l,h,u,d,f=0;f<2;++f)a=6*i[f]-12*e[f]+6*t[f],s=-3*i[f]+9*e[f]-9*t[f]+3*n[f],o=3*e[f]-3*i[f],a|=0,s|=0,o|=0,s===0&&a===0||(s===0?(l=-o/a,l>0&&l<1&&r[f].push(this.calculateF(l,i,e,t,n,f))):(h=a*a-4*o*s,h>=0&&(u=(-a+bmSqrt(h))/(2*s),u>0&&u<1&&r[f].push(this.calculateF(u,i,e,t,n,f)),d=(-a-bmSqrt(h))/(2*s),d>0&&d<1&&r[f].push(this.calculateF(d,i,e,t,n,f)))));this.shapeBoundingBox.left=bmMin.apply(null,r[0]),this.shapeBoundingBox.top=bmMin.apply(null,r[1]),this.shapeBoundingBox.right=bmMax.apply(null,r[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,r[1])},HShapeElement.prototype.calculateF=function(i,e,t,n,r,s){return bmPow(1-i,3)*e[s]+3*bmPow(1-i,2)*i*t[s]+3*(1-i)*bmPow(i,2)*n[s]+bmPow(i,3)*r[s]},HShapeElement.prototype.calculateBoundingBox=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)i[t]&&i[t].sh?this.calculateShapeBoundingBox(i[t],e):i[t]&&i[t].it?this.calculateBoundingBox(i[t].it,e):i[t]&&i[t].style&&i[t].w&&this.expandStrokeBoundingBox(i[t].w,e)},HShapeElement.prototype.expandStrokeBoundingBox=function(i,e){var t=0;if(i.keyframes){for(var n=0;n<i.keyframes.length;n+=1){var r=i.keyframes[n].s;r>t&&(t=r)}t*=i.mult}else t=i.v*i.mult;e.x-=t,e.xMax+=t,e.y-=t,e.yMax+=t},HShapeElement.prototype.currentBoxContains=function(i){return this.currentBBox.x<=i.x&&this.currentBBox.y<=i.y&&this.currentBBox.width+this.currentBBox.x>=i.x+i.width&&this.currentBBox.height+this.currentBBox.y>=i.y+i.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var i=this.tempBoundingBox,e=999999;if(i.x=e,i.xMax=-e,i.y=e,i.yMax=-e,this.calculateBoundingBox(this.itemsData,i),i.width=i.xMax<i.x?0:i.xMax-i.x,i.height=i.yMax<i.y?0:i.yMax-i.y,this.currentBoxContains(i))return;var t=!1;if(this.currentBBox.w!==i.width&&(this.currentBBox.w=i.width,this.shapeCont.setAttribute("width",i.width),t=!0),this.currentBBox.h!==i.height&&(this.currentBBox.h=i.height,this.shapeCont.setAttribute("height",i.height),t=!0),t||this.currentBBox.x!==i.x||this.currentBBox.y!==i.y){this.currentBBox.w=i.width,this.currentBBox.h=i.height,this.currentBBox.x=i.x,this.currentBBox.y=i.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,r="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=r,n.webkitTransform=r}}};function HTextElement(i,e,t){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var i=createNS("g");this.maskedElement.appendChild(i),this.innerElem=i}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i.l?i.l.length:0);var e=this.innerElem.style,t=i.fc?this.buildColor(i.fc):"rgba(0,0,0,0)";e.fill=t,e.color=t,i.sc&&(e.stroke=this.buildColor(i.sc),e.strokeWidth=i.sw+"px");var n=this.globalData.fontManager.getFontByName(i.f);if(!this.globalData.fontManager.chars)if(e.fontSize=i.finalSize+"px",e.lineHeight=i.finalSize+"px",n.fClass)this.innerElem.className=n.fClass;else{e.fontFamily=n.fFamily;var r=i.fWeight,s=i.fStyle;e.fontStyle=s,e.fontWeight=r}var a,o,l=i.l;o=l.length;var h,u,d,f=this.mHelper,p,m="",g=0;for(a=0;a<o;a+=1){if(this.globalData.fontManager.chars?(this.textPaths[g]?h=this.textPaths[g]:(h=createNS("path"),h.setAttribute("stroke-linecap",lineCapEnum[1]),h.setAttribute("stroke-linejoin",lineJoinEnum[2]),h.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[g]?(u=this.textSpans[g],d=u.children[0]):(u=createTag("div"),u.style.lineHeight=0,d=createNS("svg"),d.appendChild(h),styleDiv(u)))):this.isMasked?h=this.textPaths[g]?this.textPaths[g]:createNS("text"):this.textSpans[g]?(u=this.textSpans[g],h=this.textPaths[g]):(u=createTag("span"),styleDiv(u),h=createTag("span"),styleDiv(h),u.appendChild(h)),this.globalData.fontManager.chars){var y=this.globalData.fontManager.getCharData(i.finalText[a],n.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily),c;if(y?c=y.data:c=null,f.reset(),c&&c.shapes&&c.shapes.length&&(p=c.shapes[0].it,f.scale(i.finalSize/100,i.finalSize/100),m=this.createPathShape(f,p),h.setAttribute("d",m)),this.isMasked)this.innerElem.appendChild(h);else{if(this.innerElem.appendChild(u),c&&c.shapes){document.body.appendChild(d);var x=d.getBBox();d.setAttribute("width",x.width+2),d.setAttribute("height",x.height+2),d.setAttribute("viewBox",x.x-1+" "+(x.y-1)+" "+(x.width+2)+" "+(x.height+2));var v=d.style,_="translate("+(x.x-1)+"px,"+(x.y-1)+"px)";v.transform=_,v.webkitTransform=_,l[a].yOffset=x.y-1}else d.setAttribute("width",1),d.setAttribute("height",1);u.appendChild(d)}}else if(h.textContent=l[a].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(h);else{this.innerElem.appendChild(u);var b=h.style,M="translate3d(0,"+-i.finalSize/1.2+"px,0)";b.transform=M,b.webkitTransform=M}this.isMasked?this.textSpans[g]=h:this.textSpans[g]=u,this.textSpans[g].style.display="block",this.textPaths[g]=h,g+=1}for(;g<this.textSpans.length;)this.textSpans[g].style.display="none",g+=1},HTextElement.prototype.renderInnerContent=function(){this.validateText();var i;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),i=this.svgElement.style;var e="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";i.transform=e,i.webkitTransform=e}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),!(!this.lettersChangedFlag&&!this.textAnimator.lettersChangedFlag)){var t,n,r=0,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;n=a.length;var o,l,h;for(t=0;t<n;t+=1)a[t].n?r+=1:(l=this.textSpans[t],h=this.textPaths[t],o=s[r],r+=1,o._mdf.m&&(this.isMasked?l.setAttribute("transform",o.m):(l.style.webkitTransform=o.m,l.style.transform=o.m)),l.style.opacity=o.o,o.sw&&o._mdf.sw&&h.setAttribute("stroke-width",o.sw),o.sc&&o._mdf.sc&&h.setAttribute("stroke",o.sc),o.fc&&o._mdf.fc&&(h.setAttribute("fill",o.fc),h.style.color=o.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var u=this.innerElem.getBBox();this.currentBBox.w!==u.width&&(this.currentBBox.w=u.width,this.svgElement.setAttribute("width",u.width)),this.currentBBox.h!==u.height&&(this.currentBBox.h=u.height,this.svgElement.setAttribute("height",u.height));var d=1;if(this.currentBBox.w!==u.width+d*2||this.currentBBox.h!==u.height+d*2||this.currentBBox.x!==u.x-d||this.currentBBox.y!==u.y-d){this.currentBBox.w=u.width+d*2,this.currentBBox.h=u.height+d*2,this.currentBBox.x=u.x-d,this.currentBBox.y=u.y-d,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),i=this.svgElement.style;var f="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";i.transform=f,i.webkitTransform=f}}}};function HCameraElement(i,e,t){this.initFrame(),this.initBaseData(i,e,t),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,i.pe,0,0,this),i.ks.p.s?(this.px=n(this,i.ks.p.x,1,0,this),this.py=n(this,i.ks.p.y,1,0,this),this.pz=n(this,i.ks.p.z,1,0,this)):this.p=n(this,i.ks.p,1,0,this),i.ks.a&&(this.a=n(this,i.ks.a,1,0,this)),i.ks.or.k.length&&i.ks.or.k[0].to){var r,s=i.ks.or.k.length;for(r=0;r<s;r+=1)i.ks.or.k[r].to=null,i.ks.or.k[r].ti=null}this.or=n(this,i.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,i.ks.rx,0,degToRads,this),this.ry=n(this,i.ks.ry,0,degToRads,this),this.rz=n(this,i.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var i,e=this.comp.threeDElements.length,t,n,r;for(i=0;i<e;i+=1)if(t=this.comp.threeDElements[i],t.type==="3d"){n=t.perspectiveElem.style,r=t.container.style;var s=this.pe.v+"px",a="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";n.perspective=s,n.webkitPerspective=s,r.transformOrigin=a,r.mozTransformOrigin=a,r.webkitTransformOrigin=a,n.transform=o,n.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var i=this._isFirstFrame,e,t;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)i=this.hierarchy[e].finalTransform.mProp._mdf||i;if(i||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(t=this.hierarchy.length-1,e=t;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;this.p?r=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:r=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var s=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),a=[r[0]/s,r[1]/s,r[2]/s],o=Math.sqrt(a[2]*a[2]+a[0]*a[0]),l=Math.atan2(a[1],o),h=Math.atan2(a[0],-a[2]);this.mat.rotateY(h).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var u=!this._prevMat.equals(this.mat);if((u||this.pe._mdf)&&this.comp.threeDElements){t=this.comp.threeDElements.length;var d,f,p;for(e=0;e<t;e+=1)if(d=this.comp.threeDElements[e],d.type==="3d"){if(u){var m=this.mat.toCSS();p=d.container.style,p.transform=m,p.webkitTransform=m}this.pe._mdf&&(f=d.perspectiveElem.style,f.perspective=this.pe.v+"px",f.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(i){this.prepareProperties(i,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null};function HImageElement(i,e,t){this.assetData=e.getAssetData(i.refId),this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var i=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=i,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)};function HybridRendererBase(i,e){this.animationItem=i,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&e.hideOnTransparent===!1),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();i.checkParenting()}},HybridRendererBase.prototype.appendElementInPos=function(i,e){var t=i.getBaseElement();if(t){var n=this.layers[e];if(!n.ddd||!this.supports3d)if(this.threeDElements)this.addTo3dContainer(t,e);else{for(var r=0,s,a,o;r<e;)this.elements[r]&&this.elements[r]!==!0&&this.elements[r].getBaseElement&&(a=this.elements[r],o=this.layers[r].ddd?this.getThreeDContainerByPos(r):a.getBaseElement(),s=o||s),r+=1;s?(!n.ddd||!this.supports3d)&&this.layerElement.insertBefore(t,s):(!n.ddd||!this.supports3d)&&this.layerElement.appendChild(t)}else this.addTo3dContainer(t,e)}},HybridRendererBase.prototype.createShape=function(i){return this.supports3d?new HShapeElement(i,this.globalData,this):new SVGShapeElement(i,this.globalData,this)},HybridRendererBase.prototype.createText=function(i){return this.supports3d?new HTextElement(i,this.globalData,this):new SVGTextLottieElement(i,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(i){return this.camera=new HCameraElement(i,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(i){return this.supports3d?new HImageElement(i,this.globalData,this):new IImageElement(i,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(i){return this.supports3d?new HSolidElement(i,this.globalData,this):new ISolidElement(i,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(i){for(var e=0,t=this.threeDElements.length;e<t;){if(this.threeDElements[e].startPos<=i&&this.threeDElements[e].endPos>=i)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(i,e){var t=createTag("div"),n,r;styleDiv(t);var s=createTag("div");if(styleDiv(s),e==="3d"){n=t.style,n.width=this.globalData.compSize.w+"px",n.height=this.globalData.compSize.h+"px";var a="50% 50%";n.webkitTransformOrigin=a,n.mozTransformOrigin=a,n.transformOrigin=a,r=s.style;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.transform=o,r.webkitTransform=o}t.appendChild(s);var l={container:s,perspectiveElem:t,startPos:i,endPos:i,type:e};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var i,e=this.layers.length,t,n="";for(i=0;i<e;i+=1)this.layers[i].ddd&&this.layers[i].ty!==3?(n!=="3d"&&(n="3d",t=this.createThreeDContainer(i,"3d")),t.endPos=Math.max(t.endPos,i)):(n!=="2d"&&(n="2d",t=this.createThreeDContainer(i,"2d")),t.endPos=Math.max(t.endPos,i));for(e=this.threeDElements.length,i=e-1;i>=0;i-=1)this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(i,e){for(var t=0,n=this.threeDElements.length;t<n;){if(e<=this.threeDElements[t].endPos){for(var r=this.threeDElements[t].startPos,s;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(s=this.elements[r].getBaseElement()),r+=1;s?this.threeDElements[t].container.insertBefore(i,s):this.threeDElements[t].container.appendChild(i);break}t+=1}},HybridRendererBase.prototype.configAnimation=function(i){var e=createTag("div"),t=this.animationItem.wrapper,n=e.style;n.width=i.w+"px",n.height=i.h+"px",this.resizerElem=e,styleDiv(e),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),t.appendChild(e),n.overflow="hidden";var r=createNS("svg");r.setAttribute("width","1"),r.setAttribute("height","1"),styleDiv(r),this.resizerElem.appendChild(r);var s=createNS("defs");r.appendChild(s),this.data=i,this.setupGlobalData(i,r),this.globalData.defs=s,this.layers=i.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var i,e=this.layers?this.layers.length:0;for(i=0;i<e;i+=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var i=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,t=i/e,n=this.globalData.compSize.w/this.globalData.compSize.h,r,s,a,o;n>t?(r=i/this.globalData.compSize.w,s=i/this.globalData.compSize.w,a=0,o=(e-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(r=e/this.globalData.compSize.h,s=e/this.globalData.compSize.h,a=(i-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,o=0);var l=this.resizerElem.style;l.webkitTransform="matrix3d("+r+",0,0,0,0,"+s+",0,0,0,0,1,0,"+a+","+o+",0,1)",l.transform=l.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var i=this.globalData.compSize.w,e=this.globalData.compSize.h,t,n=this.threeDElements.length;for(t=0;t<n;t+=1){var r=this.threeDElements[t].perspectiveElem.style;r.webkitPerspective=Math.sqrt(Math.pow(i,2)+Math.pow(e,2))+"px",r.perspective=r.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(i){var e,t=i.length,n=createTag("div");for(e=0;e<t;e+=1)if(i[e].xt){var r=this.createComp(i[e],n,this.globalData.comp,null);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}};function HCompElement(i,e,t){this.layers=i.layers,this.supports3d=!i.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(i,e,t),this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0}}extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(i,e){for(var t=0,n;t<e;)this.elements[t]&&this.elements[t].getBaseElement&&(n=this.elements[t].getBaseElement()),t+=1;n?this.layerElement.insertBefore(i,n):this.layerElement.appendChild(i)},HCompElement.prototype.createComp=function(i){return this.supports3d?new HCompElement(i,this.globalData,this):new SVGCompElement(i,this.globalData,this)};function HybridRenderer(i,e){this.animationItem=i,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&e.hideOnTransparent===!1),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"},runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(i){return this.supports3d?new HCompElement(i,this.globalData,this):new SVGCompElement(i,this.globalData,this)};var CompExpressionInterface=(function(){return function(i){function e(t){for(var n=0,r=i.layers.length;n<r;){if(i.layers[n].nm===t||i.layers[n].ind===t)return i.elements[n].layerInterface;n+=1}return null}return Object.defineProperty(e,"_name",{value:i.data.nm}),e.layer=e,e.pixelAspect=1,e.height=i.data.h||i.globalData.compSize.h,e.width=i.data.w||i.globalData.compSize.w,e.pixelAspect=1,e.frameDuration=1/i.globalData.frameRate,e.displayStartTime=0,e.numLayers=i.layers.length,e}})();function _typeof$2(i){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(i)}function seedRandom(i,e){var t=this,n=256,r=6,s=52,a="random",o=e.pow(n,r),l=e.pow(2,s),h=l*2,u=n-1,d;function f(v,_,b){var M=[];_=_===!0?{entropy:!0}:_||{};var A=y(g(_.entropy?[v,x(i)]:v===null?c():v,3),M),R=new p(M),w=function(){for(var N=R.g(r),V=o,G=0;N<l;)N=(N+G)*n,V*=n,G=R.g(1);for(;N>=h;)N/=2,V/=2,G>>>=1;return(N+G)/V};return w.int32=function(){return R.g(4)|0},w.quick=function(){return R.g(4)/4294967296},w.double=w,y(x(R.S),i),(_.pass||b||function(P,N,V,G){return G&&(G.S&&m(G,R),P.state=function(){return m(R,{})}),V?(e[a]=P,N):P})(w,A,"global"in _?_.global:this==e,_.state)}e["seed"+a]=f;function p(v){var _,b=v.length,M=this,A=0,R=M.i=M.j=0,w=M.S=[];for(b||(v=[b++]);A<n;)w[A]=A++;for(A=0;A<n;A++)w[A]=w[R=u&R+v[A%b]+(_=w[A])],w[R]=_;M.g=function(P){for(var N,V=0,G=M.i,H=M.j,O=M.S;P--;)N=O[G=u&G+1],V=V*n+O[u&(O[G]=O[H=u&H+N])+(O[H]=N)];return M.i=G,M.j=H,V}}function m(v,_){return _.i=v.i,_.j=v.j,_.S=v.S.slice(),_}function g(v,_){var b=[],M=_typeof$2(v),A;if(_&&M=="object")for(A in v)try{b.push(g(v[A],_-1))}catch{}return b.length?b:M=="string"?v:v+"\0"}function y(v,_){for(var b=v+"",M,A=0;A<b.length;)_[u&A]=u&(M^=_[u&A]*19)+b.charCodeAt(A++);return x(_)}function c(){try{var v=new Uint8Array(n);return(t.crypto||t.msCrypto).getRandomValues(v),x(v)}catch{var _=t.navigator,b=_&&_.plugins;return[+new Date,t,b,t.screen,x(i)]}}function x(v){return String.fromCharCode.apply(0,v)}y(e.random(),i)}function initialize$2(i){seedRandom([],i)}var propTypes={SHAPE:"shape"};function _typeof$1(i){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(i)}var ExpressionManager=(function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};initialize$2(BMMath);function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(i){return i.constructor===Array||i.constructor===Float32Array}function isNumerable(i,e){return i==="number"||e instanceof Number||i==="boolean"||i==="string"}function $bm_neg(i){var e=_typeof$1(i);if(e==="number"||i instanceof Number||e==="boolean")return-i;if($bm_isInstanceOfArray(i)){var t,n=i.length,r=[];for(t=0;t<n;t+=1)r[t]=-i[t];return r}return i.propType?i.v:-i}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(i,e){var t=_typeof$1(i),n=_typeof$1(e);if(isNumerable(t,i)&&isNumerable(n,e)||t==="string"||n==="string")return i+e;if($bm_isInstanceOfArray(i)&&isNumerable(n,e))return i=i.slice(0),i[0]+=e,i;if(isNumerable(t,i)&&$bm_isInstanceOfArray(e))return e=e.slice(0),e[0]=i+e[0],e;if($bm_isInstanceOfArray(i)&&$bm_isInstanceOfArray(e)){for(var r=0,s=i.length,a=e.length,o=[];r<s||r<a;)(typeof i[r]=="number"||i[r]instanceof Number)&&(typeof e[r]=="number"||e[r]instanceof Number)?o[r]=i[r]+e[r]:o[r]=e[r]===void 0?i[r]:i[r]||e[r],r+=1;return o}return 0}var add=sum;function sub(i,e){var t=_typeof$1(i),n=_typeof$1(e);if(isNumerable(t,i)&&isNumerable(n,e))return t==="string"&&(i=parseInt(i,10)),n==="string"&&(e=parseInt(e,10)),i-e;if($bm_isInstanceOfArray(i)&&isNumerable(n,e))return i=i.slice(0),i[0]-=e,i;if(isNumerable(t,i)&&$bm_isInstanceOfArray(e))return e=e.slice(0),e[0]=i-e[0],e;if($bm_isInstanceOfArray(i)&&$bm_isInstanceOfArray(e)){for(var r=0,s=i.length,a=e.length,o=[];r<s||r<a;)(typeof i[r]=="number"||i[r]instanceof Number)&&(typeof e[r]=="number"||e[r]instanceof Number)?o[r]=i[r]-e[r]:o[r]=e[r]===void 0?i[r]:i[r]||e[r],r+=1;return o}return 0}function mul(i,e){var t=_typeof$1(i),n=_typeof$1(e),r;if(isNumerable(t,i)&&isNumerable(n,e))return i*e;var s,a;if($bm_isInstanceOfArray(i)&&isNumerable(n,e)){for(a=i.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i[s]*e;return r}if(isNumerable(t,i)&&$bm_isInstanceOfArray(e)){for(a=e.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i*e[s];return r}return 0}function div(i,e){var t=_typeof$1(i),n=_typeof$1(e),r;if(isNumerable(t,i)&&isNumerable(n,e))return i/e;var s,a;if($bm_isInstanceOfArray(i)&&isNumerable(n,e)){for(a=i.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i[s]/e;return r}if(isNumerable(t,i)&&$bm_isInstanceOfArray(e)){for(a=e.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i/e[s];return r}return 0}function mod(i,e){return typeof i=="string"&&(i=parseInt(i,10)),typeof e=="string"&&(e=parseInt(e,10)),i%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(i,e,t){if(e>t){var n=t;t=e,e=n}return Math.min(Math.max(i,e),t)}function radiansToDegrees(i){return i/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(i){return i*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(i,e){if(typeof i=="number"||i instanceof Number)return e=e||0,Math.abs(i-e);e||(e=helperLengthArray);var t,n=Math.min(i.length,e.length),r=0;for(t=0;t<n;t+=1)r+=Math.pow(e[t]-i[t],2);return Math.sqrt(r)}function normalize(i){return div(i,length(i))}function rgbToHsl(i){var e=i[0],t=i[1],n=i[2],r=Math.max(e,t,n),s=Math.min(e,t,n),a,o,l=(r+s)/2;if(r===s)a=0,o=0;else{var h=r-s;switch(o=l>.5?h/(2-r-s):h/(r+s),r){case e:a=(t-n)/h+(t<n?6:0);break;case t:a=(n-e)/h+2;break;case n:a=(e-t)/h+4;break}a/=6}return[a,o,l,i[3]]}function hue2rgb(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function hslToRgb(i){var e=i[0],t=i[1],n=i[2],r,s,a;if(t===0)r=n,a=n,s=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=hue2rgb(l,o,e+1/3),s=hue2rgb(l,o,e),a=hue2rgb(l,o,e-1/3)}return[r,s,a,i[3]]}function linear(i,e,t,n,r){if((n===void 0||r===void 0)&&(n=e,r=t,e=0,t=1),t<e){var s=t;t=e,e=s}if(i<=e)return n;if(i>=t)return r;var a=t===e?0:(i-e)/(t-e);if(!n.length)return n+(r-n)*a;var o,l=n.length,h=createTypedArray("float32",l);for(o=0;o<l;o+=1)h[o]=n[o]+(r[o]-n[o])*a;return h}function random(i,e){if(e===void 0&&(i===void 0?(i=0,e=1):(e=i,i=void 0)),e.length){var t,n=e.length;i||(i=createTypedArray("float32",n));var r=createTypedArray("float32",n),s=BMMath.random();for(t=0;t<n;t+=1)r[t]=i[t]+s*(e[t]-i[t]);return r}i===void 0&&(i=0);var a=BMMath.random();return i+a*(e-i)}function createPath(i,e,t,n){var r,s=i.length,a=shapePool.newElement();a.setPathData(!!n,s);var o=[0,0],l,h;for(r=0;r<s;r+=1)l=e&&e[r]?e[r]:o,h=t&&t[r]?t[r]:o,a.setTripleAt(i[r][0],i[r][1],h[0]+i[r][0],h[1]+i[r][1],l[0]+i[r][0],l[1]+i[r][1],r,!0);return a}function initiateExpression(elem,data,property){function noOp(i){return i}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=val.indexOf("random")!==-1,elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty._name=elem.data.nm,thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||this.data.hd!==!0,wiggle=(function i(e,t){var n,r,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);e=5;var o=Math.floor(time*e);for(n=0,r=0;n<o;){for(r=0;r<s;r+=1)a[r]+=-t+t*2*BMMath.random();n+=1}var l=time*e,h=l-Math.floor(l),u=createTypedArray("float32",s);if(s>1){for(r=0;r<s;r+=1)u[r]=this.pv[r]+a[r]+(-t+t*2*BMMath.random())*h;return u}return this.pv+a[0]+(-t+t*2*BMMath.random())*h}).bind(this);thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty));function loopInDuration(i,e){return loopIn(i,e,!0)}function loopOutDuration(i,e){return loopOut(i,e,!0)}this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);function lookAt(i,e){var t=[e[0]-i[0],e[1]-i[1],e[2]-i[2]],n=Math.atan2(t[0],Math.sqrt(t[1]*t[1]+t[2]*t[2]))/degToRads,r=-Math.atan2(t[1],t[2])/degToRads;return[r,n,0]}function easeOut(i,e,t,n,r){return applyEase(easeOutBez,i,e,t,n,r)}function easeIn(i,e,t,n,r){return applyEase(easeInBez,i,e,t,n,r)}function ease(i,e,t,n,r){return applyEase(easeInOutBez,i,e,t,n,r)}function applyEase(i,e,t,n,r,s){r===void 0?(r=t,s=n):e=(e-t)/(n-t),e>1?e=1:e<0&&(e=0);var a=i(e);if($bm_isInstanceOfArray(r)){var o,l=r.length,h=createTypedArray("float32",l);for(o=0;o<l;o+=1)h[o]=(s[o]-r[o])*a+r[o];return h}return(s-r)*a+r}function nearestKey(i){var e,t=data.k.length,n,r;if(!data.k.length||typeof data.k[0]=="number")n=0,r=0;else if(n=-1,i*=elem.comp.globalData.frameRate,i<data.k[0].t)n=1,r=data.k[0].t;else{for(e=0;e<t-1;e+=1)if(i===data.k[e].t){n=e+1,r=data.k[e].t;break}else if(i>data.k[e].t&&i<data.k[e+1].t){i-data.k[e].t>data.k[e+1].t-i?(n=e+2,r=data.k[e+1].t):(n=e+1,r=data.k[e].t);break}n===-1&&(n=e+1,r=data.k[e].t)}var s={};return s.index=n,s.time=r/elem.comp.globalData.frameRate,s}function key(i){var e,t,n;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+i);i-=1,e={time:data.k[i].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[i],"s")?data.k[i].s:data.k[i-1].e;for(n=r.length,t=0;t<n;t+=1)e[t]=r[t],e.value[t]=r[t];return e}function framesToTime(i,e){return e||(e=elem.comp.globalData.frameRate),i/e}function timeToFrames(i,e){return!i&&i!==0&&(i=time),e||(e=elem.comp.globalData.frameRate),i*e}function seedRandom(i){BMMath.seedrandom(randSeed+i)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(i,e){return typeof value=="string"?e===void 0?value.substring(i):value.substring(i,e):""}function substr(i,e){return typeof value=="string"?e===void 0?value.substr(i):value.substr(i,e):""}function posterizeTime(i){time=i===0?0:Math.floor(time*i)/i,value=valueAtTime(time)}var time,velocity,value,text,textIndex,textTotal,selectorValue,index=elem.data.ind,hasParent=!!(elem.hierarchy&&elem.hierarchy.length),parent,randSeed=Math.floor(Math.random()*1e6),globalData=elem.globalData;function executeExpression(i){return value=i,this.frameExpressionId===elem.globalData.frameId&&this.propType!=="textSelector"?value:(this.propType==="textSelector"&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),elemType===4&&!content&&(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),hasParent=!!(elem.hierarchy&&elem.hierarchy.length),hasParent&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt,scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob})(),Expressions=(function(){var i={};i.initExpressions=e,i.resetFrame=ExpressionManager.resetFrame;function e(t){var n=0,r=[];function s(){n+=1}function a(){n-=1,n===0&&l()}function o(h){r.indexOf(h)===-1&&r.push(h)}function l(){var h,u=r.length;for(h=0;h<u;h+=1)r[h].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=s,t.renderer.globalData.popExpression=a,t.renderer.globalData.registerExpressionProperty=o}return i})(),MaskManagerInterface=(function(){function i(t,n){this._mask=t,this._data=n}Object.defineProperty(i.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(i.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),this._mask.op.v*100}});var e=function(n){var r=createSizedArray(n.viewData.length),s,a=n.viewData.length;for(s=0;s<a;s+=1)r[s]=new i(n.viewData[s],n.masksProperties[s]);var o=function(h){for(s=0;s<a;){if(n.masksProperties[s].nm===h)return r[s];s+=1}return null};return o};return e})(),ExpressionPropertyInterface=(function(){var i={pv:0,v:0,mult:1},e={pv:[0,0,0],v:[0,0,0],mult:1};function t(a,o,l){Object.defineProperty(a,"velocity",{get:function(){return o.getVelocityAtTime(o.comp.currentFrame)}}),a.numKeys=o.keyframes?o.keyframes.length:0,a.key=function(h){if(!a.numKeys)return 0;var u="";"s"in o.keyframes[h-1]?u=o.keyframes[h-1].s:"e"in o.keyframes[h-2]?u=o.keyframes[h-2].e:u=o.keyframes[h-2].s;var d=l==="unidimensional"?new Number(u):Object.assign({},u);return d.time=o.keyframes[h-1].t/o.elem.comp.globalData.frameRate,d.value=l==="unidimensional"?u[0]:u,d},a.valueAtTime=o.getValueAtTime,a.speedAtTime=o.getSpeedAtTime,a.velocityAtTime=o.getVelocityAtTime,a.propertyGroup=o.propertyGroup}function n(a){(!a||!("pv"in a))&&(a=i);var o=1/a.mult,l=a.pv*o,h=new Number(l);return h.value=l,t(h,a,"unidimensional"),function(){return a.k&&a.getValue(),l=a.v*o,h.value!==l&&(h=new Number(l),h.value=l,h[0]=l,t(h,a,"unidimensional")),h}}function r(a){(!a||!("pv"in a))&&(a=e);var o=1/a.mult,l=a.data&&a.data.l||a.pv.length,h=createTypedArray("float32",l),u=createTypedArray("float32",l);return h.value=u,t(h,a,"multidimensional"),function(){a.k&&a.getValue();for(var d=0;d<l;d+=1)u[d]=a.v[d]*o,h[d]=u[d];return h}}function s(){return i}return function(a){return a?a.propType==="unidimensional"?n(a):r(a):s}})(),TransformExpressionInterface=(function(){return function(i){function e(a){switch(a){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(i.r||i.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(i.rz||i.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(i.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(i.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(i.s)});var t,n,r,s;return i.p?s=ExpressionPropertyInterface(i.p):(t=ExpressionPropertyInterface(i.px),n=ExpressionPropertyInterface(i.py),i.pz&&(r=ExpressionPropertyInterface(i.pz))),Object.defineProperty(e,"position",{get:function(){return i.p?s():[t(),n(),r?r():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(i.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(i.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(i.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(i.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(i.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(i.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(i.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(i.or)}),e}})(),LayerExpressionInterface=(function(){function i(h){var u=new Matrix;if(h!==void 0){var d=this._elem.finalTransform.mProp.getValueAtTime(h);d.clone(u)}else{var f=this._elem.finalTransform.mProp;f.applyToMatrix(u)}return u}function e(h,u){var d=this.getMatrix(u);return d.props[12]=0,d.props[13]=0,d.props[14]=0,this.applyPoint(d,h)}function t(h,u){var d=this.getMatrix(u);return this.applyPoint(d,h)}function n(h,u){var d=this.getMatrix(u);return d.props[12]=0,d.props[13]=0,d.props[14]=0,this.invertPoint(d,h)}function r(h,u){var d=this.getMatrix(u);return this.invertPoint(d,h)}function s(h,u){if(this._elem.hierarchy&&this._elem.hierarchy.length){var d,f=this._elem.hierarchy.length;for(d=0;d<f;d+=1)this._elem.hierarchy[d].finalTransform.mProp.applyToMatrix(h)}return h.applyToPointArray(u[0],u[1],u[2]||0)}function a(h,u){if(this._elem.hierarchy&&this._elem.hierarchy.length){var d,f=this._elem.hierarchy.length;for(d=0;d<f;d+=1)this._elem.hierarchy[d].finalTransform.mProp.applyToMatrix(h)}return h.inversePoint(u)}function o(h){var u=new Matrix;if(u.reset(),this._elem.finalTransform.mProp.applyToMatrix(u),this._elem.hierarchy&&this._elem.hierarchy.length){var d,f=this._elem.hierarchy.length;for(d=0;d<f;d+=1)this._elem.hierarchy[d].finalTransform.mProp.applyToMatrix(u);return u.inversePoint(h)}return u.inversePoint(h)}function l(){return[1,1,1,1]}return function(h){var u;function d(g){p.mask=new MaskManagerInterface(g,h)}function f(g){p.effect=g}function p(g){switch(g){case"ADBE Root Vectors Group":case"Contents":case 2:return p.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return u;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return p.effect;case"ADBE Text Properties":return p.textInterface;default:return null}}p.getMatrix=i,p.invertPoint=a,p.applyPoint=s,p.toWorld=t,p.toWorldVec=e,p.fromWorld=r,p.fromWorldVec=n,p.toComp=t,p.fromComp=o,p.sampleImage=l,p.sourceRectAtTime=h.sourceRectAtTime.bind(h),p._elem=h,u=TransformExpressionInterface(h.finalTransform.mProp);var m=getDescriptor(u,"anchorPoint");return Object.defineProperties(p,{hasParent:{get:function(){return h.hierarchy.length}},parent:{get:function(){return h.hierarchy[0].layerInterface}},rotation:getDescriptor(u,"rotation"),scale:getDescriptor(u,"scale"),position:getDescriptor(u,"position"),opacity:getDescriptor(u,"opacity"),anchorPoint:m,anchor_point:m,transform:{get:function(){return u}},active:{get:function(){return h.isInRange}}}),p.startTime=h.data.st,p.index=h.data.ind,p.source=h.data.refId,p.height=h.data.ty===0?h.data.h:100,p.width=h.data.ty===0?h.data.w:100,p.inPoint=h.data.ip/h.comp.globalData.frameRate,p.outPoint=h.data.op/h.comp.globalData.frameRate,p._name=h.data.nm,p.registerMaskInterface=d,p.registerEffectsInterface=f,p}})(),propertyGroupFactory=(function(){return function(i,e){return function(t){return t=t===void 0?1:t,t<=0?i:e(t-1)}}})(),PropertyInterface=(function(){return function(i,e){var t={_name:i};function n(r){return r=r===void 0?1:r,r<=0?t:e(r-1)}return n}})(),EffectsExpressionInterface=(function(){var i={createEffectsInterface:e};function e(r,s){if(r.effectsManager){var a=[],o=r.data.ef,l,h=r.effectsManager.effectElements.length;for(l=0;l<h;l+=1)a.push(t(o[l],r.effectsManager.effectElements[l],s,r));var u=r.data.ef||[],d=function(p){for(l=0,h=u.length;l<h;){if(p===u[l].nm||p===u[l].mn||p===u[l].ix)return a[l];l+=1}return null};return Object.defineProperty(d,"numProperties",{get:function(){return u.length}}),d}return null}function t(r,s,a,o){function l(p){for(var m=r.ef,g=0,y=m.length;g<y;){if(p===m[g].nm||p===m[g].mn||p===m[g].ix)return m[g].ty===5?u[g]:u[g]();g+=1}throw new Error}var h=propertyGroupFactory(l,a),u=[],d,f=r.ef.length;for(d=0;d<f;d+=1)r.ef[d].ty===5?u.push(t(r.ef[d],s.effectElements[d],s.effectElements[d].propertyGroup,o)):u.push(n(s.effectElements[d],r.ef[d].ty,o,h));return r.mn==="ADBE Color Control"&&Object.defineProperty(l,"color",{get:function(){return u[0]()}}),Object.defineProperties(l,{numProperties:{get:function(){return r.np}},_name:{value:r.nm},propertyGroup:{value:h}}),l.enabled=r.en!==0,l.active=l.enabled,l}function n(r,s,a,o){var l=ExpressionPropertyInterface(r.p);function h(){return s===10?a.comp.compInterface(r.p.v):l()}return r.p.setGroupProperty&&r.p.setGroupProperty(PropertyInterface("",o)),h}return i})(),ShapePathInterface=(function(){return function(e,t,n){var r=t.sh;function s(o){return o==="Shape"||o==="shape"||o==="Path"||o==="path"||o==="ADBE Vector Shape"||o===2?s.path:null}var a=propertyGroupFactory(s,n);return r.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return r.k&&r.getValue(),r}},shape:{get:function(){return r.k&&r.getValue(),r}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:n}}),s}})(),ShapeExpressionInterface=(function(){function i(m,g,y){var c=[],x,v=m?m.length:0;for(x=0;x<v;x+=1)m[x].ty==="gr"?c.push(t(m[x],g[x],y)):m[x].ty==="fl"?c.push(n(m[x],g[x],y)):m[x].ty==="st"?c.push(a(m[x],g[x],y)):m[x].ty==="tm"?c.push(o(m[x],g[x],y)):m[x].ty==="tr"||(m[x].ty==="el"?c.push(h(m[x],g[x],y)):m[x].ty==="sr"?c.push(u(m[x],g[x],y)):m[x].ty==="sh"?c.push(ShapePathInterface(m[x],g[x],y)):m[x].ty==="rc"?c.push(d(m[x],g[x],y)):m[x].ty==="rd"?c.push(f(m[x],g[x],y)):m[x].ty==="rp"?c.push(p(m[x],g[x],y)):m[x].ty==="gf"?c.push(r(m[x],g[x],y)):c.push(s(m[x],g[x])));return c}function e(m,g,y){var c,x=function(b){for(var M=0,A=c.length;M<A;){if(c[M]._name===b||c[M].mn===b||c[M].propertyIndex===b||c[M].ix===b||c[M].ind===b)return c[M];M+=1}return typeof b=="number"?c[b-1]:null};x.propertyGroup=propertyGroupFactory(x,y),c=i(m.it,g.it,x.propertyGroup),x.numProperties=c.length;var v=l(m.it[m.it.length-1],g.it[g.it.length-1],x.propertyGroup);return x.transform=v,x.propertyIndex=m.cix,x._name=m.nm,x}function t(m,g,y){var c=function(b){switch(b){case"ADBE Vectors Group":case"Contents":case 2:return c.content;default:return c.transform}};c.propertyGroup=propertyGroupFactory(c,y);var x=e(m,g,c.propertyGroup),v=l(m.it[m.it.length-1],g.it[g.it.length-1],c.propertyGroup);return c.content=x,c.transform=v,Object.defineProperty(c,"_name",{get:function(){return m.nm}}),c.numProperties=m.np,c.propertyIndex=m.ix,c.nm=m.nm,c.mn=m.mn,c}function n(m,g,y){function c(x){return x==="Color"||x==="color"?c.color:x==="Opacity"||x==="opacity"?c.opacity:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(g.c)},opacity:{get:ExpressionPropertyInterface(g.o)},_name:{value:m.nm},mn:{value:m.mn}}),g.c.setGroupProperty(PropertyInterface("Color",y)),g.o.setGroupProperty(PropertyInterface("Opacity",y)),c}function r(m,g,y){function c(x){return x==="Start Point"||x==="start point"?c.startPoint:x==="End Point"||x==="end point"?c.endPoint:x==="Opacity"||x==="opacity"?c.opacity:null}return Object.defineProperties(c,{startPoint:{get:ExpressionPropertyInterface(g.s)},endPoint:{get:ExpressionPropertyInterface(g.e)},opacity:{get:ExpressionPropertyInterface(g.o)},type:{get:function(){return"a"}},_name:{value:m.nm},mn:{value:m.mn}}),g.s.setGroupProperty(PropertyInterface("Start Point",y)),g.e.setGroupProperty(PropertyInterface("End Point",y)),g.o.setGroupProperty(PropertyInterface("Opacity",y)),c}function s(){function m(){return null}return m}function a(m,g,y){var c=propertyGroupFactory(A,y),x=propertyGroupFactory(M,c);function v(R){Object.defineProperty(M,m.d[R].nm,{get:ExpressionPropertyInterface(g.d.dataProps[R].p)})}var _,b=m.d?m.d.length:0,M={};for(_=0;_<b;_+=1)v(_),g.d.dataProps[_].p.setGroupProperty(x);function A(R){return R==="Color"||R==="color"?A.color:R==="Opacity"||R==="opacity"?A.opacity:R==="Stroke Width"||R==="stroke width"?A.strokeWidth:null}return Object.defineProperties(A,{color:{get:ExpressionPropertyInterface(g.c)},opacity:{get:ExpressionPropertyInterface(g.o)},strokeWidth:{get:ExpressionPropertyInterface(g.w)},dash:{get:function(){return M}},_name:{value:m.nm},mn:{value:m.mn}}),g.c.setGroupProperty(PropertyInterface("Color",c)),g.o.setGroupProperty(PropertyInterface("Opacity",c)),g.w.setGroupProperty(PropertyInterface("Stroke Width",c)),A}function o(m,g,y){function c(v){return v===m.e.ix||v==="End"||v==="end"?c.end:v===m.s.ix?c.start:v===m.o.ix?c.offset:null}var x=propertyGroupFactory(c,y);return c.propertyIndex=m.ix,g.s.setGroupProperty(PropertyInterface("Start",x)),g.e.setGroupProperty(PropertyInterface("End",x)),g.o.setGroupProperty(PropertyInterface("Offset",x)),c.propertyIndex=m.ix,c.propertyGroup=y,Object.defineProperties(c,{start:{get:ExpressionPropertyInterface(g.s)},end:{get:ExpressionPropertyInterface(g.e)},offset:{get:ExpressionPropertyInterface(g.o)},_name:{value:m.nm}}),c.mn=m.mn,c}function l(m,g,y){function c(v){return m.a.ix===v||v==="Anchor Point"?c.anchorPoint:m.o.ix===v||v==="Opacity"?c.opacity:m.p.ix===v||v==="Position"?c.position:m.r.ix===v||v==="Rotation"||v==="ADBE Vector Rotation"?c.rotation:m.s.ix===v||v==="Scale"?c.scale:m.sk&&m.sk.ix===v||v==="Skew"?c.skew:m.sa&&m.sa.ix===v||v==="Skew Axis"?c.skewAxis:null}var x=propertyGroupFactory(c,y);return g.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",x)),g.transform.mProps.p.setGroupProperty(PropertyInterface("Position",x)),g.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",x)),g.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",x)),g.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",x)),g.transform.mProps.sk&&(g.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",x)),g.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",x))),g.transform.op.setGroupProperty(PropertyInterface("Opacity",x)),Object.defineProperties(c,{opacity:{get:ExpressionPropertyInterface(g.transform.mProps.o)},position:{get:ExpressionPropertyInterface(g.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(g.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(g.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(g.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(g.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(g.transform.mProps.sa)},_name:{value:m.nm}}),c.ty="tr",c.mn=m.mn,c.propertyGroup=y,c}function h(m,g,y){function c(_){return m.p.ix===_?c.position:m.s.ix===_?c.size:null}var x=propertyGroupFactory(c,y);c.propertyIndex=m.ix;var v=g.sh.ty==="tm"?g.sh.prop:g.sh;return v.s.setGroupProperty(PropertyInterface("Size",x)),v.p.setGroupProperty(PropertyInterface("Position",x)),Object.defineProperties(c,{size:{get:ExpressionPropertyInterface(v.s)},position:{get:ExpressionPropertyInterface(v.p)},_name:{value:m.nm}}),c.mn=m.mn,c}function u(m,g,y){function c(_){return m.p.ix===_?c.position:m.r.ix===_?c.rotation:m.pt.ix===_?c.points:m.or.ix===_||_==="ADBE Vector Star Outer Radius"?c.outerRadius:m.os.ix===_?c.outerRoundness:m.ir&&(m.ir.ix===_||_==="ADBE Vector Star Inner Radius")?c.innerRadius:m.is&&m.is.ix===_?c.innerRoundness:null}var x=propertyGroupFactory(c,y),v=g.sh.ty==="tm"?g.sh.prop:g.sh;return c.propertyIndex=m.ix,v.or.setGroupProperty(PropertyInterface("Outer Radius",x)),v.os.setGroupProperty(PropertyInterface("Outer Roundness",x)),v.pt.setGroupProperty(PropertyInterface("Points",x)),v.p.setGroupProperty(PropertyInterface("Position",x)),v.r.setGroupProperty(PropertyInterface("Rotation",x)),m.ir&&(v.ir.setGroupProperty(PropertyInterface("Inner Radius",x)),v.is.setGroupProperty(PropertyInterface("Inner Roundness",x))),Object.defineProperties(c,{position:{get:ExpressionPropertyInterface(v.p)},rotation:{get:ExpressionPropertyInterface(v.r)},points:{get:ExpressionPropertyInterface(v.pt)},outerRadius:{get:ExpressionPropertyInterface(v.or)},outerRoundness:{get:ExpressionPropertyInterface(v.os)},innerRadius:{get:ExpressionPropertyInterface(v.ir)},innerRoundness:{get:ExpressionPropertyInterface(v.is)},_name:{value:m.nm}}),c.mn=m.mn,c}function d(m,g,y){function c(_){return m.p.ix===_?c.position:m.r.ix===_?c.roundness:m.s.ix===_||_==="Size"||_==="ADBE Vector Rect Size"?c.size:null}var x=propertyGroupFactory(c,y),v=g.sh.ty==="tm"?g.sh.prop:g.sh;return c.propertyIndex=m.ix,v.p.setGroupProperty(PropertyInterface("Position",x)),v.s.setGroupProperty(PropertyInterface("Size",x)),v.r.setGroupProperty(PropertyInterface("Rotation",x)),Object.defineProperties(c,{position:{get:ExpressionPropertyInterface(v.p)},roundness:{get:ExpressionPropertyInterface(v.r)},size:{get:ExpressionPropertyInterface(v.s)},_name:{value:m.nm}}),c.mn=m.mn,c}function f(m,g,y){function c(_){return m.r.ix===_||_==="Round Corners 1"?c.radius:null}var x=propertyGroupFactory(c,y),v=g;return c.propertyIndex=m.ix,v.rd.setGroupProperty(PropertyInterface("Radius",x)),Object.defineProperties(c,{radius:{get:ExpressionPropertyInterface(v.rd)},_name:{value:m.nm}}),c.mn=m.mn,c}function p(m,g,y){function c(_){return m.c.ix===_||_==="Copies"?c.copies:m.o.ix===_||_==="Offset"?c.offset:null}var x=propertyGroupFactory(c,y),v=g;return c.propertyIndex=m.ix,v.c.setGroupProperty(PropertyInterface("Copies",x)),v.o.setGroupProperty(PropertyInterface("Offset",x)),Object.defineProperties(c,{copies:{get:ExpressionPropertyInterface(v.c)},offset:{get:ExpressionPropertyInterface(v.o)},_name:{value:m.nm}}),c.mn=m.mn,c}return function(m,g,y){var c;function x(_){if(typeof _=="number")return _=_===void 0?1:_,_===0?y:c[_-1];for(var b=0,M=c.length;b<M;){if(c[b]._name===_)return c[b];b+=1}return null}function v(){return y}return x.propertyGroup=propertyGroupFactory(x,v),c=i(m,g,x.propertyGroup),x.numProperties=c.length,x._name="Contents",x}})(),TextExpressionInterface=(function(){return function(i){var e;function t(n){return n==="ADBE Text Document"?t.sourceText:null}return Object.defineProperty(t,"sourceText",{get:function(){i.textProperty.getValue();var r=i.textProperty.currentData.t;return(!e||r!==e.value)&&(e=new String(r),e.value=r||new String(r),Object.defineProperty(e,"style",{get:function(){return{fillColor:i.textProperty.currentData.fc}}})),e}}),t}})();function _typeof(i){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(i)}var FootageInterface=(function(){var i=function(n){var r="",s=n.getFootageData();function a(){return r="",s=n.getFootageData(),o}function o(l){if(s[l])return r=l,s=s[l],_typeof(s)==="object"?o:s;var h=l.indexOf(r);if(h!==-1){var u=parseInt(l.substr(h+r.length),10);return s=s[u],_typeof(s)==="object"?o:s}return""}return a},e=function(n){function r(s){return s==="Outline"?r.outlineInterface():null}return r._name="Outline",r.outlineInterface=i(n),r};return function(t){function n(r){return r==="Data"?n.dataInterface:null}return n._name="Data",n.dataInterface=e(t),n}})(),interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(i){return interfaces[i]||null}var expressionHelpers=(function(){function i(a,o,l){o.x&&(l.k=!0,l.x=!0,l.initiateExpression=ExpressionManager.initiateExpression,l.effectsSequence.push(l.initiateExpression(a,o,l).bind(l)))}function e(a){return a*=this.elem.globalData.frameRate,a-=this.offsetTime,a!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<a?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(a,this._cachingAtTime),this._cachingAtTime.lastFrame=a),this._cachingAtTime.value}function t(a){var o=-.01,l=this.getValueAtTime(a),h=this.getValueAtTime(a+o),u=0;if(l.length){var d;for(d=0;d<l.length;d+=1)u+=Math.pow(h[d]-l[d],2);u=Math.sqrt(u)*100}else u=0;return u}function n(a){if(this.vel!==void 0)return this.vel;var o=-.001,l=this.getValueAtTime(a),h=this.getValueAtTime(a+o),u;if(l.length){u=createTypedArray("float32",l.length);var d;for(d=0;d<l.length;d+=1)u[d]=(h[d]-l[d])/o}else u=(h-l)/o;return u}function r(){return this.pv}function s(a){this.propertyGroup=a}return{searchExpressions:i,getSpeedAtTime:t,getVelocityAtTime:n,getValueAtTime:e,getStaticValueAtTime:r,setGroupProperty:s}})();function addPropertyDecorator(){function i(f,p,m){if(!this.k||!this.keyframes)return this.pv;f=f?f.toLowerCase():"";var g=this.comp.renderedFrame,y=this.keyframes,c=y[y.length-1].t;if(g<=c)return this.pv;var x,v;m?(p?x=Math.abs(c-this.elem.comp.globalData.frameRate*p):x=Math.max(0,c-this.elem.data.ip),v=c-x):((!p||p>y.length-1)&&(p=y.length-1),v=y[y.length-1-p].t,x=c-v);var _,b,M;if(f==="pingpong"){var A=Math.floor((g-v)/x);if(A%2!==0)return this.getValueAtTime((x-(g-v)%x+v)/this.comp.globalData.frameRate,0)}else if(f==="offset"){var R=this.getValueAtTime(v/this.comp.globalData.frameRate,0),w=this.getValueAtTime(c/this.comp.globalData.frameRate,0),P=this.getValueAtTime(((g-v)%x+v)/this.comp.globalData.frameRate,0),N=Math.floor((g-v)/x);if(this.pv.length){for(M=new Array(R.length),b=M.length,_=0;_<b;_+=1)M[_]=(w[_]-R[_])*N+P[_];return M}return(w-R)*N+P}else if(f==="continue"){var V=this.getValueAtTime(c/this.comp.globalData.frameRate,0),G=this.getValueAtTime((c-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(M=new Array(V.length),b=M.length,_=0;_<b;_+=1)M[_]=V[_]+(V[_]-G[_])*((g-c)/this.comp.globalData.frameRate)/5e-4;return M}return V+(V-G)*((g-c)/.001)}return this.getValueAtTime(((g-v)%x+v)/this.comp.globalData.frameRate,0)}function e(f,p,m){if(!this.k)return this.pv;f=f?f.toLowerCase():"";var g=this.comp.renderedFrame,y=this.keyframes,c=y[0].t;if(g>=c)return this.pv;var x,v;m?(p?x=Math.abs(this.elem.comp.globalData.frameRate*p):x=Math.max(0,this.elem.data.op-c),v=c+x):((!p||p>y.length-1)&&(p=y.length-1),v=y[p].t,x=v-c);var _,b,M;if(f==="pingpong"){var A=Math.floor((c-g)/x);if(A%2===0)return this.getValueAtTime(((c-g)%x+c)/this.comp.globalData.frameRate,0)}else if(f==="offset"){var R=this.getValueAtTime(c/this.comp.globalData.frameRate,0),w=this.getValueAtTime(v/this.comp.globalData.frameRate,0),P=this.getValueAtTime((x-(c-g)%x+c)/this.comp.globalData.frameRate,0),N=Math.floor((c-g)/x)+1;if(this.pv.length){for(M=new Array(R.length),b=M.length,_=0;_<b;_+=1)M[_]=P[_]-(w[_]-R[_])*N;return M}return P-(w-R)*N}else if(f==="continue"){var V=this.getValueAtTime(c/this.comp.globalData.frameRate,0),G=this.getValueAtTime((c+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(M=new Array(V.length),b=M.length,_=0;_<b;_+=1)M[_]=V[_]+(V[_]-G[_])*(c-g)/.001;return M}return V+(V-G)*(c-g)/.001}return this.getValueAtTime((x-((c-g)%x+c))/this.comp.globalData.frameRate,0)}function t(f,p){if(!this.k)return this.pv;if(f=(f||.4)*.5,p=Math.floor(p||5),p<=1)return this.pv;var m=this.comp.renderedFrame/this.comp.globalData.frameRate,g=m-f,y=m+f,c=p>1?(y-g)/(p-1):1,x=0,v=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var b;x<p;){if(b=this.getValueAtTime(g+x*c),this.pv.length)for(v=0;v<this.pv.length;v+=1)_[v]+=b[v];else _+=b;x+=1}if(this.pv.length)for(v=0;v<this.pv.length;v+=1)_[v]/=p;else _/=p;return _}function n(f){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var p=this._transformCachingAtTime.v;if(p.cloneFromProps(this.pre.props),this.appliedTransformations<1){var m=this.a.getValueAtTime(f);p.translate(-m[0]*this.a.mult,-m[1]*this.a.mult,m[2]*this.a.mult)}if(this.appliedTransformations<2){var g=this.s.getValueAtTime(f);p.scale(g[0]*this.s.mult,g[1]*this.s.mult,g[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var y=this.sk.getValueAtTime(f),c=this.sa.getValueAtTime(f);p.skewFromAxis(-y*this.sk.mult,c*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var x=this.r.getValueAtTime(f);p.rotate(-x*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var v=this.rz.getValueAtTime(f),_=this.ry.getValueAtTime(f),b=this.rx.getValueAtTime(f),M=this.or.getValueAtTime(f);p.rotateZ(-v*this.rz.mult).rotateY(_*this.ry.mult).rotateX(b*this.rx.mult).rotateZ(-M[2]*this.or.mult).rotateY(M[1]*this.or.mult).rotateX(M[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var A=this.px.getValueAtTime(f),R=this.py.getValueAtTime(f);if(this.data.p.z){var w=this.pz.getValueAtTime(f);p.translate(A*this.px.mult,R*this.py.mult,-w*this.pz.mult)}else p.translate(A*this.px.mult,R*this.py.mult,0)}else{var P=this.p.getValueAtTime(f);p.translate(P[0]*this.p.mult,P[1]*this.p.mult,-P[2]*this.p.mult)}return p}function r(){return this.v.clone(new Matrix)}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(f,p,m){var g=s(f,p,m);return g.dynamicProperties.length?g.getValueAtTime=n.bind(g):g.getValueAtTime=r.bind(g),g.setGroupProperty=expressionHelpers.setGroupProperty,g};var a=PropertyFactory.getProp;PropertyFactory.getProp=function(f,p,m,g,y){var c=a(f,p,m,g,y);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=i,c.loopIn=e,c.smooth=t,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=p.a===1?p.k.length:0,c.propertyIndex=p.ix;var x=0;return m!==0&&(x=createTypedArray("float32",p.a===1?p.k[0].s.length:p.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:x},expressionHelpers.searchExpressions(f,p,c),c.k&&y.addDynamicProperty(c),c};function o(f){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),f*=this.elem.globalData.frameRate,f-=this.offsetTime,f!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<f?this._caching.lastIndex:0,this._cachingAtTime.lastTime=f,this.interpolateShape(f,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue}var l=ShapePropertyFactory.getConstructorFunction(),h=ShapePropertyFactory.getKeyframedConstructorFunction();function u(){}u.prototype={vertices:function(p,m){this.k&&this.getValue();var g=this.v;m!==void 0&&(g=this.getValueAtTime(m,0));var y,c=g._length,x=g[p],v=g.v,_=createSizedArray(c);for(y=0;y<c;y+=1)p==="i"||p==="o"?_[y]=[x[y][0]-v[y][0],x[y][1]-v[y][1]]:_[y]=[x[y][0],x[y][1]];return _},points:function(p){return this.vertices("v",p)},inTangents:function(p){return this.vertices("i",p)},outTangents:function(p){return this.vertices("o",p)},isClosed:function(){return this.v.c},pointOnPath:function(p,m){var g=this.v;m!==void 0&&(g=this.getValueAtTime(m,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(g));for(var y=this._segmentsLength,c=y.lengths,x=y.totalLength*p,v=0,_=c.length,b=0,M;v<_;){if(b+c[v].addedLength>x){var A=v,R=g.c&&v===_-1?0:v+1,w=(x-b)/c[v].addedLength;M=bez.getPointInSegment(g.v[A],g.v[R],g.o[A],g.i[R],w,c[v]);break}else b+=c[v].addedLength;v+=1}return M||(M=g.c?[g.v[0][0],g.v[0][1]]:[g.v[g._length-1][0],g.v[g._length-1][1]]),M},vectorOnPath:function(p,m,g){p==1?p=this.v.c:p==0&&(p=.999);var y=this.pointOnPath(p,m),c=this.pointOnPath(p+.001,m),x=c[0]-y[0],v=c[1]-y[1],_=Math.sqrt(Math.pow(x,2)+Math.pow(v,2));if(_===0)return[0,0];var b=g==="tangent"?[x/_,v/_]:[-v/_,x/_];return b},tangentOnPath:function(p,m){return this.vectorOnPath(p,m,"tangent")},normalOnPath:function(p,m){return this.vectorOnPath(p,m,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([u],l),extendPrototype([u],h),h.prototype.getValueAtTime=o,h.prototype.initiateExpression=ExpressionManager.initiateExpression;var d=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(f,p,m,g,y){var c=d(f,p,m,g,y);return c.propertyIndex=p.ix,c.lock=!1,m===3?expressionHelpers.searchExpressions(f,p.pt,c):m===4&&expressionHelpers.searchExpressions(f,p.ks,c),c.k&&f.addDynamicProperty(c),c}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function i(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,t){var n=this.calculateExpression(t);if(e.t!==n){var r={};return this.copyData(r,e),r.t=n.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=i}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function i(e,t){var n=createNS("feMerge");n.setAttribute("result",e);var r,s;for(s=0;s<t.length;s+=1)r=createNS("feMergeNode"),r.setAttribute("in",t[s]),n.appendChild(r),n.appendChild(r);return n}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(i,e,t,n,r){this.filterManager=e;var s=createNS("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=s,s.setAttribute("result",n+"_tint_1"),i.appendChild(s),s=createNS("feColorMatrix"),s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result",n+"_tint_2"),i.appendChild(s),this.matrixFilter=s;var a=this.createMergeNode(n,[r,n+"_tint_1",n+"_tint_2"]);i.appendChild(a)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,t=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",t[0]-e[0]+" 0 0 0 "+e[0]+" "+(t[1]-e[1])+" 0 0 0 "+e[1]+" "+(t[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 1 0")}};function SVGFillFilter(i,e,t,n){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result",n),i.appendChild(r),this.matrixFilter=r}SVGFillFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,t=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+t+" 0")}};function SVGStrokeEffect(i,e,t){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}SVGStrokeEffect.prototype.initialize=function(){var i=this.elem.layerElement.children||this.elem.layerElement.childNodes,e,t,n,r;for(this.filterManager.effectElements[1].p.v===1?(r=this.elem.maskManager.masksProperties.length,n=0):(n=this.filterManager.effectElements[0].p.v-1,r=n+1),t=createNS("g"),t.setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1),n;n<r;n+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:n});if(this.filterManager.effectElements[10].p.v===3){var s=createNS("mask"),a=createElementID();s.setAttribute("id",a),s.setAttribute("mask-type","alpha"),s.appendChild(t),this.elem.globalData.defs.appendChild(s);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+a+")");i[0];)o.appendChild(i[0]);this.elem.layerElement.appendChild(o),this.masker=s,t.setAttribute("stroke","#fff")}else if(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2){if(this.filterManager.effectElements[10].p.v===2)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(i){this.initialized||this.initialize();var e,t=this.paths.length,n,r;for(e=0;e<t;e+=1)if(this.paths[e].m!==-1&&(n=this.elem.maskManager.viewData[this.paths[e].m],r=this.paths[e].p,(i||this.filterManager._mdf||n.prop._mdf)&&r.setAttribute("d",n.lastPath),i||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||n.prop._mdf)){var s;if(this.filterManager.effectElements[7].p.v!==0||this.filterManager.effectElements[8].p.v!==100){var a=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)*.01,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)*.01,l=r.getTotalLength();s="0 0 0 "+l*a+" ";var h=l*(o-a),u=1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01,d=Math.floor(h/u),f;for(f=0;f<d;f+=1)s+="1 "+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01+" ";s+="0 "+l*10+" 0 0"}else s="1 "+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01;r.setAttribute("stroke-dasharray",s)}if((i||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",this.filterManager.effectElements[4].p.v*2),(i||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2)&&(i||this.filterManager.effectElements[3].p._mdf)){var p=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(p[0]*255)+","+bmFloor(p[1]*255)+","+bmFloor(p[2]*255)+")")}};function SVGTritoneFilter(i,e,t,n){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),i.appendChild(r);var s=createNS("feComponentTransfer");s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),this.matrixFilter=s;var a=createNS("feFuncR");a.setAttribute("type","table"),s.appendChild(a),this.feFuncR=a;var o=createNS("feFuncG");o.setAttribute("type","table"),s.appendChild(o),this.feFuncG=o;var l=createNS("feFuncB");l.setAttribute("type","table"),s.appendChild(l),this.feFuncB=l,i.appendChild(s)}SVGTritoneFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,t=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,r=n[0]+" "+t[0]+" "+e[0],s=n[1]+" "+t[1]+" "+e[1],a=n[2]+" "+t[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",r),this.feFuncG.setAttribute("tableValues",s),this.feFuncB.setAttribute("tableValues",a)}};function SVGProLevelsFilter(i,e,t,n){this.filterManager=e;var r=this.filterManager.effectElements,s=createNS("feComponentTransfer");(r[10].p.k||r[10].p.v!==0||r[11].p.k||r[11].p.v!==1||r[12].p.k||r[12].p.v!==1||r[13].p.k||r[13].p.v!==0||r[14].p.k||r[14].p.v!==1)&&(this.feFuncR=this.createFeFunc("feFuncR",s)),(r[17].p.k||r[17].p.v!==0||r[18].p.k||r[18].p.v!==1||r[19].p.k||r[19].p.v!==1||r[20].p.k||r[20].p.v!==0||r[21].p.k||r[21].p.v!==1)&&(this.feFuncG=this.createFeFunc("feFuncG",s)),(r[24].p.k||r[24].p.v!==0||r[25].p.k||r[25].p.v!==1||r[26].p.k||r[26].p.v!==1||r[27].p.k||r[27].p.v!==0||r[28].p.k||r[28].p.v!==1)&&(this.feFuncB=this.createFeFunc("feFuncB",s)),(r[31].p.k||r[31].p.v!==0||r[32].p.k||r[32].p.v!==1||r[33].p.k||r[33].p.v!==1||r[34].p.k||r[34].p.v!==0||r[35].p.k||r[35].p.v!==1)&&(this.feFuncA=this.createFeFunc("feFuncA",s)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(s.setAttribute("color-interpolation-filters","sRGB"),i.appendChild(s)),(r[3].p.k||r[3].p.v!==0||r[4].p.k||r[4].p.v!==1||r[5].p.k||r[5].p.v!==1||r[6].p.k||r[6].p.v!==0||r[7].p.k||r[7].p.v!==1)&&(s=createNS("feComponentTransfer"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),i.appendChild(s),this.feFuncRComposed=this.createFeFunc("feFuncR",s),this.feFuncGComposed=this.createFeFunc("feFuncG",s),this.feFuncBComposed=this.createFeFunc("feFuncB",s))}SVGProLevelsFilter.prototype.createFeFunc=function(i,e){var t=createNS(i);return t.setAttribute("type","table"),e.appendChild(t),t},SVGProLevelsFilter.prototype.getTableValue=function(i,e,t,n,r){for(var s=0,a=256,o,l=Math.min(i,e),h=Math.max(i,e),u=Array.call(null,{length:a}),d,f=0,p=r-n,m=e-i;s<=256;)o=s/256,o<=l?d=m<0?r:n:o>=h?d=m<0?n:r:d=n+p*Math.pow((o-i)/m,1/t),u[f]=d,f+=1,s+=256/(a-1);return u.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e,t=this.filterManager.effectElements;this.feFuncRComposed&&(i||t[3].p._mdf||t[4].p._mdf||t[5].p._mdf||t[6].p._mdf||t[7].p._mdf)&&(e=this.getTableValue(t[3].p.v,t[4].p.v,t[5].p.v,t[6].p.v,t[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(i||t[10].p._mdf||t[11].p._mdf||t[12].p._mdf||t[13].p._mdf||t[14].p._mdf)&&(e=this.getTableValue(t[10].p.v,t[11].p.v,t[12].p.v,t[13].p.v,t[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(i||t[17].p._mdf||t[18].p._mdf||t[19].p._mdf||t[20].p._mdf||t[21].p._mdf)&&(e=this.getTableValue(t[17].p.v,t[18].p.v,t[19].p.v,t[20].p.v,t[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(i||t[24].p._mdf||t[25].p._mdf||t[26].p._mdf||t[27].p._mdf||t[28].p._mdf)&&(e=this.getTableValue(t[24].p.v,t[25].p.v,t[26].p.v,t[27].p.v,t[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(i||t[31].p._mdf||t[32].p._mdf||t[33].p._mdf||t[34].p._mdf||t[35].p._mdf)&&(e=this.getTableValue(t[31].p.v,t[32].p.v,t[33].p.v,t[34].p.v,t[35].p.v),this.feFuncA.setAttribute("tableValues",e))}};function SVGDropShadowEffect(i,e,t,n,r){var s=e.container.globalData.renderConfig.filterSize,a=e.data.fs||s;i.setAttribute("x",a.x||s.x),i.setAttribute("y",a.y||s.y),i.setAttribute("width",a.width||s.width),i.setAttribute("height",a.height||s.height),this.filterManager=e;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",n+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,i.appendChild(o);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,i.appendChild(l);var h=createNS("feFlood");h.setAttribute("flood-color","#00ff00"),h.setAttribute("flood-opacity","1"),h.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=h,i.appendChild(h);var u=createNS("feComposite");u.setAttribute("in",n+"_drop_shadow_3"),u.setAttribute("in2",n+"_drop_shadow_2"),u.setAttribute("operator","in"),u.setAttribute("result",n+"_drop_shadow_4"),i.appendChild(u);var d=this.createMergeNode(n,[n+"_drop_shadow_4",r]);i.appendChild(d)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){if((i||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),i||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)))}if((i||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),i||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var t=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=t*Math.cos(n),s=t*Math.sin(n);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",s)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(i,e,t){this.initialized=!1,this.filterManager=e,this.filterElem=i,this.elem=t,t.matteElement=createNS("g"),t.matteElement.appendChild(t.layerElement),t.matteElement.appendChild(t.transformedElement),t.baseElement=t.matteElement}SVGMatte3Effect.prototype.findSymbol=function(i){for(var e=0,t=_svgMatteSymbols.length;e<t;){if(_svgMatteSymbols[e]===i)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(i,e){var t=i.layerElement.parentNode;if(t){for(var n=t.children,r=0,s=n.length;r<s&&n[r]!==i.layerElement;)r+=1;var a;r<=s-2&&(a=n[r+1]);var o=createNS("use");o.setAttribute("href","#"+e),a?t.insertBefore(o,a):t.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(i,e){if(!this.findSymbol(e)){var t=createElementID(),n=createNS("mask");n.setAttribute("id",e.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var r=i.globalData.defs;r.appendChild(n);var s=createNS("symbol");s.setAttribute("id",t),this.replaceInParent(e,t),s.appendChild(e.layerElement),r.appendChild(s);var a=createNS("use");a.setAttribute("href","#"+t),n.appendChild(a),e.data.hd=!1,e.show()}i.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var i=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,t=0,n=e.length;t<n;)e[t]&&e[t].data.ind===i&&this.setElementAsMask(this.elem,e[t]),t+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()};function SVGGaussianBlurEffect(i,e,t,n){i.setAttribute("x","-100%"),i.setAttribute("y","-100%"),i.setAttribute("width","300%"),i.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");r.setAttribute("result",n),i.appendChild(r),this.feGaussianBlur=r}SVGGaussianBlurEffect.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=.3,t=this.filterManager.effectElements[0].p.v*e,n=this.filterManager.effectElements[1].p.v,r=n==3?0:t,s=n==2?0:t;this.feGaussianBlur.setAttribute("stdDeviation",r+" "+s);var a=this.filterManager.effectElements[2].p.v==1?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}};function TransformEffect(){}TransformEffect.prototype.init=function(i){this.effectsManager=i,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(i){if(this._opMdf=!1,this._mdf=!1,i||this.effectsManager._mdf){var e=this.effectsManager.effectElements,t=e[0].p.v,n=e[1].p.v,r=e[2].p.v===1,s=e[3].p.v,a=r?s:e[4].p.v,o=e[5].p.v,l=e[6].p.v,h=e[7].p.v;this.matrix.reset(),this.matrix.translate(-t[0],-t[1],t[2]),this.matrix.scale(a*.01,s*.01,1),this.matrix.rotate(-h*degToRads),this.matrix.skewFromAxis(-o*degToRads,(l+90)*degToRads),this.matrix.translate(n[0],n[1],0),this._mdf=!0,this.opacity!==e[8].p.v&&(this.opacity=e[8].p.v,this._opMdf=!0)}};function SVGTransformEffect(i,e){this.init(e)}extendPrototype([TransformEffect],SVGTransformEffect);function CVTransformEffect(i){this.init(i)}return extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie}))})(lottie$2,lottie$2.exports)),lottie$2.exports}var lottieExports=requireLottie();const lottie=getDefaultExportFromCjs(lottieExports);class VesselPlayer{constructor(e){this.active="a",this.animation=null,this.activeVideo=null,this.mediaType="lottie",this.crossfadeMs=300,this.idlePayload=null,this.autoIdleHandler=null,this.currentClipUrl="",this.currentVisualTier="",this.isPlaying=!1,this.pendingPlay=null,this.currentPlay=Promise.resolve(),this.stage=e,this.halo=e.querySelector(".vessel-halo"),this.layerA=e.querySelector(".vessel-layer-a"),this.layerB=e.querySelector(".vessel-layer-b"),this.layerA.style.opacity="1",this.layerB.style.opacity="0"}setConfig(e){this.crossfadeMs=e.crossfadeMs,this.mediaType=e.rendererType==="webm"?"webm":"lottie",this.stage.style.setProperty("--crossfade-ms",`${e.crossfadeMs}ms`)}setIdlePayload(e){this.idlePayload=e}setAutoIdleHandler(e){this.autoIdleHandler=e}play(e,t){return this.isPlaying?(this.pendingPlay={payload:e,config:t},this.currentPlay):(this.isPlaying=!0,this.currentPlay=this.playInternal(e,t).finally(()=>{if(this.isPlaying=!1,this.pendingPlay){const n=this.pendingPlay;this.pendingPlay=null,this.play(n.payload,n.config)}}),this.currentPlay)}async playInternal(e,t){const n=e.broadcast.visual_state??e.broadcast.state;n!==this.currentVisualTier&&(this.currentVisualTier=n,this.crossfadeMs=t.crossfadeMs,await this.playClip(e.clipUrl,{loop:e.loop,crossfadeMs:t.crossfadeMs,returnToIdle:e.returnToIdle,onComplete:e.returnToIdle?()=>this.handleAutoIdle():void 0}),this.pulseHalo())}async handleAutoIdle(){if(this.autoIdleHandler){await this.autoIdleHandler();return}await this.playIdleFallback()}async playIdleFallback(){this.idlePayload&&await this.playClip(this.idlePayload.clipUrl,{loop:this.idlePayload.loop,crossfadeMs:this.crossfadeMs,returnToIdle:!1})}async playClip(e,t,n=0){return this.mediaType==="webm"?this.playWebMClip(e,t,n):this.playLottieClip(e,t,n)}async playLottieClip(e,t,n=0){try{const r=await fetch(e);if(!r.ok)throw new Error(`clip fetch failed: ${r.status}`);const s=await r.json(),a=this.active==="a"?this.layerB:this.layerA,o=this.active==="a"?this.layerA:this.layerB;a.replaceChildren();const l=lottie.loadAnimation({container:a,renderer:"canvas",loop:t.loop,autoplay:!0,animationData:s,rendererSettings:{clearCanvas:!0,progressiveLoad:!1}});await this.waitForLottieReady(l,e),t.onComplete&&!t.loop&&this.scheduleOneShotComplete(l,s,t.onComplete),await this.crossfade(o,a,t.crossfadeMs),this.animation?.destroy(),o.replaceChildren(),this.animation=l,this.active=this.active==="a"?"b":"a",this.currentClipUrl=e,await this.ensureLottiePainted(l,t.loop)}catch(r){if(window.eidolaShrine.log(String(r)),n<1){await this.playLottieClip(e,t,n+1);return}this.idlePayload&&e!==this.idlePayload.clipUrl&&await this.playIdleFallback()}}async playWebMClip(e,t,n=0){try{const r=this.active==="a"?this.layerB:this.layerA,s=this.active==="a"?this.layerA:this.layerB;r.replaceChildren();const a=document.createElement("video");a.muted=!0,a.playsInline=!0,a.loop=t.loop,a.preload="auto",a.style.width="100%",a.style.height="100%",a.style.objectFit="contain",r.appendChild(a),await this.waitForWebMReady(a,e),await a.play(),t.onComplete&&!t.loop&&a.addEventListener("ended",()=>{t.onComplete?.()},{once:!0}),await this.crossfade(s,r,t.crossfadeMs),this.animation?.destroy(),this.animation=null,this.activeVideo?.pause(),s.replaceChildren(),this.activeVideo=a,this.active=this.active==="a"?"b":"a",this.currentClipUrl=e}catch(r){if(window.eidolaShrine.log(String(r)),n<1){await this.playWebMClip(e,t,n+1);return}this.idlePayload&&e!==this.idlePayload.clipUrl&&await this.playIdleFallback()}}waitForWebMReady(e,t){return new Promise((n,r)=>{let s=!1;const a=d=>{s||(s=!0,u(),d?n():r(new Error(`webm load failed: ${t}`)))},o=window.setTimeout(()=>a(!1),8e3),l=()=>a(!0),h=()=>a(!1),u=()=>{window.clearTimeout(o),e.removeEventListener("canplay",l),e.removeEventListener("loadeddata",l),e.removeEventListener("error",h)};e.addEventListener("canplay",l),e.addEventListener("loadeddata",l),e.addEventListener("error",h),e.src=t,e.load()})}scheduleOneShotComplete(e,t,n){let r=!1;const s=()=>{r||(r=!0,n())};e.addEventListener("complete",s);const a=t.op??0,o=t.fr??15;a>0&&o>0&&window.setTimeout(s,Math.ceil(a/o*1e3)+250)}waitForLottieReady(e,t){return new Promise((n,r)=>{let s=!1;const a=d=>{s||(s=!0,u(),d?n():r(new Error(`lottie data_failed: ${t}`)))},o=window.setTimeout(()=>a(!1),5e3),l=()=>a(!0),h=()=>a(!1),u=()=>{window.clearTimeout(o),e.removeEventListener("DOMLoaded",l),e.removeEventListener("config_ready",l),e.removeEventListener("data_failed",h)};e.addEventListener("DOMLoaded",l),e.addEventListener("config_ready",l),e.addEventListener("data_failed",h)}).then(()=>{e.resize()})}async ensureLottiePainted(e,t=!1){e.goToAndPlay(0,!0);for(let n=0;n<3;n+=1)e.resize(),await new Promise(r=>requestAnimationFrame(()=>r()));t&&e.play()}crossfade(e,t,n){return t.style.opacity="0",e.style.opacity="1",new Promise(r=>{const s=performance.now(),a=o=>{const l=Math.min(1,(o-s)/n);t.style.opacity=String(l),e.style.opacity=String(1-l),l<1?requestAnimationFrame(a):r()};requestAnimationFrame(a)})}pulseHalo(){this.halo.classList.remove("halo-pulse"),this.halo.offsetWidth,this.halo.classList.add("halo-pulse")}}function isGatedApprovalTool(i){return i?i==="Shell"||i==="CallMcpTool"?!0:i.startsWith("mcp__")||i.startsWith("mcp_"):!1}function isTurnEndState(i,e){return i==="success"?!0:i==="idle"&&e}function shouldArmApprovalIdleTimer(i,e,t){return!i||e==="waiting"?!1:e==="working"&&isGatedApprovalTool(t)}function shouldLoopExpression(i,e){return!0}function buildClipUrl(i,e){return`eidola://vessel/${encodeURIComponent(i)}/${encodeURIComponent(e)}`}class ApprovalIdleController{constructor(e){this.config=null,this.timer=null,this.inTurn=!1,this.engramId="camina-drummer",this.onWaiting=e}setConfig(e){this.config=e}setEngramId(e){this.engramId=e}disarm(){this.clearTimer(),this.inTurn=!1}onState(e){if(e.source==="approval-idle")return;this.clearTimer();const{state:t}=e.broadcast,n=e.broadcast.tool;if(isTurnEndState(t,this.inTurn)){this.inTurn=!1;return}!this.inTurn&&t==="thinking"&&(this.inTurn=!0),!(!this.inTurn||!this.config)&&shouldArmApprovalIdleTimer(this.inTurn,t,n)&&this.armTimer()}armTimer(){const e=this.config;e&&(this.clearTimer(),this.timer=setTimeout(()=>{if(this.timer=null,!this.inTurn)return;const t=buildApprovalIdlePayload(e,this.engramId);this.onWaiting(t)},e.approvalIdleMs))}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}}function buildApprovalIdlePayload(i,e,t=Date.now()){const n="waiting.json";return{broadcast:{protocol_version:"1.0",ts:t,state:"waiting",engram_id:e,expression:n},clipUrl:buildClipUrl(i.pack,n),loop:shouldLoopExpression("waiting",i.idleLoops),returnToIdle:!1,source:"approval-idle"}}const SUCCESS_HOLD_CANCEL_STATES=new Set(["thinking","working","searching","writing","waiting","responding","error","attention"]);class SuccessHoldController{constructor(e){this.config=null,this.timer=null,this.holding=!1,this.onRelease=e}setConfig(e){this.config=e}disarm(){this.holding=!1,this.clearTimer()}filter(e){if(e.source!=="socket")return e;const t=e.broadcast.state;return SUCCESS_HOLD_CANCEL_STATES.has(t)?(this.disarm(),e):t==="success"?(this.holding=!0,this.armTimer(),e):t==="idle"&&this.holding?null:e}armTimer(){this.clearTimer();const e=this.config?.successHoldMs??3e3;this.timer=setTimeout(()=>{this.timer=null,this.holding&&(this.holding=!1,this.onRelease())},e)}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}}const REVISION="176",CullFaceNone=0,CullFaceBack=1,CullFaceFront=2,PCFShadowMap=1,PCFSoftShadowMap=2,VSMShadowMap=3,FrontSide=0,BackSide=1,DoubleSide=2,NoBlending=0,NormalBlending=1,AdditiveBlending=2,SubtractiveBlending=3,MultiplyBlending=4,CustomBlending=5,AddEquation=100,SubtractEquation=101,ReverseSubtractEquation=102,MinEquation=103,MaxEquation=104,ZeroFactor=200,OneFactor=201,SrcColorFactor=202,OneMinusSrcColorFactor=203,SrcAlphaFactor=204,OneMinusSrcAlphaFactor=205,DstAlphaFactor=206,OneMinusDstAlphaFactor=207,DstColorFactor=208,OneMinusDstColorFactor=209,SrcAlphaSaturateFactor=210,ConstantColorFactor=211,OneMinusConstantColorFactor=212,ConstantAlphaFactor=213,OneMinusConstantAlphaFactor=214,NeverDepth=0,AlwaysDepth=1,LessDepth=2,LessEqualDepth=3,EqualDepth=4,GreaterEqualDepth=5,GreaterDepth=6,NotEqualDepth=7,MultiplyOperation=0,MixOperation=1,AddOperation=2,NoToneMapping=0,LinearToneMapping=1,ReinhardToneMapping=2,CineonToneMapping=3,ACESFilmicToneMapping=4,CustomToneMapping=5,AgXToneMapping=6,NeutralToneMapping=7,UVMapping=300,CubeReflectionMapping=301,CubeRefractionMapping=302,EquirectangularReflectionMapping=303,EquirectangularRefractionMapping=304,CubeUVReflectionMapping=306,RepeatWrapping=1e3,ClampToEdgeWrapping=1001,MirroredRepeatWrapping=1002,NearestFilter=1003,NearestMipmapNearestFilter=1004,NearestMipmapLinearFilter=1005,LinearFilter=1006,LinearMipmapNearestFilter=1007,LinearMipmapLinearFilter=1008,UnsignedByteType=1009,ByteType=1010,ShortType=1011,UnsignedShortType=1012,IntType=1013,UnsignedIntType=1014,FloatType=1015,HalfFloatType=1016,UnsignedShort4444Type=1017,UnsignedShort5551Type=1018,UnsignedInt248Type=1020,UnsignedInt5999Type=35902,AlphaFormat=1021,RGBFormat=1022,RGBAFormat=1023,DepthFormat=1026,DepthStencilFormat=1027,RedFormat=1028,RedIntegerFormat=1029,RGFormat=1030,RGIntegerFormat=1031,RGBAIntegerFormat=1033,RGB_S3TC_DXT1_Format=33776,RGBA_S3TC_DXT1_Format=33777,RGBA_S3TC_DXT3_Format=33778,RGBA_S3TC_DXT5_Format=33779,RGB_PVRTC_4BPPV1_Format=35840,RGB_PVRTC_2BPPV1_Format=35841,RGBA_PVRTC_4BPPV1_Format=35842,RGBA_PVRTC_2BPPV1_Format=35843,RGB_ETC1_Format=36196,RGB_ETC2_Format=37492,RGBA_ETC2_EAC_Format=37496,RGBA_ASTC_4x4_Format=37808,RGBA_ASTC_5x4_Format=37809,RGBA_ASTC_5x5_Format=37810,RGBA_ASTC_6x5_Format=37811,RGBA_ASTC_6x6_Format=37812,RGBA_ASTC_8x5_Format=37813,RGBA_ASTC_8x6_Format=37814,RGBA_ASTC_8x8_Format=37815,RGBA_ASTC_10x5_Format=37816,RGBA_ASTC_10x6_Format=37817,RGBA_ASTC_10x8_Format=37818,RGBA_ASTC_10x10_Format=37819,RGBA_ASTC_12x10_Format=37820,RGBA_ASTC_12x12_Format=37821,RGBA_BPTC_Format=36492,RGB_BPTC_SIGNED_Format=36494,RGB_BPTC_UNSIGNED_Format=36495,RED_RGTC1_Format=36283,SIGNED_RED_RGTC1_Format=36284,RED_GREEN_RGTC2_Format=36285,SIGNED_RED_GREEN_RGTC2_Format=36286,BasicDepthPacking=3200,RGBADepthPacking=3201,TangentSpaceNormalMap=0,ObjectSpaceNormalMap=1,NoColorSpace="",SRGBColorSpace="srgb",LinearSRGBColorSpace="srgb-linear",LinearTransfer="linear",SRGBTransfer="srgb",KeepStencilOp=7680,AlwaysStencilFunc=519,NeverCompare=512,LessCompare=513,EqualCompare=514,LessEqualCompare=515,GreaterCompare=516,NotEqualCompare=517,GreaterEqualCompare=518,AlwaysCompare=519,StaticDrawUsage=35044,GLSL3="300 es",WebGLCoordinateSystem=2e3,WebGPUCoordinateSystem=2001;class EventDispatcher{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const _lut=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],DEG2RAD=Math.PI/180,RAD2DEG=180/Math.PI;function generateUUID(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(_lut[i&255]+_lut[i>>8&255]+_lut[i>>16&255]+_lut[i>>24&255]+"-"+_lut[e&255]+_lut[e>>8&255]+"-"+_lut[e>>16&15|64]+_lut[e>>24&255]+"-"+_lut[t&63|128]+_lut[t>>8&255]+"-"+_lut[t>>16&255]+_lut[t>>24&255]+_lut[n&255]+_lut[n>>8&255]+_lut[n>>16&255]+_lut[n>>24&255]).toLowerCase()}function clamp(i,e,t){return Math.max(e,Math.min(t,i))}function euclideanModulo(i,e){return(i%e+e)%e}function lerp(i,e,t){return(1-t)*i+t*e}function denormalize(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function normalize(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*r+e.x,this.y=s*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(e,t,n,r,s,a,o,l,h){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,h)}set(e,t,n,r,s,a,o,l,h){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],h=n[1],u=n[4],d=n[7],f=n[2],p=n[5],m=n[8],g=r[0],y=r[3],c=r[6],x=r[1],v=r[4],_=r[7],b=r[2],M=r[5],A=r[8];return s[0]=a*g+o*x+l*b,s[3]=a*y+o*v+l*M,s[6]=a*c+o*_+l*A,s[1]=h*g+u*x+d*b,s[4]=h*y+u*v+d*M,s[7]=h*c+u*_+d*A,s[2]=f*g+p*x+m*b,s[5]=f*y+p*v+m*M,s[8]=f*c+p*_+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],h=e[7],u=e[8];return t*a*u-t*o*h-n*s*u+n*o*l+r*s*h-r*a*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],h=e[7],u=e[8],d=u*a-o*h,f=o*l-u*s,p=h*s-a*l,m=t*d+n*f+r*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return e[0]=d*g,e[1]=(r*h-u*n)*g,e[2]=(o*n-r*a)*g,e[3]=f*g,e[4]=(u*t-r*l)*g,e[5]=(r*s-o*t)*g,e[6]=p*g,e[7]=(n*l-h*t)*g,e[8]=(a*t-n*s)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,a,o){const l=Math.cos(s),h=Math.sin(s);return this.set(n*l,n*h,-n*(l*a+h*o)+a+e,-r*h,r*l,-r*(-h*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(_m3.makeScale(e,t)),this}rotate(e){return this.premultiply(_m3.makeRotation(-e)),this}translate(e,t){return this.premultiply(_m3.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const _m3=new Matrix3;function arrayNeedsUint32(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function createElementNS(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function createCanvasElement(){const i=createElementNS("canvas");return i.style.display="block",i}const _cache={};function warnOnce(i){i in _cache||(_cache[i]=!0,console.warn(i))}function probeAsync(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function toNormalizedProjectionMatrix(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function toReversedProjectionMatrix(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const LINEAR_REC709_TO_XYZ=new Matrix3().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),XYZ_TO_LINEAR_REC709=new Matrix3().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function createColorManagement(){const i={enabled:!0,workingColorSpace:LinearSRGBColorSpace,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===SRGBTransfer&&(r.r=SRGBToLinear(r.r),r.g=SRGBToLinear(r.g),r.b=SRGBToLinear(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===SRGBTransfer&&(r.r=LinearToSRGB(r.r),r.g=LinearToSRGB(r.g),r.b=LinearToSRGB(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===NoColorSpace?LinearTransfer:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[LinearSRGBColorSpace]:{primaries:e,whitePoint:n,transfer:LinearTransfer,toXYZ:LINEAR_REC709_TO_XYZ,fromXYZ:XYZ_TO_LINEAR_REC709,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:SRGBColorSpace},outputColorSpaceConfig:{drawingBufferColorSpace:SRGBColorSpace}},[SRGBColorSpace]:{primaries:e,whitePoint:n,transfer:SRGBTransfer,toXYZ:LINEAR_REC709_TO_XYZ,fromXYZ:XYZ_TO_LINEAR_REC709,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:SRGBColorSpace}}}),i}const ColorManagement=createColorManagement();function SRGBToLinear(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function LinearToSRGB(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let _canvas;class ImageUtils{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{_canvas===void 0&&(_canvas=createElementNS("canvas")),_canvas.width=e.width,_canvas.height=e.height;const r=_canvas.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=_canvas}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=createElementNS("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=SRGBToLinear(s[a]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(SRGBToLinear(t[n]/255)*255):t[n]=SRGBToLinear(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let _sourceId=0;class Source{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:_sourceId++}),this.uuid=generateUUID(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(serializeImage(r[a].image)):s.push(serializeImage(r[a]))}else s=serializeImage(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function serializeImage(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?ImageUtils.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let _textureId=0;class Texture extends EventDispatcher{constructor(e=Texture.DEFAULT_IMAGE,t=Texture.DEFAULT_MAPPING,n=ClampToEdgeWrapping,r=ClampToEdgeWrapping,s=LinearFilter,a=LinearMipmapLinearFilter,o=RGBAFormat,l=UnsignedByteType,h=Texture.DEFAULT_ANISOTROPY,u=NoColorSpace){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:_textureId++}),this.uuid=generateUUID(),this.name="",this.source=new Source(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==UVMapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Texture.DEFAULT_IMAGE=null;Texture.DEFAULT_MAPPING=UVMapping;Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(e=0,t=0,n=0,r=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,h=l[0],u=l[4],d=l[8],f=l[1],p=l[5],m=l[9],g=l[2],y=l[6],c=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-g)<.01&&Math.abs(m-y)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+g)<.1&&Math.abs(m+y)<.1&&Math.abs(h+p+c-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(h+1)/2,_=(p+1)/2,b=(c+1)/2,M=(u+f)/4,A=(d+g)/4,R=(m+y)/4;return v>_&&v>b?v<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(v),r=M/n,s=A/n):_>b?_<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(_),n=M/r,s=R/r):b<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),n=A/s,r=R/s),this.set(n,r,s,t),this}let x=Math.sqrt((y-m)*(y-m)+(d-g)*(d-g)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(y-m)/x,this.y=(d-g)/x,this.z=(f-u)/x,this.w=Math.acos((h+p+c-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this.w=clamp(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this.w=clamp(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class RenderTarget extends EventDispatcher{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth?n.depth:1,this.scissor=new Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new Vector4(0,0,e,t);const r={width:e,height:t,depth:this.depth};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:LinearFilter,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},n);const s=new Texture(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new Source(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class WebGLRenderTarget extends RenderTarget{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class DataArrayTexture extends Texture{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Data3DTexture extends Texture{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Quaternion{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,a,o){let l=n[r+0],h=n[r+1],u=n[r+2],d=n[r+3];const f=s[a+0],p=s[a+1],m=s[a+2],g=s[a+3];if(o===0){e[t+0]=l,e[t+1]=h,e[t+2]=u,e[t+3]=d;return}if(o===1){e[t+0]=f,e[t+1]=p,e[t+2]=m,e[t+3]=g;return}if(d!==g||l!==f||h!==p||u!==m){let y=1-o;const c=l*f+h*p+u*m+d*g,x=c>=0?1:-1,v=1-c*c;if(v>Number.EPSILON){const b=Math.sqrt(v),M=Math.atan2(b,c*x);y=Math.sin(y*M)/b,o=Math.sin(o*M)/b}const _=o*x;if(l=l*y+f*_,h=h*y+p*_,u=u*y+m*_,d=d*y+g*_,y===1-o){const b=1/Math.sqrt(l*l+h*h+u*u+d*d);l*=b,h*=b,u*=b,d*=b}}e[t]=l,e[t+1]=h,e[t+2]=u,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,r,s,a){const o=n[r],l=n[r+1],h=n[r+2],u=n[r+3],d=s[a],f=s[a+1],p=s[a+2],m=s[a+3];return e[t]=o*m+u*d+l*p-h*f,e[t+1]=l*m+u*f+h*d-o*p,e[t+2]=h*m+u*p+o*f-l*d,e[t+3]=u*m-o*d-l*f-h*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,h=o(n/2),u=o(r/2),d=o(s/2),f=l(n/2),p=l(r/2),m=l(s/2);switch(a){case"XYZ":this._x=f*u*d+h*p*m,this._y=h*p*d-f*u*m,this._z=h*u*m+f*p*d,this._w=h*u*d-f*p*m;break;case"YXZ":this._x=f*u*d+h*p*m,this._y=h*p*d-f*u*m,this._z=h*u*m-f*p*d,this._w=h*u*d+f*p*m;break;case"ZXY":this._x=f*u*d-h*p*m,this._y=h*p*d+f*u*m,this._z=h*u*m+f*p*d,this._w=h*u*d-f*p*m;break;case"ZYX":this._x=f*u*d-h*p*m,this._y=h*p*d+f*u*m,this._z=h*u*m-f*p*d,this._w=h*u*d+f*p*m;break;case"YZX":this._x=f*u*d+h*p*m,this._y=h*p*d+f*u*m,this._z=h*u*m-f*p*d,this._w=h*u*d-f*p*m;break;case"XZY":this._x=f*u*d-h*p*m,this._y=h*p*d-f*u*m,this._z=h*u*m+f*p*d,this._w=h*u*d+f*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],h=t[2],u=t[6],d=t[10],f=n+o+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-h)*p,this._z=(a-r)*p}else if(n>o&&n>d){const p=2*Math.sqrt(1+n-o-d);this._w=(u-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+h)/p}else if(o>d){const p=2*Math.sqrt(1+o-n-d);this._w=(s-h)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+d-n-o);this._w=(a-r)/p,this._x=(s+h)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,h=t._z,u=t._w;return this._x=n*u+a*o+r*h-s*l,this._y=r*u+a*l+s*o-n*h,this._z=s*u+a*h+n*l-r*o,this._w=a*u-n*o-r*l-s*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const p=1-t;return this._w=p*a+t*this._w,this._x=p*n+t*this._x,this._y=p*r+t*this._y,this._z=p*s+t*this._z,this.normalize(),this}const h=Math.sqrt(l),u=Math.atan2(h,o),d=Math.sin((1-t)*u)/h,f=Math.sin(t*u)/h;return this._w=a*d+this._w*f,this._x=n*d+this._x*f,this._y=r*d+this._y*f,this._z=s*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(e=0,t=0,n=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(_quaternion$4.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,h=2*(a*r-o*n),u=2*(o*t-s*r),d=2*(s*n-a*t);return this.x=t+l*h+a*d-o*u,this.y=n+l*u+o*h-s*d,this.z=r+l*d+s*u-a*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-n*l,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return _vector$c.copy(this).projectOnVector(e),this.sub(_vector$c)}reflect(e){return this.sub(_vector$c.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _vector$c=new Vector3,_quaternion$4=new Quaternion;class Box3{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(_vector$b.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(_vector$b.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=_vector$b.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,_vector$b):_vector$b.fromBufferAttribute(s,a),_vector$b.applyMatrix4(e.matrixWorld),this.expandByPoint(_vector$b);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),_box$4.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_box$4.copy(n.boundingBox)),_box$4.applyMatrix4(e.matrixWorld),this.union(_box$4)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,_vector$b),_vector$b.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(e.a,_center),_v1$7.subVectors(e.b,_center),_v2$4.subVectors(e.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$4,_v1$7),_f2.subVectors(_v0$2,_v2$4);let t=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!satForAxes(t,_v0$2,_v1$7,_v2$4,_extents)||(t=[1,0,0,0,1,0,0,0,1],!satForAxes(t,_v0$2,_v1$7,_v2$4,_extents))?!1:(_triangleNormal.crossVectors(_f0,_f1),t=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(t,_v0$2,_v1$7,_v2$4,_extents))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_vector$b).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(_vector$b).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_points),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$b=new Vector3,_box$4=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$4=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(i,e,t,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){_testAxis.fromArray(i,s);const o=r.x*Math.abs(_testAxis.x)+r.y*Math.abs(_testAxis.y)+r.z*Math.abs(_testAxis.z),l=e.dot(_testAxis),h=t.dot(_testAxis),u=n.dot(_testAxis);if(Math.max(-Math.max(l,h,u),Math.min(l,h,u))>o)return!1}return!0}const _box$3=new Box3,_v1$6=new Vector3,_v2$3=new Vector3;class Sphere{constructor(e=new Vector3,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):_box$3.setFromPoints(e).getCenter(n);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;_v1$6.subVectors(e,this.center);const t=_v1$6.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(_v1$6,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(_v2$3.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_v1$6.copy(e.center).add(_v2$3)),this.expandByPoint(_v1$6.copy(e.center).sub(_v2$3))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _vector$a=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3;class Ray{constructor(e=new Vector3,t=new Vector3(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,_vector$a)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=_vector$a.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_vector$a.copy(this.origin).addScaledVector(this.direction,t),_vector$a.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){_segCenter.copy(e).add(t).multiplyScalar(.5),_segDir.copy(t).sub(e).normalize(),_diff.copy(this.origin).sub(_segCenter);const s=e.distanceTo(t)*.5,a=-this.direction.dot(_segDir),o=_diff.dot(this.direction),l=-_diff.dot(_segDir),h=_diff.lengthSq(),u=Math.abs(1-a*a);let d,f,p,m;if(u>0)if(d=a*l-o,f=a*o-l,m=s*u,d>=0)if(f>=-m)if(f<=m){const g=1/u;d*=g,f*=g,p=d*(d+a*f+2*o)+f*(a*d+f+2*l)+h}else f=s,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+h;else f=-s,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+h;else f<=-m?(d=Math.max(0,-(-a*s+o)),f=d>0?-s:Math.min(Math.max(-s,-l),s),p=-d*d+f*(f+2*l)+h):f<=m?(d=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+h):(d=Math.max(0,-(a*s+o)),f=d>0?s:Math.min(Math.max(-s,-l),s),p=-d*d+f*(f+2*l)+h);else f=a>0?-s:s,d=Math.max(0,-(a*f+o)),p=-d*d+f*(f+2*l)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(_segCenter).addScaledVector(_segDir,f),p}intersectSphere(e,t){_vector$a.subVectors(e.center,this.origin);const n=_vector$a.dot(this.direction),r=_vector$a.dot(_vector$a)-n*n,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,a,o,l;const h=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return h>=0?(n=(e.min.x-f.x)*h,r=(e.max.x-f.x)*h):(n=(e.max.x-f.x)*h,r=(e.min.x-f.x)*h),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a<r||isNaN(r))&&(r=a),d>=0?(o=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(o=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),n>l||o>r)||((o>n||n!==n)&&(n=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,_vector$a)!==null}intersectTriangle(e,t,n,r,s){_edge1.subVectors(t,e),_edge2.subVectors(n,e),_normal$1.crossVectors(_edge1,_edge2);let a=this.direction.dot(_normal$1),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_diff.subVectors(this.origin,e);const l=o*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(l<0)return null;const h=o*this.direction.dot(_edge1.cross(_diff));if(h<0||l+h>a)return null;const u=-o*_diff.dot(_normal$1);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Matrix4{constructor(e,t,n,r,s,a,o,l,h,u,d,f,p,m,g,y){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,h,u,d,f,p,m,g,y)}set(e,t,n,r,s,a,o,l,h,u,d,f,p,m,g,y){const c=this.elements;return c[0]=e,c[4]=t,c[8]=n,c[12]=r,c[1]=s,c[5]=a,c[9]=o,c[13]=l,c[2]=h,c[6]=u,c[10]=d,c[14]=f,c[3]=p,c[7]=m,c[11]=g,c[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Matrix4().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/_v1$5.setFromMatrixColumn(e,0).length(),s=1/_v1$5.setFromMatrixColumn(e,1).length(),a=1/_v1$5.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(r),h=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const f=a*u,p=a*d,m=o*u,g=o*d;t[0]=l*u,t[4]=-l*d,t[8]=h,t[1]=p+m*h,t[5]=f-g*h,t[9]=-o*l,t[2]=g-f*h,t[6]=m+p*h,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*d,m=h*u,g=h*d;t[0]=f+g*o,t[4]=m*o-p,t[8]=a*h,t[1]=a*d,t[5]=a*u,t[9]=-o,t[2]=p*o-m,t[6]=g+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*d,m=h*u,g=h*d;t[0]=f-g*o,t[4]=-a*d,t[8]=m+p*o,t[1]=p+m*o,t[5]=a*u,t[9]=g-f*o,t[2]=-a*h,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*d,m=o*u,g=o*d;t[0]=l*u,t[4]=m*h-p,t[8]=f*h+g,t[1]=l*d,t[5]=g*h+f,t[9]=p*h-m,t[2]=-h,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*h,m=o*l,g=o*h;t[0]=l*u,t[4]=g-f*d,t[8]=m*d+p,t[1]=d,t[5]=a*u,t[9]=-o*u,t[2]=-h*u,t[6]=p*d+m,t[10]=f-g*d}else if(e.order==="XZY"){const f=a*l,p=a*h,m=o*l,g=o*h;t[0]=l*u,t[4]=-d,t[8]=h*u,t[1]=f*d+g,t[5]=a*u,t[9]=p*d-m,t[2]=m*d-p,t[6]=o*u,t[10]=g*d+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(_zero,e,_one)}lookAt(e,t,n){const r=this.elements;return _z.subVectors(e,t),_z.lengthSq()===0&&(_z.z=1),_z.normalize(),_x.crossVectors(n,_z),_x.lengthSq()===0&&(Math.abs(n.z)===1?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(n,_z)),_x.normalize(),_y.crossVectors(_z,_x),r[0]=_x.x,r[4]=_y.x,r[8]=_z.x,r[1]=_x.y,r[5]=_y.y,r[9]=_z.y,r[2]=_x.z,r[6]=_y.z,r[10]=_z.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],h=n[12],u=n[1],d=n[5],f=n[9],p=n[13],m=n[2],g=n[6],y=n[10],c=n[14],x=n[3],v=n[7],_=n[11],b=n[15],M=r[0],A=r[4],R=r[8],w=r[12],P=r[1],N=r[5],V=r[9],G=r[13],H=r[2],O=r[6],C=r[10],L=r[14],E=r[3],T=r[7],k=r[11],B=r[15];return s[0]=a*M+o*P+l*H+h*E,s[4]=a*A+o*N+l*O+h*T,s[8]=a*R+o*V+l*C+h*k,s[12]=a*w+o*G+l*L+h*B,s[1]=u*M+d*P+f*H+p*E,s[5]=u*A+d*N+f*O+p*T,s[9]=u*R+d*V+f*C+p*k,s[13]=u*w+d*G+f*L+p*B,s[2]=m*M+g*P+y*H+c*E,s[6]=m*A+g*N+y*O+c*T,s[10]=m*R+g*V+y*C+c*k,s[14]=m*w+g*G+y*L+c*B,s[3]=x*M+v*P+_*H+b*E,s[7]=x*A+v*N+_*O+b*T,s[11]=x*R+v*V+_*C+b*k,s[15]=x*w+v*G+_*L+b*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],h=e[13],u=e[2],d=e[6],f=e[10],p=e[14],m=e[3],g=e[7],y=e[11],c=e[15];return m*(+s*l*d-r*h*d-s*o*f+n*h*f+r*o*p-n*l*p)+g*(+t*l*p-t*h*f+s*a*f-r*a*p+r*h*u-s*l*u)+y*(+t*h*d-t*o*p-s*a*d+n*a*p+s*o*u-n*h*u)+c*(-r*o*u-t*l*d+t*o*f+r*a*d-n*a*f+n*l*u)}transpose(){const e=this.elements;let t;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(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],h=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],y=e[14],c=e[15],x=d*y*h-g*f*h+g*l*p-o*y*p-d*l*c+o*f*c,v=m*f*h-u*y*h-m*l*p+a*y*p+u*l*c-a*f*c,_=u*g*h-m*d*h+m*o*p-a*g*p-u*o*c+a*d*c,b=m*d*l-u*g*l-m*o*f+a*g*f+u*o*y-a*d*y,M=t*x+n*v+r*_+s*b;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/M;return e[0]=x*A,e[1]=(g*f*s-d*y*s-g*r*p+n*y*p+d*r*c-n*f*c)*A,e[2]=(o*y*s-g*l*s+g*r*h-n*y*h-o*r*c+n*l*c)*A,e[3]=(d*l*s-o*f*s-d*r*h+n*f*h+o*r*p-n*l*p)*A,e[4]=v*A,e[5]=(u*y*s-m*f*s+m*r*p-t*y*p-u*r*c+t*f*c)*A,e[6]=(m*l*s-a*y*s-m*r*h+t*y*h+a*r*c-t*l*c)*A,e[7]=(a*f*s-u*l*s+u*r*h-t*f*h-a*r*p+t*l*p)*A,e[8]=_*A,e[9]=(m*d*s-u*g*s-m*n*p+t*g*p+u*n*c-t*d*c)*A,e[10]=(a*g*s-m*o*s+m*n*h-t*g*h-a*n*c+t*o*c)*A,e[11]=(u*o*s-a*d*s-u*n*h+t*d*h+a*n*p-t*o*p)*A,e[12]=b*A,e[13]=(u*g*r-m*d*r+m*n*f-t*g*f-u*n*y+t*d*y)*A,e[14]=(m*o*r-a*g*r-m*n*l+t*g*l+a*n*y-t*o*y)*A,e[15]=(a*d*r-u*o*r+u*n*l-t*d*l-a*n*f+t*o*f)*A,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,h=s*a,u=s*o;return this.set(h*a+n,h*o-r*l,h*l+r*o,0,h*o+r*l,u*o+n,u*l-r*a,0,h*l-r*o,u*l+r*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,a){return this.set(1,n,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,h=s+s,u=a+a,d=o+o,f=s*h,p=s*u,m=s*d,g=a*u,y=a*d,c=o*d,x=l*h,v=l*u,_=l*d,b=n.x,M=n.y,A=n.z;return r[0]=(1-(g+c))*b,r[1]=(p+_)*b,r[2]=(m-v)*b,r[3]=0,r[4]=(p-_)*M,r[5]=(1-(f+c))*M,r[6]=(y+x)*M,r[7]=0,r[8]=(m+v)*A,r[9]=(y-x)*A,r[10]=(1-(f+g))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=_v1$5.set(r[0],r[1],r[2]).length();const a=_v1$5.set(r[4],r[5],r[6]).length(),o=_v1$5.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],_m1$2.copy(this);const h=1/s,u=1/a,d=1/o;return _m1$2.elements[0]*=h,_m1$2.elements[1]*=h,_m1$2.elements[2]*=h,_m1$2.elements[4]*=u,_m1$2.elements[5]*=u,_m1$2.elements[6]*=u,_m1$2.elements[8]*=d,_m1$2.elements[9]*=d,_m1$2.elements[10]*=d,t.setFromRotationMatrix(_m1$2),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,r,s,a,o=WebGLCoordinateSystem){const l=this.elements,h=2*s/(t-e),u=2*s/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r);let p,m;if(o===WebGLCoordinateSystem)p=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===WebGPUCoordinateSystem)p=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,r,s,a,o=WebGLCoordinateSystem){const l=this.elements,h=1/(t-e),u=1/(n-r),d=1/(a-s),f=(t+e)*h,p=(n+r)*u;let m,g;if(o===WebGLCoordinateSystem)m=(a+s)*d,g=-2*d;else if(o===WebGPUCoordinateSystem)m=s*d,g=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*h,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=g,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const _v1$5=new Vector3,_m1$2=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix$2=new Matrix4,_quaternion$3=new Quaternion;class Euler{constructor(e=0,t=0,n=0,r=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],h=r[5],u=r[9],d=r[2],f=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(clamp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,h),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,h)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-clamp(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,h));break;case"YZX":this._z=Math.asin(clamp(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,h),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-clamp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,h),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return _matrix$2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_matrix$2,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let _object3DId=0;const _v1$4=new Vector3,_q1=new Quaternion,_m1$1$1=new Matrix4,_target=new Vector3,_position$3=new Vector3,_scale$2=new Vector3,_quaternion$2=new Quaternion,_xAxis=new Vector3(1,0,0),_yAxis=new Vector3(0,1,0),_zAxis=new Vector3(0,0,1),_addedEvent={type:"added"},_removedEvent={type:"removed"},_childaddedEvent={type:"childadded",child:null},_childremovedEvent={type:"childremoved",child:null};class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:_object3DId++}),this.uuid=generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();const e=new Vector3,t=new Euler,n=new Quaternion,r=new Vector3(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return _q1.setFromAxisAngle(e,t),this.quaternion.multiply(_q1),this}rotateOnWorldAxis(e,t){return _q1.setFromAxisAngle(e,t),this.quaternion.premultiply(_q1),this}rotateX(e){return this.rotateOnAxis(_xAxis,e)}rotateY(e){return this.rotateOnAxis(_yAxis,e)}rotateZ(e){return this.rotateOnAxis(_zAxis,e)}translateOnAxis(e,t){return _v1$4.copy(e).applyQuaternion(this.quaternion),this.position.add(_v1$4.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(_xAxis,e)}translateY(e){return this.translateOnAxis(_yAxis,e)}translateZ(e){return this.translateOnAxis(_zAxis,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_m1$1$1.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_target.copy(e):_target.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),_position$3.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_m1$1$1.lookAt(_position$3,_target,this.up):_m1$1$1.lookAt(_target,_position$3,this.up),this.quaternion.setFromRotationMatrix(_m1$1$1),r&&(_m1$1$1.extractRotation(r.matrixWorld),_q1.setFromRotationMatrix(_m1$1$1),this.quaternion.premultiply(_q1.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(_addedEvent),_childaddedEvent.child=e,this.dispatchEvent(_childaddedEvent),_childaddedEvent.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(_removedEvent),_childremovedEvent.child=e,this.dispatchEvent(_childremovedEvent),_childremovedEvent.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),_m1$1$1.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_m1$1$1.multiply(e.parent.matrixWorld)),e.applyMatrix4(_m1$1$1),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(_addedEvent),_childaddedEvent.child=e,this.dispatchEvent(_childaddedEvent),_childaddedEvent.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_position$3,e,_scale$2),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_position$3,_quaternion$2,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?{min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}:void 0,boundingSphere:o.boundingSphere?{radius:o.boundingSphere.radius,center:o.boundingSphere.center.toArray()}:void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let h=0,u=l.length;h<u;h++){const d=l[h];s(e.shapes,d)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,h=this.material.length;l<h;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),h=a(e.textures),u=a(e.images),d=a(e.shapes),f=a(e.skeletons),p=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),h.length>0&&(n.textures=h),u.length>0&&(n.images=u),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),m.length>0&&(n.nodes=m)}return n.object=r,n;function a(o){const l=[];for(const h in o){const u=o[h];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}Object3D.DEFAULT_UP=new Vector3(0,1,0);Object3D.DEFAULT_MATRIX_AUTO_UPDATE=!0;Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const _v0$1=new Vector3,_v1$3=new Vector3,_v2$2=new Vector3,_v3$2=new Vector3,_vab=new Vector3,_vac=new Vector3,_vbc=new Vector3,_vap=new Vector3,_vbp=new Vector3,_vcp=new Vector3,_v40=new Vector4,_v41=new Vector4,_v42=new Vector4;class Triangle{constructor(e=new Vector3,t=new Vector3,n=new Vector3){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),_v0$1.subVectors(e,t),r.cross(_v0$1);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){_v0$1.subVectors(r,t),_v1$3.subVectors(n,t),_v2$2.subVectors(e,t);const a=_v0$1.dot(_v0$1),o=_v0$1.dot(_v1$3),l=_v0$1.dot(_v2$2),h=_v1$3.dot(_v1$3),u=_v1$3.dot(_v2$2),d=a*h-o*o;if(d===0)return s.set(0,0,0),null;const f=1/d,p=(h*l-o*u)*f,m=(a*u-o*l)*f;return s.set(1-p-m,m,p)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,_v3$2)===null?!1:_v3$2.x>=0&&_v3$2.y>=0&&_v3$2.x+_v3$2.y<=1}static getInterpolation(e,t,n,r,s,a,o,l){return this.getBarycoord(e,t,n,r,_v3$2)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,_v3$2.x),l.addScaledVector(a,_v3$2.y),l.addScaledVector(o,_v3$2.z),l)}static getInterpolatedAttribute(e,t,n,r,s,a){return _v40.setScalar(0),_v41.setScalar(0),_v42.setScalar(0),_v40.fromBufferAttribute(e,t),_v41.fromBufferAttribute(e,n),_v42.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(_v40,s.x),a.addScaledVector(_v41,s.y),a.addScaledVector(_v42,s.z),a}static isFrontFacing(e,t,n,r){return _v0$1.subVectors(n,t),_v1$3.subVectors(e,t),_v0$1.cross(_v1$3).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),_v0$1.cross(_v1$3).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let a,o;_vab.subVectors(r,n),_vac.subVectors(s,n),_vap.subVectors(e,n);const l=_vab.dot(_vap),h=_vac.dot(_vap);if(l<=0&&h<=0)return t.copy(n);_vbp.subVectors(e,r);const u=_vab.dot(_vbp),d=_vac.dot(_vbp);if(u>=0&&d<=u)return t.copy(r);const f=l*d-u*h;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(n).addScaledVector(_vab,a);_vcp.subVectors(e,s);const p=_vab.dot(_vcp),m=_vac.dot(_vcp);if(m>=0&&p<=m)return t.copy(s);const g=p*h-l*m;if(g<=0&&h>=0&&m<=0)return o=h/(h-m),t.copy(n).addScaledVector(_vac,o);const y=u*m-p*d;if(y<=0&&d-u>=0&&p-m>=0)return _vbc.subVectors(s,r),o=(d-u)/(d-u+(p-m)),t.copy(r).addScaledVector(_vbc,o);const c=1/(y+g+f);return a=g*c,o=f*c,t.copy(n).addScaledVector(_vab,a).addScaledVector(_vac,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const _colorKeywords={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},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Color{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=SRGBColorSpace){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ColorManagement.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=ColorManagement.workingColorSpace){return this.r=e,this.g=t,this.b=n,ColorManagement.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=ColorManagement.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp(t,0,1),n=clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=hue2rgb(a,s,e+1/3),this.g=hue2rgb(a,s,e),this.b=hue2rgb(a,s,e-1/3)}return ColorManagement.toWorkingColorSpace(this,r),this}setStyle(e,t=SRGBColorSpace){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=SRGBColorSpace){const n=_colorKeywords[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=SRGBColorSpace){return ColorManagement.fromWorkingColorSpace(_color.copy(this),e),Math.round(clamp(_color.r*255,0,255))*65536+Math.round(clamp(_color.g*255,0,255))*256+Math.round(clamp(_color.b*255,0,255))}getHexString(e=SRGBColorSpace){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ColorManagement.workingColorSpace){ColorManagement.fromWorkingColorSpace(_color.copy(this),t);const n=_color.r,r=_color.g,s=_color.b,a=Math.max(n,r,s),o=Math.min(n,r,s);let l,h;const u=(o+a)/2;if(o===a)l=0,h=0;else{const d=a-o;switch(h=u<=.5?d/(a+o):d/(2-a-o),a){case n:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-n)/d+2;break;case s:l=(n-r)/d+4;break}l/=6}return e.h=l,e.s=h,e.l=u,e}getRGB(e,t=ColorManagement.workingColorSpace){return ColorManagement.fromWorkingColorSpace(_color.copy(this),t),e.r=_color.r,e.g=_color.g,e.b=_color.b,e}getStyle(e=SRGBColorSpace){ColorManagement.fromWorkingColorSpace(_color.copy(this),e);const t=_color.r,n=_color.g,r=_color.b;return e!==SRGBColorSpace?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(_hslA),this.setHSL(_hslA.h+e,_hslA.s+t,_hslA.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(_hslA),e.getHSL(_hslB);const n=lerp(_hslA.h,_hslB.h,t),r=lerp(_hslA.s,_hslB.s,t),s=lerp(_hslA.l,_hslB.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const _color=new Color;Color.NAMES=_colorKeywords;let _materialId=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:_materialId++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=NormalBlending,this.side=FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(n.blending=this.blending),this.side!==FrontSide&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==SrcAlphaFactor&&(n.blendSrc=this.blendSrc),this.blendDst!==OneMinusSrcAlphaFactor&&(n.blendDst=this.blendDst),this.blendEquation!==AddEquation&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==LessEqualDepth&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==AlwaysStencilFunc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==KeepStencilOp&&(n.stencilFail=this.stencilFail),this.stencilZFail!==KeepStencilOp&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==KeepStencilOp&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class MeshBasicMaterial extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const _vector$9=new Vector3,_vector2$1=new Vector2;let _id$2=0;class BufferAttribute{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:_id$2++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=StaticDrawUsage,this.updateRanges=[],this.gpuType=FloatType,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)_vector2$1.fromBufferAttribute(this,t),_vector2$1.applyMatrix3(e),this.setXY(t,_vector2$1.x,_vector2$1.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.applyMatrix3(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.applyMatrix4(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.applyNormalMatrix(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.transformDirection(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=denormalize(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=normalize(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=denormalize(t,this.array)),t}setX(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=denormalize(t,this.array)),t}setY(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=denormalize(t,this.array)),t}setZ(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=denormalize(t,this.array)),t}setW(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array),s=normalize(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==StaticDrawUsage&&(e.usage=this.usage),e}}class Uint16BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Uint32BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Float32BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Float32Array(e),t,n)}}let _id$1=0;const _m1$3=new Matrix4,_obj=new Object3D,_offset=new Vector3,_box$2=new Box3,_boxMorphTargets=new Box3,_vector$8=new Vector3;class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:_id$1++}),this.uuid=generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(arrayNeedsUint32(e)?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Matrix3().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _m1$3.makeRotationFromQuaternion(e),this.applyMatrix4(_m1$3),this}rotateX(e){return _m1$3.makeRotationX(e),this.applyMatrix4(_m1$3),this}rotateY(e){return _m1$3.makeRotationY(e),this.applyMatrix4(_m1$3),this}rotateZ(e){return _m1$3.makeRotationZ(e),this.applyMatrix4(_m1$3),this}translate(e,t,n){return _m1$3.makeTranslation(e,t,n),this.applyMatrix4(_m1$3),this}scale(e,t,n){return _m1$3.makeScale(e,t,n),this.applyMatrix4(_m1$3),this}lookAt(e){return _obj.lookAt(e),_obj.updateMatrix(),this.applyMatrix4(_obj.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_offset).negate(),this.translate(_offset.x,_offset.y,_offset.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Float32BufferAttribute(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Box3);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Vector3(-1/0,-1/0,-1/0),new Vector3(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];_box$2.setFromBufferAttribute(s),this.morphTargetsRelative?(_vector$8.addVectors(this.boundingBox.min,_box$2.min),this.boundingBox.expandByPoint(_vector$8),_vector$8.addVectors(this.boundingBox.max,_box$2.max),this.boundingBox.expandByPoint(_vector$8)):(this.boundingBox.expandByPoint(_box$2.min),this.boundingBox.expandByPoint(_box$2.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(){this.boundingSphere===null&&(this.boundingSphere=new Sphere);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Vector3,1/0);return}if(e){const n=this.boundingSphere.center;if(_box$2.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];_boxMorphTargets.setFromBufferAttribute(o),this.morphTargetsRelative?(_vector$8.addVectors(_box$2.min,_boxMorphTargets.min),_box$2.expandByPoint(_vector$8),_vector$8.addVectors(_box$2.max,_boxMorphTargets.max),_box$2.expandByPoint(_vector$8)):(_box$2.expandByPoint(_boxMorphTargets.min),_box$2.expandByPoint(_boxMorphTargets.max))}_box$2.getCenter(n);let r=0;for(let s=0,a=e.count;s<a;s++)_vector$8.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(_vector$8));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let h=0,u=o.count;h<u;h++)_vector$8.fromBufferAttribute(o,h),l&&(_offset.fromBufferAttribute(e,h),_vector$8.add(_offset)),r=Math.max(r,n.distanceToSquared(_vector$8))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new BufferAttribute(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let R=0;R<n.count;R++)o[R]=new Vector3,l[R]=new Vector3;const h=new Vector3,u=new Vector3,d=new Vector3,f=new Vector2,p=new Vector2,m=new Vector2,g=new Vector3,y=new Vector3;function c(R,w,P){h.fromBufferAttribute(n,R),u.fromBufferAttribute(n,w),d.fromBufferAttribute(n,P),f.fromBufferAttribute(s,R),p.fromBufferAttribute(s,w),m.fromBufferAttribute(s,P),u.sub(h),d.sub(h),p.sub(f),m.sub(f);const N=1/(p.x*m.y-m.x*p.y);isFinite(N)&&(g.copy(u).multiplyScalar(m.y).addScaledVector(d,-p.y).multiplyScalar(N),y.copy(d).multiplyScalar(p.x).addScaledVector(u,-m.x).multiplyScalar(N),o[R].add(g),o[w].add(g),o[P].add(g),l[R].add(y),l[w].add(y),l[P].add(y))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let R=0,w=x.length;R<w;++R){const P=x[R],N=P.start,V=P.count;for(let G=N,H=N+V;G<H;G+=3)c(e.getX(G+0),e.getX(G+1),e.getX(G+2))}const v=new Vector3,_=new Vector3,b=new Vector3,M=new Vector3;function A(R){b.fromBufferAttribute(r,R),M.copy(b);const w=o[R];v.copy(w),v.sub(b.multiplyScalar(b.dot(w))).normalize(),_.crossVectors(M,w);const N=_.dot(l[R])<0?-1:1;a.setXYZW(R,v.x,v.y,v.z,N)}for(let R=0,w=x.length;R<w;++R){const P=x[R],N=P.start,V=P.count;for(let G=N,H=N+V;G<H;G+=3)A(e.getX(G+0)),A(e.getX(G+1)),A(e.getX(G+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new BufferAttribute(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let f=0,p=n.count;f<p;f++)n.setXYZ(f,0,0,0);const r=new Vector3,s=new Vector3,a=new Vector3,o=new Vector3,l=new Vector3,h=new Vector3,u=new Vector3,d=new Vector3;if(e)for(let f=0,p=e.count;f<p;f+=3){const m=e.getX(f+0),g=e.getX(f+1),y=e.getX(f+2);r.fromBufferAttribute(t,m),s.fromBufferAttribute(t,g),a.fromBufferAttribute(t,y),u.subVectors(a,s),d.subVectors(r,s),u.cross(d),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,g),h.fromBufferAttribute(n,y),o.add(u),l.add(u),h.add(u),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(y,h.x,h.y,h.z)}else for(let f=0,p=t.count;f<p;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),d.subVectors(r,s),u.cross(d),n.setXYZ(f+0,u.x,u.y,u.z),n.setXYZ(f+1,u.x,u.y,u.z),n.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)_vector$8.fromBufferAttribute(e,t),_vector$8.normalize(),e.setXYZ(t,_vector$8.x,_vector$8.y,_vector$8.z)}toNonIndexed(){function e(o,l){const h=o.array,u=o.itemSize,d=o.normalized,f=new h.constructor(l.length*u);let p=0,m=0;for(let g=0,y=l.length;g<y;g++){o.isInterleavedBufferAttribute?p=l[g]*o.data.stride+o.offset:p=l[g]*u;for(let c=0;c<u;c++)f[m++]=h[p++]}return new BufferAttribute(f,u,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new BufferGeometry,n=this.index.array,r=this.attributes;for(const o in r){const l=r[o],h=e(l,n);t.setAttribute(o,h)}const s=this.morphAttributes;for(const o in s){const l=[],h=s[o];for(let u=0,d=h.length;u<d;u++){const f=h[u],p=e(f,n);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const h=a[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const h in l)l[h]!==void 0&&(e[h]=l[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const h=n[l];e.data.attributes[l]=h.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const h=this.morphAttributes[l],u=[];for(let d=0,f=h.length;d<f;d++){const p=h[d];u.push(p.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const h in r){const u=r[h];this.setAttribute(h,u.clone(t))}const s=e.morphAttributes;for(const h in s){const u=[],d=s[h];for(let f=0,p=d.length;f<p;f++)u.push(d[f].clone(t));this.morphAttributes[h]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let h=0,u=a.length;h<u;h++){const d=a[h];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const _inverseMatrix$3=new Matrix4,_ray$3=new Ray,_sphere$6=new Sphere,_sphereHitAt=new Vector3,_vA$1=new Vector3,_vB$1=new Vector3,_vC$1=new Vector3,_tempA=new Vector3,_morphA=new Vector3,_intersectionPoint=new Vector3,_intersectionPointWorld=new Vector3;class Mesh extends Object3D{constructor(e=new BufferGeometry,t=new MeshBasicMaterial){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){_morphA.set(0,0,0);for(let l=0,h=s.length;l<h;l++){const u=o[l],d=s[l];u!==0&&(_tempA.fromBufferAttribute(d,e),a?_morphA.addScaledVector(_tempA,u):_morphA.addScaledVector(_tempA.sub(t),u))}t.add(_morphA)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),_sphere$6.copy(n.boundingSphere),_sphere$6.applyMatrix4(s),_ray$3.copy(e.ray).recast(e.near),!(_sphere$6.containsPoint(_ray$3.origin)===!1&&(_ray$3.intersectSphere(_sphere$6,_sphereHitAt)===null||_ray$3.origin.distanceToSquared(_sphereHitAt)>(e.far-e.near)**2))&&(_inverseMatrix$3.copy(s).invert(),_ray$3.copy(e.ray).applyMatrix4(_inverseMatrix$3),!(n.boundingBox!==null&&_ray$3.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,_ray$3)))}_computeIntersections(e,t,n){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,h=s.attributes.uv,u=s.attributes.uv1,d=s.attributes.normal,f=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,g=f.length;m<g;m++){const y=f[m],c=a[y.materialIndex],x=Math.max(y.start,p.start),v=Math.min(o.count,Math.min(y.start+y.count,p.start+p.count));for(let _=x,b=v;_<b;_+=3){const M=o.getX(_),A=o.getX(_+1),R=o.getX(_+2);r=checkGeometryIntersection(this,c,e,n,h,u,d,M,A,R),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),g=Math.min(o.count,p.start+p.count);for(let y=m,c=g;y<c;y+=3){const x=o.getX(y),v=o.getX(y+1),_=o.getX(y+2);r=checkGeometryIntersection(this,a,e,n,h,u,d,x,v,_),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,g=f.length;m<g;m++){const y=f[m],c=a[y.materialIndex],x=Math.max(y.start,p.start),v=Math.min(l.count,Math.min(y.start+y.count,p.start+p.count));for(let _=x,b=v;_<b;_+=3){const M=_,A=_+1,R=_+2;r=checkGeometryIntersection(this,c,e,n,h,u,d,M,A,R),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let y=m,c=g;y<c;y+=3){const x=y,v=y+1,_=y+2;r=checkGeometryIntersection(this,a,e,n,h,u,d,x,v,_),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}}}function checkIntersection$1(i,e,t,n,r,s,a,o){let l;if(e.side===BackSide?l=n.intersectTriangle(a,s,r,!0,o):l=n.intersectTriangle(r,s,a,e.side===FrontSide,o),l===null)return null;_intersectionPointWorld.copy(o),_intersectionPointWorld.applyMatrix4(i.matrixWorld);const h=t.ray.origin.distanceTo(_intersectionPointWorld);return h<t.near||h>t.far?null:{distance:h,point:_intersectionPointWorld.clone(),object:i}}function checkGeometryIntersection(i,e,t,n,r,s,a,o,l,h){i.getVertexPosition(o,_vA$1),i.getVertexPosition(l,_vB$1),i.getVertexPosition(h,_vC$1);const u=checkIntersection$1(i,e,t,n,_vA$1,_vB$1,_vC$1,_intersectionPoint);if(u){const d=new Vector3;Triangle.getBarycoord(_intersectionPoint,_vA$1,_vB$1,_vC$1,d),r&&(u.uv=Triangle.getInterpolatedAttribute(r,o,l,h,d,new Vector2)),s&&(u.uv1=Triangle.getInterpolatedAttribute(s,o,l,h,d,new Vector2)),a&&(u.normal=Triangle.getInterpolatedAttribute(a,o,l,h,d,new Vector3),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c:h,normal:new Vector3,materialIndex:0};Triangle.getNormal(_vA$1,_vB$1,_vC$1,f.normal),u.face=f,u.barycoord=d}return u}class BoxGeometry extends BufferGeometry{constructor(e=1,t=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],h=[],u=[],d=[];let f=0,p=0;m("z","y","x",-1,-1,n,t,e,a,s,0),m("z","y","x",1,-1,n,t,-e,a,s,1),m("x","z","y",1,1,e,n,t,r,a,2),m("x","z","y",1,-1,e,n,-t,r,a,3),m("x","y","z",1,-1,e,t,n,r,s,4),m("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Float32BufferAttribute(h,3)),this.setAttribute("normal",new Float32BufferAttribute(u,3)),this.setAttribute("uv",new Float32BufferAttribute(d,2));function m(g,y,c,x,v,_,b,M,A,R,w){const P=_/A,N=b/R,V=_/2,G=b/2,H=M/2,O=A+1,C=R+1;let L=0,E=0;const T=new Vector3;for(let k=0;k<C;k++){const B=k*N-G;for(let ee=0;ee<O;ee++){const oe=ee*P-V;T[g]=oe*x,T[y]=B*v,T[c]=H,h.push(T.x,T.y,T.z),T[g]=0,T[y]=0,T[c]=M>0?1:-1,u.push(T.x,T.y,T.z),d.push(ee/A),d.push(1-k/R),L+=1}}for(let k=0;k<R;k++)for(let B=0;B<A;B++){const ee=f+B+O*k,oe=f+B+O*(k+1),X=f+(B+1)+O*(k+1),Q=f+(B+1)+O*k;l.push(ee,oe,Q),l.push(oe,X,Q),E+=6}o.addGroup(p,E,w),p+=E,f+=L}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function cloneUniforms(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function mergeUniforms(i){const e={};for(let t=0;t<i.length;t++){const n=cloneUniforms(i[t]);for(const r in n)e[r]=n[r]}return e}function cloneUniformsGroups(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function getUnlitUniformColorSpace(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:ColorManagement.workingColorSpace}const UniformsUtils={clone:cloneUniforms,merge:mergeUniforms};var default_vertex=`void main() {
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();const WORKING_CLUSTER$1=["thinking","searching","writing","working"];function isWorkingClusterState(i){return WORKING_CLUSTER$1.includes(i)}function resolveVisualState({state:i,firstToolStarted:e}){return isWorkingClusterState(i)?i==="thinking"&&!e?"thinking":"working":i}function getDefaultExportFromCjs(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var lottie$2={exports:{}},lottie$1=lottie$2.exports,hasRequiredLottie;function requireLottie(){return hasRequiredLottie||(hasRequiredLottie=1,(function(module,exports){typeof document<"u"&&typeof navigator<"u"&&(function(i,e){module.exports=e()})(lottie$1,(function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(i){return document.createElement(i)}function extendPrototype(i,e){var t,n=i.length,r;for(t=0;t<n;t+=1){r=i[t].prototype;for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e.prototype[s]=r[s])}}function getDescriptor(i,e){return Object.getOwnPropertyDescriptor(i,e)}function createProxyFunction(i){function e(){}return e.prototype=i,e}var audioControllerFactory=(function(){function i(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return i.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].pause()},resume:function(){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].resume()},setRate:function(t){var n,r=this.audios.length;for(n=0;n<r;n+=1)this.audios[n].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):window.Howl?new window.Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,n=this.audios.length;for(t=0;t<n;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new i}})(),createTypedArray=(function(){function i(t,n){var r=0,s=[],a;switch(t){case"int16":case"uint8c":a=1;break;default:a=1.1;break}for(r=0;r<n;r+=1)s.push(a);return s}function e(t,n){return t==="float32"?new Float32Array(n):t==="int16"?new Int16Array(n):t==="uint8c"?new Uint8ClampedArray(n):i(t,n)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:i})();function createSizedArray(i){return Array.apply(null,{length:i})}function _typeof$6(i){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(i)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var i=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e,t=i.length;for(e=0;e<t;e+=1)BMMath[i[e]]=Math[i[e]]})(),BMMath.random=Math.random,BMMath.abs=function(i){var e=_typeof$6(i);if(e==="object"&&i.length){var t=createSizedArray(i.length),n,r=i.length;for(n=0;n<r;n+=1)t[n]=Math.abs(i[n]);return t}return Math.abs(i)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(i){i.style.position="absolute",i.style.top=0,i.style.left=0,i.style.display="block",i.style.transformOrigin="0 0",i.style.webkitTransformOrigin="0 0",i.style.backfaceVisibility="visible",i.style.webkitBackfaceVisibility="visible",i.style.transformStyle="preserve-3d",i.style.webkitTransformStyle="preserve-3d",i.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(i,e,t,n){this.type=i,this.currentTime=e,this.totalTime=t,this.direction=n<0?-1:1}function BMCompleteEvent(i,e){this.type=i,this.direction=e<0?-1:1}function BMCompleteLoopEvent(i,e,t,n){this.type=i,this.currentLoop=t,this.totalLoops=e,this.direction=n<0?-1:1}function BMSegmentStartEvent(i,e,t){this.type=i,this.firstFrame=e,this.totalFrames=t}function BMDestroyEvent(i,e){this.type=i,this.target=e}function BMRenderFrameErrorEvent(i,e){this.type="renderFrameError",this.nativeError=i,this.currentTime=e}function BMConfigErrorEvent(i){this.type="configError",this.nativeError=i}var createElementID=(function(){var i=0;return function(){return i+=1,idPrefix$1+"__lottie_element_"+i}})();function HSVtoRGB(i,e,t){var n,r,s,a,o,l,h,u;switch(a=Math.floor(i*6),o=i*6-a,l=t*(1-e),h=t*(1-o*e),u=t*(1-(1-o)*e),a%6){case 0:n=t,r=u,s=l;break;case 1:n=h,r=t,s=l;break;case 2:n=l,r=t,s=u;break;case 3:n=l,r=h,s=t;break;case 4:n=u,r=l,s=t;break;case 5:n=t,r=l,s=h;break}return[n,r,s]}function RGBtoHSV(i,e,t){var n=Math.max(i,e,t),r=Math.min(i,e,t),s=n-r,a,o=n===0?0:s/n,l=n/255;switch(n){case r:a=0;break;case i:a=e-t+s*(e<t?6:0),a/=6*s;break;case e:a=t-i+s*2,a/=6*s;break;case t:a=i-e+s*4,a/=6*s;break}return[a,o,l]}function addSaturationToRGB(i,e){var t=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return t[1]+=e,t[1]>1?t[1]=1:t[1]<=0&&(t[1]=0),HSVtoRGB(t[0],t[1],t[2])}function addBrightnessToRGB(i,e){var t=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return t[2]+=e,t[2]>1?t[2]=1:t[2]<0&&(t[2]=0),HSVtoRGB(t[0],t[1],t[2])}function addHueToRGB(i,e){var t=RGBtoHSV(i[0]*255,i[1]*255,i[2]*255);return t[0]+=e/360,t[0]>1?t[0]-=1:t[0]<0&&(t[0]+=1),HSVtoRGB(t[0],t[1],t[2])}var rgbToHex=(function(){var i=[],e,t;for(e=0;e<256;e+=1)t=e.toString(16),i[e]=t.length===1?"0"+t:t;return function(n,r,s){return n<0&&(n=0),r<0&&(r=0),s<0&&(s=0),"#"+i[n]+i[r]+i[s]}})(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(i){return document.createElementNS(svgNS,i)}function _typeof$5(i){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(i)}var dataManager=(function(){var i=1,e=[],t,n,r={onmessage:function(){},postMessage:function(d){t({data:d})}},s={postMessage:function(d){r.onmessage({data:d})}};function a(f){if(window.Worker&&window.Blob&&getWebWorker()){var d=new Blob(["var _workerSelf = self; self.onmessage = ",f.toString()],{type:"text/javascript"}),m=URL.createObjectURL(d);return new Worker(m)}return t=f,r}function o(){n||(n=a(function(d){function m(){function y(O,C){var L,E,T=O.length,k,B,ee,oe;for(E=0;E<T;E+=1)if(L=O[E],"ks"in L&&!L.completed){if(L.completed=!0,L.hasMask){var X=L.masksProperties;for(B=X.length,k=0;k<B;k+=1)if(X[k].pt.k.i)b(X[k].pt.k);else for(oe=X[k].pt.k.length,ee=0;ee<oe;ee+=1)X[k].pt.k[ee].s&&b(X[k].pt.k[ee].s[0]),X[k].pt.k[ee].e&&b(X[k].pt.k[ee].e[0])}L.ty===0?(L.layers=v(L.refId,C),y(L.layers,C)):L.ty===4?_(L.shapes):L.ty===5&&G(L)}}function c(O,C){if(O){var L=0,E=O.length;for(L=0;L<E;L+=1)O[L].t===1&&(O[L].data.layers=v(O[L].data.refId,C),y(O[L].data.layers,C))}}function x(O,C){for(var L=0,E=C.length;L<E;){if(C[L].id===O)return C[L];L+=1}return null}function v(O,C){var L=x(O,C);return L?L.layers.__used?JSON.parse(JSON.stringify(L.layers)):(L.layers.__used=!0,L.layers):null}function _(O){var C,L=O.length,E,T;for(C=L-1;C>=0;C-=1)if(O[C].ty==="sh")if(O[C].ks.k.i)b(O[C].ks.k);else for(T=O[C].ks.k.length,E=0;E<T;E+=1)O[C].ks.k[E].s&&b(O[C].ks.k[E].s[0]),O[C].ks.k[E].e&&b(O[C].ks.k[E].e[0]);else O[C].ty==="gr"&&_(O[C].it)}function b(O){var C,L=O.i.length;for(C=0;C<L;C+=1)O.i[C][0]+=O.v[C][0],O.i[C][1]+=O.v[C][1],O.o[C][0]+=O.v[C][0],O.o[C][1]+=O.v[C][1]}function M(O,C){var L=C?C.split("."):[100,100,100];return O[0]>L[0]?!0:L[0]>O[0]?!1:O[1]>L[1]?!0:L[1]>O[1]?!1:O[2]>L[2]?!0:L[2]>O[2]?!1:null}var A=(function(){var O=[4,4,14];function C(E){var T=E.t.d;E.t.d={k:[{s:T,t:0}]}}function L(E){var T,k=E.length;for(T=0;T<k;T+=1)E[T].ty===5&&C(E[T])}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})(),R=(function(){var O=[4,7,99];return function(C){if(C.chars&&!M(O,C.v)){var L,E=C.chars.length;for(L=0;L<E;L+=1){var T=C.chars[L];T.data&&T.data.shapes&&(_(T.data.shapes),T.data.ip=0,T.data.op=99999,T.data.st=0,T.data.sr=1,T.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},C.chars[L].t||(T.data.shapes.push({ty:"no"}),T.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}})(),w=(function(){var O=[5,7,15];function C(E){var T=E.t.p;typeof T.a=="number"&&(T.a={a:0,k:T.a}),typeof T.p=="number"&&(T.p={a:0,k:T.p}),typeof T.r=="number"&&(T.r={a:0,k:T.r})}function L(E){var T,k=E.length;for(T=0;T<k;T+=1)E[T].ty===5&&C(E[T])}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})(),P=(function(){var O=[4,1,9];function C(E){var T,k=E.length,B,ee;for(T=0;T<k;T+=1)if(E[T].ty==="gr")C(E[T].it);else if(E[T].ty==="fl"||E[T].ty==="st")if(E[T].c.k&&E[T].c.k[0].i)for(ee=E[T].c.k.length,B=0;B<ee;B+=1)E[T].c.k[B].s&&(E[T].c.k[B].s[0]/=255,E[T].c.k[B].s[1]/=255,E[T].c.k[B].s[2]/=255,E[T].c.k[B].s[3]/=255),E[T].c.k[B].e&&(E[T].c.k[B].e[0]/=255,E[T].c.k[B].e[1]/=255,E[T].c.k[B].e[2]/=255,E[T].c.k[B].e[3]/=255);else E[T].c.k[0]/=255,E[T].c.k[1]/=255,E[T].c.k[2]/=255,E[T].c.k[3]/=255}function L(E){var T,k=E.length;for(T=0;T<k;T+=1)E[T].ty===4&&C(E[T].shapes)}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})(),N=(function(){var O=[4,4,18];function C(E){var T,k=E.length,B,ee;for(T=k-1;T>=0;T-=1)if(E[T].ty==="sh")if(E[T].ks.k.i)E[T].ks.k.c=E[T].closed;else for(ee=E[T].ks.k.length,B=0;B<ee;B+=1)E[T].ks.k[B].s&&(E[T].ks.k[B].s[0].c=E[T].closed),E[T].ks.k[B].e&&(E[T].ks.k[B].e[0].c=E[T].closed);else E[T].ty==="gr"&&C(E[T].it)}function L(E){var T,k,B=E.length,ee,oe,X,Q;for(k=0;k<B;k+=1){if(T=E[k],T.hasMask){var ne=T.masksProperties;for(oe=ne.length,ee=0;ee<oe;ee+=1)if(ne[ee].pt.k.i)ne[ee].pt.k.c=ne[ee].cl;else for(Q=ne[ee].pt.k.length,X=0;X<Q;X+=1)ne[ee].pt.k[X].s&&(ne[ee].pt.k[X].s[0].c=ne[ee].cl),ne[ee].pt.k[X].e&&(ne[ee].pt.k[X].e[0].c=ne[ee].cl)}T.ty===4&&C(T.shapes)}}return function(E){if(M(O,E.v)&&(L(E.layers),E.assets)){var T,k=E.assets.length;for(T=0;T<k;T+=1)E.assets[T].layers&&L(E.assets[T].layers)}}})();function V(O){O.__complete||(P(O),A(O),R(O),w(O),N(O),y(O.layers,O.assets),c(O.chars,O.assets),O.__complete=!0)}function G(O){O.t.a.length===0&&"m"in O.t.p}var H={};return H.completeData=V,H.checkColors=P,H.checkChars=R,H.checkPathProperties=w,H.checkShapes=N,H.completeLayers=y,H}if(s.dataManager||(s.dataManager=m()),s.assetLoader||(s.assetLoader=(function(){function y(x){var v=x.getResponseHeader("content-type");return v&&x.responseType==="json"&&v.indexOf("json")!==-1||x.response&&_typeof$5(x.response)==="object"?x.response:x.response&&typeof x.response=="string"?JSON.parse(x.response):x.responseText?JSON.parse(x.responseText):null}function c(x,v,_,b){var M,A=new XMLHttpRequest;try{A.responseType="json"}catch{}A.onreadystatechange=function(){if(A.readyState===4)if(A.status===200)M=y(A),_(M);else try{M=y(A),_(M)}catch(R){b&&b(R)}};try{A.open(["G","E","T"].join(""),x,!0)}catch{A.open(["G","E","T"].join(""),v+"/"+x,!0)}A.send()}return{load:c}})()),d.data.type==="loadAnimation")s.assetLoader.load(d.data.path,d.data.fullPath,function(y){s.dataManager.completeData(y),s.postMessage({id:d.data.id,payload:y,status:"success"})},function(){s.postMessage({id:d.data.id,status:"error"})});else if(d.data.type==="complete"){var g=d.data.animation;s.dataManager.completeData(g),s.postMessage({id:d.data.id,payload:g,status:"success"})}else d.data.type==="loadData"&&s.assetLoader.load(d.data.path,d.data.fullPath,function(y){s.postMessage({id:d.data.id,payload:y,status:"success"})},function(){s.postMessage({id:d.data.id,status:"error"})})}),n.onmessage=function(f){var d=f.data,m=d.id,g=e[m];e[m]=null,d.status==="success"?g.onComplete(d.payload):g.onError&&g.onError()})}function l(f,d){i+=1;var m="processId_"+i;return e[m]={onComplete:f,onError:d},m}function h(f,d,m){o();var g=l(d,m);n.postMessage({type:"loadAnimation",path:f,fullPath:window.location.origin+window.location.pathname,id:g})}function u(f,d,m){o();var g=l(d,m);n.postMessage({type:"loadData",path:f,fullPath:window.location.origin+window.location.pathname,id:g})}function p(f,d,m){o();var g=l(d,m);n.postMessage({type:"complete",animation:f,id:g})}return{loadAnimation:h,loadData:u,completeAnimation:p}})(),ImagePreloader=(function(){var i=(function(){var c=createTag("canvas");c.width=1,c.height=1;var x=c.getContext("2d");return x.fillStyle="rgba(0,0,0,0)",x.fillRect(0,0,1,1),c})();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function t(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(c,x,v){var _="";if(c.e)_=c.p;else if(x){var b=c.p;b.indexOf("images/")!==-1&&(b=b.split("/")[1]),_=x+b}else _=v,_+=c.u?c.u:"",_+=c.p;return _}function r(c){var x=0,v=setInterval((function(){var _=c.getBBox();(_.width||x>500)&&(this._imageLoaded(),clearInterval(v)),x+=1}).bind(this),50)}function s(c){var x=n(c,this.assetsPath,this.path),v=createNS("image");isSafari?this.testImageLoaded(v):v.addEventListener("load",this._imageLoaded,!1),v.addEventListener("error",(function(){_.img=i,this._imageLoaded()}).bind(this),!1),v.setAttributeNS("http://www.w3.org/1999/xlink","href",x),this._elementHelper.append?this._elementHelper.append(v):this._elementHelper.appendChild(v);var _={img:v,assetData:c};return _}function a(c){var x=n(c,this.assetsPath,this.path),v=createTag("img");v.crossOrigin="anonymous",v.addEventListener("load",this._imageLoaded,!1),v.addEventListener("error",(function(){_.img=i,this._imageLoaded()}).bind(this),!1),v.src=x;var _={img:v,assetData:c};return _}function o(c){var x={assetData:c},v=n(c,this.assetsPath,this.path);return dataManager.loadData(v,(function(_){x.img=_,this._footageLoaded()}).bind(this),(function(){x.img={},this._footageLoaded()}).bind(this)),x}function l(c,x){this.imagesLoadedCb=x;var v,_=c.length;for(v=0;v<_;v+=1)c[v].layers||(!c[v].t||c[v].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(c[v]))):c[v].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(c[v]))))}function h(c){this.path=c||""}function u(c){this.assetsPath=c||""}function p(c){for(var x=0,v=this.images.length;x<v;){if(this.images[x].assetData===c)return this.images[x].img;x+=1}return null}function f(){this.imagesLoadedCb=null,this.images.length=0}function d(){return this.totalImages===this.loadedAssets}function m(){return this.totalFootages===this.loadedFootagesCount}function g(c,x){c==="svg"?(this._elementHelper=x,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function y(){this._imageLoaded=e.bind(this),this._footageLoaded=t.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=o.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return y.prototype={loadAssets:l,setAssetsPath:u,setPath:h,loadedImages:d,loadedFootages:m,destroy:f,getAsset:p,createImgData:a,createImageData:s,imageLoaded:e,footageLoaded:t,setCacheType:g},y})();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var n=this._cbs[e],r=0;r<n.length;r+=1)n[r](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),(function(){this.removeEventListener(e,t)}).bind(this)},removeEventListener:function(e,t){if(!t)this._cbs[e]=null;else if(this._cbs[e]){for(var n=0,r=this._cbs[e].length;n<r;)this._cbs[e][n]===t&&(this._cbs[e].splice(n,1),n-=1,r-=1),n+=1;this._cbs[e].length||(this._cbs[e]=null)}}};var markerParser=(function(){function i(e){for(var t=e.split(`\r
|
|
2
|
+
`),n={},r,s=0,a=0;a<t.length;a+=1)r=t[a].split(":"),r.length===2&&(n[r[0]]=r[1].trim(),s+=1);if(s===0)throw new Error;return n}return function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e[n],s={time:r.tm,duration:r.dr};try{s.payload=JSON.parse(e[n].cm)}catch{try{s.payload=i(e[n].cm)}catch{s.payload={name:e[n].cm}}}t.push(s)}return t}})(),ProjectInterface=(function(){function i(e){this.compositions.push(e)}return function(){function e(t){for(var n=0,r=this.compositions.length;n<r;){if(this.compositions[n].data&&this.compositions[n].data.nm===t)return this.compositions[n].prepareFrame&&this.compositions[n].data.xt&&this.compositions[n].prepareFrame(this.currentFrame),this.compositions[n].compInterface;n+=1}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=i,e}})(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(i){return renderers[i]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var i in renderers)if(renderers[i])return i;return""}function _typeof$4(i){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(i)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(i){(i.wrapper||i.container)&&(this.wrapper=i.wrapper||i.container);var e="svg";i.animType?e=i.animType:i.renderer&&(e=i.renderer);var t=getRenderer(e);this.renderer=new t(this,i.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,i.loop===""||i.loop===null||i.loop===void 0||i.loop===!0?this.loop=!0:i.loop===!1?this.loop=!1:this.loop=parseInt(i.loop,10),this.autoplay="autoplay"in i?i.autoplay:!0,this.name=i.name?i.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(i,"autoloadSegments")?i.autoloadSegments:!0,this.assetsPath=i.assetsPath,this.initialSegment=i.initialSegment,i.audioFactory&&this.audioController.setAudioFactory(i.audioFactory),i.animationData?this.setupAnimation(i.animationData):i.path&&(i.path.lastIndexOf("\\")!==-1?this.path=i.path.substr(0,i.path.lastIndexOf("\\")+1):this.path=i.path.substr(0,i.path.lastIndexOf("/")+1),this.fileName=i.path.substr(i.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(i.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(i){dataManager.completeAnimation(i,this.configAnimation)},AnimationItem.prototype.setData=function(i,e){e&&_typeof$4(e)!=="object"&&(e=JSON.parse(e));var t={wrapper:i,animationData:e},n=i.attributes;t.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",t.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var r=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";r==="false"?t.loop=!1:r==="true"?t.loop=!0:r!==""&&(t.loop=parseInt(r,10));var s=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:n.getNamedItem("bm-autoplay")?n.getNamedItem("bm-autoplay").value:!0;t.autoplay=s!=="false",t.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"";var a=n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"";a==="false"&&(t.prerender=!1),t.path?this.setParams(t):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(i){i.op>this.animationData.op&&(this.animationData.op=i.op,this.totalFrames=Math.floor(i.op-this.animationData.ip));var e=this.animationData.layers,t,n=e.length,r=i.layers,s,a=r.length;for(s=0;s<a;s+=1)for(t=0;t<n;){if(e[t].id===r[s].id){e[t]=r[s];break}t+=1}if((i.chars||i.fonts)&&(this.renderer.globalData.fontManager.addChars(i.chars),this.renderer.globalData.fontManager.addFonts(i.fonts,this.renderer.globalData.defs)),i.assets)for(n=i.assets.length,t=0;t<n;t+=1)this.animationData.assets.push(i.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(i){this.animationData=i;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var i=this.animationData.segments;if(!i||i.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var e=i.shift();this.timeCompleted=e.time*this.frameRate;var t=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(t,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var i=this.animationData.segments;i||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(i){if(this.renderer)try{this.animationData=i,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(i),i.assets||(i.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(i.assets),this.markers=markerParser(i.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var i=getExpressionsPlugin();i&&i.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(i,e){var t=typeof i=="number"?i:void 0,n=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(t,n)},AnimationItem.prototype.setSubframe=function(i){this.isSubframeEnabled=!!i},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(i){this.triggerRenderFrameError(i)}},AnimationItem.prototype.play=function(i){i&&this.name!==i||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(i){i&&this.name!==i||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(i){i&&this.name!==i||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(i){i&&this.name!==i||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(i){for(var e,t=0;t<this.markers.length;t+=1)if(e=this.markers[t],e.payload&&e.payload.name===i)return e;return null},AnimationItem.prototype.goToAndStop=function(i,e,t){if(!(t&&this.name!==t)){var n=Number(i);if(isNaN(n)){var r=this.getMarkerData(i);r&&this.goToAndStop(r.time,!0)}else e?this.setCurrentRawFrameValue(i):this.setCurrentRawFrameValue(i*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(i,e,t){if(!(t&&this.name!==t)){var n=Number(i);if(isNaN(n)){var r=this.getMarkerData(i);r&&(r.duration?this.playSegments([r.time,r.time+r.duration],!0):this.goToAndStop(r.time,!0))}else this.goToAndStop(n,e,t);this.play()}},AnimationItem.prototype.advanceTime=function(i){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+i*this.frameModifier,t=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(t=!0,e=this.totalFrames-1):e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(t=!0,e=0)):this.setCurrentRawFrameValue(e),t&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(i,e){this.playCount=0,i[1]<i[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=i[0]-i[1],this.timeCompleted=this.totalFrames,this.firstFrame=i[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):i[1]>i[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=i[1]-i[0],this.timeCompleted=this.totalFrames,this.firstFrame=i[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(i,e){var t=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<i?t=i:this.currentRawFrame+this.firstFrame>e&&(t=e-i)),this.firstFrame=i,this.totalFrames=e-i,this.timeCompleted=this.totalFrames,t!==-1&&this.goToAndStop(t,!0)},AnimationItem.prototype.playSegments=function(i,e){if(e&&(this.segments.length=0),_typeof$4(i[0])==="object"){var t,n=i.length;for(t=0;t<n;t+=1)this.segments.push(i[t])}else this.segments.push(i);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(i){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),i&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(i){return this.segments.length?(this.adjustSegment(this.segments.shift(),i),!0):!1},AnimationItem.prototype.destroy=function(i){i&&this.name!==i||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(i){this.currentRawFrame=i,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(i){this.playSpeed=i,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(i){this.playDirection=i<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(i){this.loop=i},AnimationItem.prototype.setVolume=function(i,e){e&&this.name!==e||this.audioController.setVolume(i)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(i){i&&this.name!==i||this.audioController.mute()},AnimationItem.prototype.unmute=function(i){i&&this.name!==i||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(i){var e="";if(i.e)e=i.p;else if(this.assetsPath){var t=i.p;t.indexOf("images/")!==-1&&(t=t.split("/")[1]),e=this.assetsPath+t}else e=this.path,e+=i.u?i.u:"",e+=i.p;return e},AnimationItem.prototype.getAssetData=function(i){for(var e=0,t=this.assets.length;e<t;){if(i===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(i){return i?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(i,e,t){try{var n=this.renderer.getElementByPath(i);n.updateDocumentData(e,t)}catch{}},AnimationItem.prototype.trigger=function(i){if(this._cbs&&this._cbs[i])switch(i){case"enterFrame":this.triggerEvent(i,new BMEnterFrameEvent(i,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(i,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(i,new BMCompleteLoopEvent(i,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(i,new BMCompleteEvent(i,this.frameMult));break;case"segmentStart":this.triggerEvent(i,new BMSegmentStartEvent(i,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(i,new BMDestroyEvent(i,this));break;default:this.triggerEvent(i)}i==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(i,this.currentFrame,this.totalFrames,this.frameMult)),i==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(i,this.loop,this.playCount,this.frameMult)),i==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(i,this.frameMult)),i==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(i,this.firstFrame,this.totalFrames)),i==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(i,this))},AnimationItem.prototype.triggerRenderFrameError=function(i){var e=new BMRenderFrameErrorEvent(i,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},AnimationItem.prototype.triggerConfigError=function(i){var e=new BMConfigErrorEvent(i,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var animationManager=(function(){var i={},e=[],t=0,n=0,r=0,s=!0,a=!1;function o(C){for(var L=0,E=C.target;L<n;)e[L].animation===E&&(e.splice(L,1),L-=1,n-=1,E.isPaused||p()),L+=1}function l(C,L){if(!C)return null;for(var E=0;E<n;){if(e[E].elem===C&&e[E].elem!==null)return e[E].animation;E+=1}var T=new AnimationItem;return f(T,C),T.setData(C,L),T}function h(){var C,L=e.length,E=[];for(C=0;C<L;C+=1)E.push(e[C].animation);return E}function u(){r+=1,P()}function p(){r-=1}function f(C,L){C.addEventListener("destroy",o),C.addEventListener("_active",u),C.addEventListener("_idle",p),e.push({elem:L,animation:C}),n+=1}function d(C){var L=new AnimationItem;return f(L,null),L.setParams(C),L}function m(C,L){var E;for(E=0;E<n;E+=1)e[E].animation.setSpeed(C,L)}function g(C,L){var E;for(E=0;E<n;E+=1)e[E].animation.setDirection(C,L)}function y(C){var L;for(L=0;L<n;L+=1)e[L].animation.play(C)}function c(C){var L=C-t,E;for(E=0;E<n;E+=1)e[E].animation.advanceTime(L);t=C,r&&!a?window.requestAnimationFrame(c):s=!0}function x(C){t=C,window.requestAnimationFrame(c)}function v(C){var L;for(L=0;L<n;L+=1)e[L].animation.pause(C)}function _(C,L,E){var T;for(T=0;T<n;T+=1)e[T].animation.goToAndStop(C,L,E)}function b(C){var L;for(L=0;L<n;L+=1)e[L].animation.stop(C)}function M(C){var L;for(L=0;L<n;L+=1)e[L].animation.togglePause(C)}function A(C){var L;for(L=n-1;L>=0;L-=1)e[L].animation.destroy(C)}function R(C,L,E){var T=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),k,B=T.length;for(k=0;k<B;k+=1)E&&T[k].setAttribute("data-bm-type",E),l(T[k],C);if(L&&B===0){E||(E="svg");var ee=document.getElementsByTagName("body")[0];ee.innerText="";var oe=createTag("div");oe.style.width="100%",oe.style.height="100%",oe.setAttribute("data-bm-type",E),ee.appendChild(oe),l(oe,C)}}function w(){var C;for(C=0;C<n;C+=1)e[C].animation.resize()}function P(){!a&&r&&s&&(window.requestAnimationFrame(x),s=!1)}function N(){a=!0}function V(){a=!1,P()}function G(C,L){var E;for(E=0;E<n;E+=1)e[E].animation.setVolume(C,L)}function H(C){var L;for(L=0;L<n;L+=1)e[L].animation.mute(C)}function O(C){var L;for(L=0;L<n;L+=1)e[L].animation.unmute(C)}return i.registerAnimation=l,i.loadAnimation=d,i.setSpeed=m,i.setDirection=g,i.play=y,i.pause=v,i.stop=b,i.togglePause=M,i.searchAnimations=R,i.resize=w,i.goToAndStop=_,i.destroy=A,i.freeze=N,i.unfreeze=V,i.setVolume=G,i.mute=H,i.unmute=O,i.getRegisteredAnimations=h,i})(),BezierFactory=(function(){var i={};i.getBezierEasing=t;var e={};function t(x,v,_,b,M){var A=M||("bez_"+x+"_"+v+"_"+_+"_"+b).replace(/\./g,"p");if(e[A])return e[A];var R=new c([x,v,_,b]);return e[A]=R,R}var n=4,r=.001,s=1e-7,a=10,o=11,l=1/(o-1),h=typeof Float32Array=="function";function u(x,v){return 1-3*v+3*x}function p(x,v){return 3*v-6*x}function f(x){return 3*x}function d(x,v,_){return((u(v,_)*x+p(v,_))*x+f(v))*x}function m(x,v,_){return 3*u(v,_)*x*x+2*p(v,_)*x+f(v)}function g(x,v,_,b,M){var A,R,w=0;do R=v+(_-v)/2,A=d(R,b,M)-x,A>0?_=R:v=R;while(Math.abs(A)>s&&++w<a);return R}function y(x,v,_,b){for(var M=0;M<n;++M){var A=m(v,_,b);if(A===0)return v;var R=d(v,_,b)-x;v-=R/A}return v}function c(x){this._p=x,this._mSampleValues=h?new Float32Array(o):new Array(o),this._precomputed=!1,this.get=this.get.bind(this)}return c.prototype={get:function(v){var _=this._p[0],b=this._p[1],M=this._p[2],A=this._p[3];return this._precomputed||this._precompute(),_===b&&M===A?v:v===0?0:v===1?1:d(this._getTForX(v),b,A)},_precompute:function(){var v=this._p[0],_=this._p[1],b=this._p[2],M=this._p[3];this._precomputed=!0,(v!==_||b!==M)&&this._calcSampleValues()},_calcSampleValues:function(){for(var v=this._p[0],_=this._p[2],b=0;b<o;++b)this._mSampleValues[b]=d(b*l,v,_)},_getTForX:function(v){for(var _=this._p[0],b=this._p[2],M=this._mSampleValues,A=0,R=1,w=o-1;R!==w&&M[R]<=v;++R)A+=l;--R;var P=(v-M[R])/(M[R+1]-M[R]),N=A+P*l,V=m(N,_,b);return V>=r?y(v,N,_,b):V===0?N:g(v,A,A+l,_,b)}},i})(),pooling=(function(){function i(e){return e.concat(createSizedArray(e.length))}return{double:i}})(),poolFactory=(function(){return function(i,e,t){var n=0,r=i,s=createSizedArray(r),a={newElement:o,release:l};function o(){var h;return n?(n-=1,h=s[n]):h=e(),h}function l(h){n===r&&(s=pooling.double(s),r*=2),t&&t(h),s[n]=h,n+=1}return a}})(),bezierLengthPool=(function(){function i(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,i)})(),segmentsLengthPool=(function(){function i(){return{lengths:[],totalLength:0}}function e(t){var n,r=t.lengths.length;for(n=0;n<r;n+=1)bezierLengthPool.release(t.lengths[n]);t.lengths.length=0}return poolFactory(8,i,e)})();function bezFunction(){var i=Math;function e(f,d,m,g,y,c){var x=f*g+d*y+m*c-y*g-c*f-m*d;return x>-.001&&x<.001}function t(f,d,m,g,y,c,x,v,_){if(m===0&&c===0&&_===0)return e(f,d,g,y,x,v);var b=i.sqrt(i.pow(g-f,2)+i.pow(y-d,2)+i.pow(c-m,2)),M=i.sqrt(i.pow(x-f,2)+i.pow(v-d,2)+i.pow(_-m,2)),A=i.sqrt(i.pow(x-g,2)+i.pow(v-y,2)+i.pow(_-c,2)),R;return b>M?b>A?R=b-M-A:R=A-M-b:A>M?R=A-M-b:R=M-b-A,R>-1e-4&&R<1e-4}var n=(function(){return function(f,d,m,g){var y=getDefaultCurveSegments(),c,x,v,_,b,M=0,A,R=[],w=[],P=bezierLengthPool.newElement();for(v=m.length,c=0;c<y;c+=1){for(b=c/(y-1),A=0,x=0;x<v;x+=1)_=bmPow(1-b,3)*f[x]+3*bmPow(1-b,2)*b*m[x]+3*(1-b)*bmPow(b,2)*g[x]+bmPow(b,3)*d[x],R[x]=_,w[x]!==null&&(A+=bmPow(R[x]-w[x],2)),w[x]=R[x];A&&(A=bmSqrt(A),M+=A),P.percents[c]=b,P.lengths[c]=M}return P.addedLength=M,P}})();function r(f){var d=segmentsLengthPool.newElement(),m=f.c,g=f.v,y=f.o,c=f.i,x,v=f._length,_=d.lengths,b=0;for(x=0;x<v-1;x+=1)_[x]=n(g[x],g[x+1],y[x],c[x+1]),b+=_[x].addedLength;return m&&v&&(_[x]=n(g[x],g[0],y[x],c[0]),b+=_[x].addedLength),d.totalLength=b,d}function s(f){this.segmentLength=0,this.points=new Array(f)}function a(f,d){this.partialLength=f,this.point=d}var o=(function(){var f={};return function(d,m,g,y){var c=(d[0]+"_"+d[1]+"_"+m[0]+"_"+m[1]+"_"+g[0]+"_"+g[1]+"_"+y[0]+"_"+y[1]).replace(/\./g,"p");if(!f[c]){var x=getDefaultCurveSegments(),v,_,b,M,A,R=0,w,P,N=null;d.length===2&&(d[0]!==m[0]||d[1]!==m[1])&&e(d[0],d[1],m[0],m[1],d[0]+g[0],d[1]+g[1])&&e(d[0],d[1],m[0],m[1],m[0]+y[0],m[1]+y[1])&&(x=2);var V=new s(x);for(b=g.length,v=0;v<x;v+=1){for(P=createSizedArray(b),A=v/(x-1),w=0,_=0;_<b;_+=1)M=bmPow(1-A,3)*d[_]+3*bmPow(1-A,2)*A*(d[_]+g[_])+3*(1-A)*bmPow(A,2)*(m[_]+y[_])+bmPow(A,3)*m[_],P[_]=M,N!==null&&(w+=bmPow(P[_]-N[_],2));w=bmSqrt(w),R+=w,V.points[v]=new a(w,P),N=P}V.segmentLength=R,f[c]=V}return f[c]}})();function l(f,d){var m=d.percents,g=d.lengths,y=m.length,c=bmFloor((y-1)*f),x=f*d.addedLength,v=0;if(c===y-1||c===0||x===g[c])return m[c];for(var _=g[c]>x?-1:1,b=!0;b;)if(g[c]<=x&&g[c+1]>x?(v=(x-g[c])/(g[c+1]-g[c]),b=!1):c+=_,c<0||c>=y-1){if(c===y-1)return m[c];b=!1}return m[c]+(m[c+1]-m[c])*v}function h(f,d,m,g,y,c){var x=l(y,c),v=1-x,_=i.round((v*v*v*f[0]+(x*v*v+v*x*v+v*v*x)*m[0]+(x*x*v+v*x*x+x*v*x)*g[0]+x*x*x*d[0])*1e3)/1e3,b=i.round((v*v*v*f[1]+(x*v*v+v*x*v+v*v*x)*m[1]+(x*x*v+v*x*x+x*v*x)*g[1]+x*x*x*d[1])*1e3)/1e3;return[_,b]}var u=createTypedArray("float32",8);function p(f,d,m,g,y,c,x){y<0?y=0:y>1&&(y=1);var v=l(y,x);c=c>1?1:c;var _=l(c,x),b,M=f.length,A=1-v,R=1-_,w=A*A*A,P=v*A*A*3,N=v*v*A*3,V=v*v*v,G=A*A*R,H=v*A*R+A*v*R+A*A*_,O=v*v*R+A*v*_+v*A*_,C=v*v*_,L=A*R*R,E=v*R*R+A*_*R+A*R*_,T=v*_*R+A*_*_+v*R*_,k=v*_*_,B=R*R*R,ee=_*R*R+R*_*R+R*R*_,oe=_*_*R+R*_*_+_*R*_,X=_*_*_;for(b=0;b<M;b+=1)u[b*4]=i.round((w*f[b]+P*m[b]+N*g[b]+V*d[b])*1e3)/1e3,u[b*4+1]=i.round((G*f[b]+H*m[b]+O*g[b]+C*d[b])*1e3)/1e3,u[b*4+2]=i.round((L*f[b]+E*m[b]+T*g[b]+k*d[b])*1e3)/1e3,u[b*4+3]=i.round((B*f[b]+ee*m[b]+oe*g[b]+X*d[b])*1e3)/1e3;return u}return{getSegmentsLength:r,getNewSegment:p,getPointInSegment:h,buildBezierData:o,pointOnLine2D:e,pointOnLine3D:t}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(i,e){var t=this.offsetTime,n;this.propType==="multidimensional"&&(n=createTypedArray("float32",this.pv.length));for(var r=e.lastIndex,s=r,a=this.keyframes.length-1,o=!0,l,h,u;o;){if(l=this.keyframes[s],h=this.keyframes[s+1],s===a-1&&i>=h.t-t){l.h&&(l=h),r=0;break}if(h.t-t>i){r=s;break}s<a-1?s+=1:(r=0,o=!1)}u=this.keyframesMetadata[s]||{};var p,f,d,m,g,y,c=h.t-t,x=l.t-t,v;if(l.to){u.bezierData||(u.bezierData=bez.buildBezierData(l.s,h.s||l.e,l.to,l.ti));var _=u.bezierData;if(i>=c||i<x){var b=i>=c?_.points.length-1:0;for(f=_.points[b].point.length,p=0;p<f;p+=1)n[p]=_.points[b].point[p]}else{u.__fnct?y=u.__fnct:(y=BezierFactory.getBezierEasing(l.o.x,l.o.y,l.i.x,l.i.y,l.n).get,u.__fnct=y),d=y((i-x)/(c-x));var M=_.segmentLength*d,A,R=e.lastFrame<i&&e._lastKeyframeIndex===s?e._lastAddedLength:0;for(g=e.lastFrame<i&&e._lastKeyframeIndex===s?e._lastPoint:0,o=!0,m=_.points.length;o;){if(R+=_.points[g].partialLength,M===0||d===0||g===_.points.length-1){for(f=_.points[g].point.length,p=0;p<f;p+=1)n[p]=_.points[g].point[p];break}else if(M>=R&&M<R+_.points[g+1].partialLength){for(A=(M-R)/_.points[g+1].partialLength,f=_.points[g].point.length,p=0;p<f;p+=1)n[p]=_.points[g].point[p]+(_.points[g+1].point[p]-_.points[g].point[p])*A;break}g<m-1?g+=1:o=!1}e._lastPoint=g,e._lastAddedLength=R-_.points[g].partialLength,e._lastKeyframeIndex=s}}else{var w,P,N,V,G;if(a=l.s.length,v=h.s||l.e,this.sh&&l.h!==1)if(i>=c)n[0]=v[0],n[1]=v[1],n[2]=v[2];else if(i<=x)n[0]=l.s[0],n[1]=l.s[1],n[2]=l.s[2];else{var H=createQuaternion(l.s),O=createQuaternion(v),C=(i-x)/(c-x);quaternionToEuler(n,slerp(H,O,C))}else for(s=0;s<a;s+=1)l.h!==1&&(i>=c?d=1:i<x?d=0:(l.o.x.constructor===Array?(u.__fnct||(u.__fnct=[]),u.__fnct[s]?y=u.__fnct[s]:(w=l.o.x[s]===void 0?l.o.x[0]:l.o.x[s],P=l.o.y[s]===void 0?l.o.y[0]:l.o.y[s],N=l.i.x[s]===void 0?l.i.x[0]:l.i.x[s],V=l.i.y[s]===void 0?l.i.y[0]:l.i.y[s],y=BezierFactory.getBezierEasing(w,P,N,V).get,u.__fnct[s]=y)):u.__fnct?y=u.__fnct:(w=l.o.x,P=l.o.y,N=l.i.x,V=l.i.y,y=BezierFactory.getBezierEasing(w,P,N,V).get,l.keyframeMetadata=y),d=y((i-x)/(c-x)))),v=h.s||l.e,G=l.h===1?l.s[s]:l.s[s]+(v[s]-l.s[s])*d,this.propType==="multidimensional"?n[s]=G:n=G}return e.lastIndex=r,n}function slerp(i,e,t){var n=[],r=i[0],s=i[1],a=i[2],o=i[3],l=e[0],h=e[1],u=e[2],p=e[3],f,d,m,g,y;return d=r*l+s*h+a*u+o*p,d<0&&(d=-d,l=-l,h=-h,u=-u,p=-p),1-d>1e-6?(f=Math.acos(d),m=Math.sin(f),g=Math.sin((1-t)*f)/m,y=Math.sin(t*f)/m):(g=1-t,y=t),n[0]=g*r+y*l,n[1]=g*s+y*h,n[2]=g*a+y*u,n[3]=g*o+y*p,n}function quaternionToEuler(i,e){var t=e[0],n=e[1],r=e[2],s=e[3],a=Math.atan2(2*n*s-2*t*r,1-2*n*n-2*r*r),o=Math.asin(2*t*n+2*r*s),l=Math.atan2(2*t*s-2*n*r,1-2*t*t-2*r*r);i[0]=a/degToRads,i[1]=o/degToRads,i[2]=l/degToRads}function createQuaternion(i){var e=i[0]*degToRads,t=i[1]*degToRads,n=i[2]*degToRads,r=Math.cos(e/2),s=Math.cos(t/2),a=Math.cos(n/2),o=Math.sin(e/2),l=Math.sin(t/2),h=Math.sin(n/2),u=r*s*a-o*l*h,p=o*l*a+r*s*h,f=o*s*a+r*l*h,d=r*l*a-o*s*h;return[p,f,d,u]}function getValueAtCurrentTime(){var i=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,t=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(i===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=t&&i>=t||this._caching.lastFrame<e&&i<e))){this._caching.lastFrame>=i&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var n=this.interpolateValue(i,this._caching);this.pv=n}return this._caching.lastFrame=i,this.pv}function setVValue(i){var e;if(this.propType==="unidimensional")e=i*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var t=0,n=this.v.length;t<n;)e=i[t]*this.mult,mathAbs(this.v[t]-e)>1e-5&&(this.v[t]=e,this._mdf=!0),t+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var i,e=this.effectsSequence.length,t=this.kf?this.pv:this.data.k;for(i=0;i<e;i+=1)t=this.effectsSequence[i](t);this.setVValue(t),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(i){this.effectsSequence.push(i),this.container.addDynamicProperty(this)}function ValueProperty(i,e,t,n){this.propType="unidimensional",this.mult=t||1,this.data=e,this.v=t?e.k*t:e.k,this.pv=e.k,this._mdf=!1,this.elem=i,this.container=n,this.comp=i.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(i,e,t,n){this.propType="multidimensional",this.mult=t||1,this.data=e,this._mdf=!1,this.elem=i,this.container=n,this.comp=i.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r,s=e.k.length;for(this.v=createTypedArray("float32",s),this.pv=createTypedArray("float32",s),this.vel=createTypedArray("float32",s),r=0;r<s;r+=1)this.v[r]=e.k[r]*this.mult,this.pv[r]=e.k[r];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(i,e,t,n){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=i.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=t||1,this.elem=i,this.container=n,this.comp=i.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(i,e,t,n){this.propType="multidimensional";var r,s=e.k.length,a,o,l,h;for(r=0;r<s-1;r+=1)e.k[r].to&&e.k[r].s&&e.k[r+1]&&e.k[r+1].s&&(a=e.k[r].s,o=e.k[r+1].s,l=e.k[r].to,h=e.k[r].ti,(a.length===2&&!(a[0]===o[0]&&a[1]===o[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],a[0]+l[0],a[1]+l[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],o[0]+h[0],o[1]+h[1])||a.length===3&&!(a[0]===o[0]&&a[1]===o[1]&&a[2]===o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],a[0]+l[0],a[1]+l[1],a[2]+l[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],o[0]+h[0],o[1]+h[1],o[2]+h[2]))&&(e.k[r].to=null,e.k[r].ti=null),a[0]===o[0]&&a[1]===o[1]&&l[0]===0&&l[1]===0&&h[0]===0&&h[1]===0&&(a.length===2||a[2]===o[2]&&l[2]===0&&h[2]===0)&&(e.k[r].to=null,e.k[r].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=i.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=t||1,this.elem=i,this.container=n,this.comp=i.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var u=e.k[0].s.length;for(this.v=createTypedArray("float32",u),this.pv=createTypedArray("float32",u),r=0;r<u;r+=1)this.v[r]=initFrame,this.pv[r]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",u)},this.addEffect=addEffect}var PropertyFactory=(function(){function i(t,n,r,s,a){n.sid&&(n=t.globalData.slotManager.getProp(n));var o;if(!n.k.length)o=new ValueProperty(t,n,s,a);else if(typeof n.k[0]=="number")o=new MultiDimensionalProperty(t,n,s,a);else switch(r){case 0:o=new KeyframedValueProperty(t,n,s,a);break;case 1:o=new KeyframedMultidimensionalProperty(t,n,s,a);break}return o.effectsSequence.length&&a.addDynamicProperty(o),o}var e={getProp:i};return e})();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){this.dynamicProperties.indexOf(e)===-1&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var e,t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=(function(){function i(){return createTypedArray("float32",2)}return poolFactory(8,i)})();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(i,e){this.c=i,this.setLength(e);for(var t=0;t<e;)this.v[t]=pointPool.newElement(),this.o[t]=pointPool.newElement(),this.i[t]=pointPool.newElement(),t+=1},ShapePath.prototype.setLength=function(i){for(;this._maxLength<i;)this.doubleArrayLength();this._length=i},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(i,e,t,n,r){var s;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),t){case"v":s=this.v;break;case"i":s=this.i;break;case"o":s=this.o;break;default:s=[];break}(!s[n]||s[n]&&!r)&&(s[n]=pointPool.newElement()),s[n][0]=i,s[n][1]=e},ShapePath.prototype.setTripleAt=function(i,e,t,n,r,s,a,o){this.setXYAt(i,e,"v",a,o),this.setXYAt(t,n,"o",a,o),this.setXYAt(r,s,"i",a,o)},ShapePath.prototype.reverse=function(){var i=new ShapePath;i.setPathData(this.c,this._length);var e=this.v,t=this.o,n=this.i,r=0;this.c&&(i.setTripleAt(e[0][0],e[0][1],n[0][0],n[0][1],t[0][0],t[0][1],0,!1),r=1);var s=this._length-1,a=this._length,o;for(o=r;o<a;o+=1)i.setTripleAt(e[s][0],e[s][1],n[s][0],n[s][1],t[s][0],t[s][1],o,!1),s-=1;return i},ShapePath.prototype.length=function(){return this._length};var shapePool=(function(){function i(){return new ShapePath}function e(r){var s=r._length,a;for(a=0;a<s;a+=1)pointPool.release(r.v[a]),pointPool.release(r.i[a]),pointPool.release(r.o[a]),r.v[a]=null,r.i[a]=null,r.o[a]=null;r._length=0,r.c=!1}function t(r){var s=n.newElement(),a,o=r._length===void 0?r.v.length:r._length;for(s.setLength(o),s.c=r.c,a=0;a<o;a+=1)s.setTripleAt(r.v[a][0],r.v[a][1],r.o[a][0],r.o[a][1],r.i[a][0],r.i[a][1],a);return s}var n=poolFactory(4,i,e);return n.clone=t,n})();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(i){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=i,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var i;for(i=0;i<this._length;i+=1)shapePool.release(this.shapes[i]);this._length=0};var shapeCollectionPool=(function(){var i={newShapeCollection:r,release:s},e=0,t=4,n=createSizedArray(t);function r(){var a;return e?(e-=1,a=n[e]):a=new ShapeCollection,a}function s(a){var o,l=a._length;for(o=0;o<l;o+=1)shapePool.release(a.shapes[o]);a._length=0,e===t&&(n=pooling.double(n),t*=2),n[e]=a,e+=1}return i})(),ShapePropertyFactory=(function(){var i=-999999;function e(c,x,v){var _=v.lastIndex,b,M,A,R,w,P,N,V,G,H=this.keyframes;if(c<H[0].t-this.offsetTime)b=H[0].s[0],A=!0,_=0;else if(c>=H[H.length-1].t-this.offsetTime)b=H[H.length-1].s?H[H.length-1].s[0]:H[H.length-2].e[0],A=!0;else{for(var O=_,C=H.length-1,L=!0,E,T,k;L&&(E=H[O],T=H[O+1],!(T.t-this.offsetTime>c));)O<C-1?O+=1:L=!1;if(k=this.keyframesMetadata[O]||{},A=E.h===1,_=O,!A){if(c>=T.t-this.offsetTime)V=1;else if(c<E.t-this.offsetTime)V=0;else{var B;k.__fnct?B=k.__fnct:(B=BezierFactory.getBezierEasing(E.o.x,E.o.y,E.i.x,E.i.y).get,k.__fnct=B),V=B((c-(E.t-this.offsetTime))/(T.t-this.offsetTime-(E.t-this.offsetTime)))}M=T.s?T.s[0]:E.e[0]}b=E.s[0]}for(P=x._length,N=b.i[0].length,v.lastIndex=_,R=0;R<P;R+=1)for(w=0;w<N;w+=1)G=A?b.i[R][w]:b.i[R][w]+(M.i[R][w]-b.i[R][w])*V,x.i[R][w]=G,G=A?b.o[R][w]:b.o[R][w]+(M.o[R][w]-b.o[R][w])*V,x.o[R][w]=G,G=A?b.v[R][w]:b.v[R][w]+(M.v[R][w]-b.v[R][w])*V,x.v[R][w]=G}function t(){var c=this.comp.renderedFrame-this.offsetTime,x=this.keyframes[0].t-this.offsetTime,v=this.keyframes[this.keyframes.length-1].t-this.offsetTime,_=this._caching.lastFrame;return _!==i&&(_<x&&c<x||_>v&&c>v)||(this._caching.lastIndex=_<c?this._caching.lastIndex:0,this.interpolateShape(c,this.pv,this._caching)),this._caching.lastFrame=c,this.pv}function n(){this.paths=this.localShapeCollection}function r(c,x){if(c._length!==x._length||c.c!==x.c)return!1;var v,_=c._length;for(v=0;v<_;v+=1)if(c.v[v][0]!==x.v[v][0]||c.v[v][1]!==x.v[v][1]||c.o[v][0]!==x.o[v][0]||c.o[v][1]!==x.o[v][1]||c.i[v][0]!==x.i[v][0]||c.i[v][1]!==x.i[v][1])return!1;return!0}function s(c){r(this.v,c)||(this.v=shapePool.clone(c),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var c;this.kf?c=this.pv:this.data.ks?c=this.data.ks.k:c=this.data.pt.k;var x,v=this.effectsSequence.length;for(x=0;x<v;x+=1)c=this.effectsSequence[x](c);this.setVValue(c),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function o(c,x,v){this.propType="shape",this.comp=c.comp,this.container=c,this.elem=c,this.data=x,this.k=!1,this.kf=!1,this._mdf=!1;var _=v===3?x.pt.k:x.ks.k;this.v=shapePool.clone(_),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function l(c){this.effectsSequence.push(c),this.container.addDynamicProperty(this)}o.prototype.interpolateShape=e,o.prototype.getValue=a,o.prototype.setVValue=s,o.prototype.addEffect=l;function h(c,x,v){this.propType="shape",this.comp=c.comp,this.elem=c,this.container=c,this.offsetTime=c.data.st,this.keyframes=v===3?x.pt.k:x.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var _=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,_),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=i,this.reset=n,this._caching={lastFrame:i,lastIndex:0},this.effectsSequence=[t.bind(this)]}h.prototype.getValue=a,h.prototype.interpolateShape=e,h.prototype.setVValue=s,h.prototype.addEffect=l;var u=(function(){var c=roundCorner;function x(v,_){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=_.d,this.elem=v,this.comp=v.comp,this.frameId=-1,this.initDynamicPropertyContainer(v),this.p=PropertyFactory.getProp(v,_.p,1,0,this),this.s=PropertyFactory.getProp(v,_.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return x.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var _=this.p.v[0],b=this.p.v[1],M=this.s.v[0]/2,A=this.s.v[1]/2,R=this.d!==3,w=this.v;w.v[0][0]=_,w.v[0][1]=b-A,w.v[1][0]=R?_+M:_-M,w.v[1][1]=b,w.v[2][0]=_,w.v[2][1]=b+A,w.v[3][0]=R?_-M:_+M,w.v[3][1]=b,w.i[0][0]=R?_-M*c:_+M*c,w.i[0][1]=b-A,w.i[1][0]=R?_+M:_-M,w.i[1][1]=b-A*c,w.i[2][0]=R?_+M*c:_-M*c,w.i[2][1]=b+A,w.i[3][0]=R?_-M:_+M,w.i[3][1]=b+A*c,w.o[0][0]=R?_+M*c:_-M*c,w.o[0][1]=b-A,w.o[1][0]=R?_+M:_-M,w.o[1][1]=b+A*c,w.o[2][0]=R?_-M*c:_+M*c,w.o[2][1]=b+A,w.o[3][0]=R?_-M:_+M,w.o[3][1]=b-A*c}},extendPrototype([DynamicPropertyContainer],x),x})(),p=(function(){function c(x,v){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=x,this.comp=x.comp,this.data=v,this.frameId=-1,this.d=v.d,this.initDynamicPropertyContainer(x),v.sy===1?(this.ir=PropertyFactory.getProp(x,v.ir,0,0,this),this.is=PropertyFactory.getProp(x,v.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(x,v.pt,0,0,this),this.p=PropertyFactory.getProp(x,v.p,1,0,this),this.r=PropertyFactory.getProp(x,v.r,0,degToRads,this),this.or=PropertyFactory.getProp(x,v.or,0,0,this),this.os=PropertyFactory.getProp(x,v.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return c.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var v=Math.floor(this.pt.v)*2,_=Math.PI*2/v,b=!0,M=this.or.v,A=this.ir.v,R=this.os.v,w=this.is.v,P=2*Math.PI*M/(v*2),N=2*Math.PI*A/(v*2),V,G,H,O,C=-Math.PI/2;C+=this.r.v;var L=this.data.d===3?-1:1;for(this.v._length=0,V=0;V<v;V+=1){G=b?M:A,H=b?R:w,O=b?P:N;var E=G*Math.cos(C),T=G*Math.sin(C),k=E===0&&T===0?0:T/Math.sqrt(E*E+T*T),B=E===0&&T===0?0:-E/Math.sqrt(E*E+T*T);E+=+this.p.v[0],T+=+this.p.v[1],this.v.setTripleAt(E,T,E-k*O*H*L,T-B*O*H*L,E+k*O*H*L,T+B*O*H*L,V,!0),b=!b,C+=_*L}},convertPolygonToPath:function(){var v=Math.floor(this.pt.v),_=Math.PI*2/v,b=this.or.v,M=this.os.v,A=2*Math.PI*b/(v*4),R,w=-Math.PI*.5,P=this.data.d===3?-1:1;for(w+=this.r.v,this.v._length=0,R=0;R<v;R+=1){var N=b*Math.cos(w),V=b*Math.sin(w),G=N===0&&V===0?0:V/Math.sqrt(N*N+V*V),H=N===0&&V===0?0:-N/Math.sqrt(N*N+V*V);N+=+this.p.v[0],V+=+this.p.v[1],this.v.setTripleAt(N,V,N-G*A*M*P,V-H*A*M*P,N+G*A*M*P,V+H*A*M*P,R,!0),w+=_*P}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],c),c})(),f=(function(){function c(x,v){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=x,this.comp=x.comp,this.frameId=-1,this.d=v.d,this.initDynamicPropertyContainer(x),this.p=PropertyFactory.getProp(x,v.p,1,0,this),this.s=PropertyFactory.getProp(x,v.s,1,0,this),this.r=PropertyFactory.getProp(x,v.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return c.prototype={convertRectToPath:function(){var v=this.p.v[0],_=this.p.v[1],b=this.s.v[0]/2,M=this.s.v[1]/2,A=bmMin(b,M,this.r.v),R=A*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(v+b,_-M+A,v+b,_-M+A,v+b,_-M+R,0,!0),this.v.setTripleAt(v+b,_+M-A,v+b,_+M-R,v+b,_+M-A,1,!0),A!==0?(this.v.setTripleAt(v+b-A,_+M,v+b-A,_+M,v+b-R,_+M,2,!0),this.v.setTripleAt(v-b+A,_+M,v-b+R,_+M,v-b+A,_+M,3,!0),this.v.setTripleAt(v-b,_+M-A,v-b,_+M-A,v-b,_+M-R,4,!0),this.v.setTripleAt(v-b,_-M+A,v-b,_-M+R,v-b,_-M+A,5,!0),this.v.setTripleAt(v-b+A,_-M,v-b+A,_-M,v-b+R,_-M,6,!0),this.v.setTripleAt(v+b-A,_-M,v+b-R,_-M,v+b-A,_-M,7,!0)):(this.v.setTripleAt(v-b,_+M,v-b+R,_+M,v-b,_+M,2),this.v.setTripleAt(v-b,_-M,v-b,_-M+R,v-b,_-M,3))):(this.v.setTripleAt(v+b,_-M+A,v+b,_-M+R,v+b,_-M+A,0,!0),A!==0?(this.v.setTripleAt(v+b-A,_-M,v+b-A,_-M,v+b-R,_-M,1,!0),this.v.setTripleAt(v-b+A,_-M,v-b+R,_-M,v-b+A,_-M,2,!0),this.v.setTripleAt(v-b,_-M+A,v-b,_-M+A,v-b,_-M+R,3,!0),this.v.setTripleAt(v-b,_+M-A,v-b,_+M-R,v-b,_+M-A,4,!0),this.v.setTripleAt(v-b+A,_+M,v-b+A,_+M,v-b+R,_+M,5,!0),this.v.setTripleAt(v+b-A,_+M,v+b-R,_+M,v+b-A,_+M,6,!0),this.v.setTripleAt(v+b,_+M-A,v+b,_+M-A,v+b,_+M-R,7,!0)):(this.v.setTripleAt(v-b,_-M,v-b+R,_-M,v-b,_-M,1,!0),this.v.setTripleAt(v-b,_+M,v-b,_+M-R,v-b,_+M,2,!0),this.v.setTripleAt(v+b,_+M,v+b-R,_+M,v+b,_+M,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],c),c})();function d(c,x,v){var _;if(v===3||v===4){var b=v===3?x.pt:x.ks,M=b.k;M.length?_=new h(c,x,v):_=new o(c,x,v)}else v===5?_=new f(c,x):v===6?_=new u(c,x):v===7&&(_=new p(c,x));return _.k&&c.addDynamicProperty(_),_}function m(){return o}function g(){return h}var y={};return y.getShapeProp=d,y.getConstructorFunction=m,y.getKeyframedConstructorFunction=g,y})();var Matrix=(function(){var i=Math.cos,e=Math.sin,t=Math.tan,n=Math.round;function r(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function s(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(T,-k,0,0,k,T,0,0,0,0,1,0,0,0,0,1)}function a(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(1,0,0,0,0,T,-k,0,0,k,T,0,0,0,0,1)}function o(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(T,0,k,0,0,1,0,0,-k,0,T,0,0,0,0,1)}function l(E){if(E===0)return this;var T=i(E),k=e(E);return this._t(T,-k,0,0,k,T,0,0,0,0,1,0,0,0,0,1)}function h(E,T){return this._t(1,T,E,1,0,0)}function u(E,T){return this.shear(t(E),t(T))}function p(E,T){var k=i(T),B=e(T);return this._t(k,B,0,0,-B,k,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,t(E),1,0,0,0,0,1,0,0,0,0,1)._t(k,-B,0,0,B,k,0,0,0,0,1,0,0,0,0,1)}function f(E,T,k){return!k&&k!==0&&(k=1),E===1&&T===1&&k===1?this:this._t(E,0,0,0,0,T,0,0,0,0,k,0,0,0,0,1)}function d(E,T,k,B,ee,oe,X,Q,ne,re,me,Fe,Ee,Ne,Be,_e){return this.props[0]=E,this.props[1]=T,this.props[2]=k,this.props[3]=B,this.props[4]=ee,this.props[5]=oe,this.props[6]=X,this.props[7]=Q,this.props[8]=ne,this.props[9]=re,this.props[10]=me,this.props[11]=Fe,this.props[12]=Ee,this.props[13]=Ne,this.props[14]=Be,this.props[15]=_e,this}function m(E,T,k){return k=k||0,E!==0||T!==0||k!==0?this._t(1,0,0,0,0,1,0,0,0,0,1,0,E,T,k,1):this}function g(E,T,k,B,ee,oe,X,Q,ne,re,me,Fe,Ee,Ne,Be,_e){var U=this.props;if(E===1&&T===0&&k===0&&B===0&&ee===0&&oe===1&&X===0&&Q===0&&ne===0&&re===0&&me===1&&Fe===0)return U[12]=U[12]*E+U[15]*Ee,U[13]=U[13]*oe+U[15]*Ne,U[14]=U[14]*me+U[15]*Be,U[15]*=_e,this._identityCalculated=!1,this;var qe=U[0],Le=U[1],Ie=U[2],ge=U[3],ke=U[4],ve=U[5],D=U[6],I=U[7],q=U[8],J=U[9],te=U[10],K=U[11],de=U[12],le=U[13],Me=U[14],be=U[15];return U[0]=qe*E+Le*ee+Ie*ne+ge*Ee,U[1]=qe*T+Le*oe+Ie*re+ge*Ne,U[2]=qe*k+Le*X+Ie*me+ge*Be,U[3]=qe*B+Le*Q+Ie*Fe+ge*_e,U[4]=ke*E+ve*ee+D*ne+I*Ee,U[5]=ke*T+ve*oe+D*re+I*Ne,U[6]=ke*k+ve*X+D*me+I*Be,U[7]=ke*B+ve*Q+D*Fe+I*_e,U[8]=q*E+J*ee+te*ne+K*Ee,U[9]=q*T+J*oe+te*re+K*Ne,U[10]=q*k+J*X+te*me+K*Be,U[11]=q*B+J*Q+te*Fe+K*_e,U[12]=de*E+le*ee+Me*ne+be*Ee,U[13]=de*T+le*oe+Me*re+be*Ne,U[14]=de*k+le*X+Me*me+be*Be,U[15]=de*B+le*Q+Me*Fe+be*_e,this._identityCalculated=!1,this}function y(E){var T=E.props;return this.transform(T[0],T[1],T[2],T[3],T[4],T[5],T[6],T[7],T[8],T[9],T[10],T[11],T[12],T[13],T[14],T[15])}function c(){return this._identityCalculated||(this._identity=!(this.props[0]!==1||this.props[1]!==0||this.props[2]!==0||this.props[3]!==0||this.props[4]!==0||this.props[5]!==1||this.props[6]!==0||this.props[7]!==0||this.props[8]!==0||this.props[9]!==0||this.props[10]!==1||this.props[11]!==0||this.props[12]!==0||this.props[13]!==0||this.props[14]!==0||this.props[15]!==1),this._identityCalculated=!0),this._identity}function x(E){for(var T=0;T<16;){if(E.props[T]!==this.props[T])return!1;T+=1}return!0}function v(E){var T;for(T=0;T<16;T+=1)E.props[T]=this.props[T];return E}function _(E){var T;for(T=0;T<16;T+=1)this.props[T]=E[T]}function b(E,T,k){return{x:E*this.props[0]+T*this.props[4]+k*this.props[8]+this.props[12],y:E*this.props[1]+T*this.props[5]+k*this.props[9]+this.props[13],z:E*this.props[2]+T*this.props[6]+k*this.props[10]+this.props[14]}}function M(E,T,k){return E*this.props[0]+T*this.props[4]+k*this.props[8]+this.props[12]}function A(E,T,k){return E*this.props[1]+T*this.props[5]+k*this.props[9]+this.props[13]}function R(E,T,k){return E*this.props[2]+T*this.props[6]+k*this.props[10]+this.props[14]}function w(){var E=this.props[0]*this.props[5]-this.props[1]*this.props[4],T=this.props[5]/E,k=-this.props[1]/E,B=-this.props[4]/E,ee=this.props[0]/E,oe=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/E,X=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/E,Q=new Matrix;return Q.props[0]=T,Q.props[1]=k,Q.props[4]=B,Q.props[5]=ee,Q.props[12]=oe,Q.props[13]=X,Q}function P(E){var T=this.getInverseMatrix();return T.applyToPointArray(E[0],E[1],E[2]||0)}function N(E){var T,k=E.length,B=[];for(T=0;T<k;T+=1)B[T]=P(E[T]);return B}function V(E,T,k){var B=createTypedArray("float32",6);if(this.isIdentity())B[0]=E[0],B[1]=E[1],B[2]=T[0],B[3]=T[1],B[4]=k[0],B[5]=k[1];else{var ee=this.props[0],oe=this.props[1],X=this.props[4],Q=this.props[5],ne=this.props[12],re=this.props[13];B[0]=E[0]*ee+E[1]*X+ne,B[1]=E[0]*oe+E[1]*Q+re,B[2]=T[0]*ee+T[1]*X+ne,B[3]=T[0]*oe+T[1]*Q+re,B[4]=k[0]*ee+k[1]*X+ne,B[5]=k[0]*oe+k[1]*Q+re}return B}function G(E,T,k){var B;return this.isIdentity()?B=[E,T,k]:B=[E*this.props[0]+T*this.props[4]+k*this.props[8]+this.props[12],E*this.props[1]+T*this.props[5]+k*this.props[9]+this.props[13],E*this.props[2]+T*this.props[6]+k*this.props[10]+this.props[14]],B}function H(E,T){if(this.isIdentity())return E+","+T;var k=this.props;return Math.round((E*k[0]+T*k[4]+k[12])*100)/100+","+Math.round((E*k[1]+T*k[5]+k[13])*100)/100}function O(){for(var E=0,T=this.props,k="matrix3d(",B=1e4;E<16;)k+=n(T[E]*B)/B,k+=E===15?")":",",E+=1;return k}function C(E){var T=1e4;return E<1e-6&&E>0||E>-1e-6&&E<0?n(E*T)/T:E}function L(){var E=this.props,T=C(E[0]),k=C(E[1]),B=C(E[4]),ee=C(E[5]),oe=C(E[12]),X=C(E[13]);return"matrix("+T+","+k+","+B+","+ee+","+oe+","+X+")"}return function(){this.reset=r,this.rotate=s,this.rotateX=a,this.rotateY=o,this.rotateZ=l,this.skew=u,this.skewFromAxis=p,this.shear=h,this.scale=f,this.setTransform=d,this.translate=m,this.transform=g,this.multiply=y,this.applyToPoint=b,this.applyToX=M,this.applyToY=A,this.applyToZ=R,this.applyToPointArray=G,this.applyToTriplePoints=V,this.applyToPointStringified=H,this.toCSS=O,this.to2dCSS=L,this.clone=v,this.cloneFromProps=_,this.equals=x,this.inversePoints=N,this.inversePoint=P,this.getInverseMatrix=w,this._t=this.transform,this.isIdentity=c,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}})();function _typeof$3(i){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(i)}var lottie={};function setLocation(i){setLocationHref(i)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(i){setSubframeEnabled(i)}function setPrefix(i){setIdPrefix(i)}function loadAnimation(i){return animationManager.loadAnimation(i)}function setQuality(i){if(typeof i=="string")switch(i){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(i)&&i>1&&setDefaultCurveSegments(i)}function inBrowser(){return typeof navigator<"u"}function installPlugin(i,e){i==="expressions"&&setExpressionsPlugin(e)}function getFactory(i){switch(i){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(i){for(var e=queryString.split("&"),t=0;t<e.length;t+=1){var n=e[t].split("=");if(decodeURIComponent(n[0])==i)return decodeURIComponent(n[1])}return null}var queryString="";{var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);try{_typeof$3(exports)!=="object"&&(window.bodymovin=lottie)}catch(i){}var ShapeModifiers=(function(){var i={},e={};i.registerModifier=t,i.getModifier=n;function t(r,s){e[r]||(e[r]=s)}function n(r,s,a){return new e[r](s,a)}return i})();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(i){if(!this.closed){i.sh.container.addDynamicProperty(i.sh);var e={shape:i.sh,data:i,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&i.setAsAnimated()}},ShapeModifier.prototype.init=function(i,e){this.shapes=[],this.elem=i,this.initDynamicPropertyContainer(i),this.initModifierProperties(i,e),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(i,e){this.s=PropertyFactory.getProp(i,e.s,0,.01,this),this.e=PropertyFactory.getProp(i,e.e,0,.01,this),this.o=PropertyFactory.getProp(i,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(i){i.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(i,e,t,n,r){var s=[];e<=1?s.push({s:i,e}):i>=1?s.push({s:i-1,e:e-1}):(s.push({s:i,e:1}),s.push({s:0,e:e-1}));var a=[],o,l=s.length,h;for(o=0;o<l;o+=1)if(h=s[o],!(h.e*r<n||h.s*r>n+t)){var u,p;h.s*r<=n?u=0:u=(h.s*r-n)/t,h.e*r>=n+t?p=1:p=(h.e*r-n)/t,a.push([u,p])}return a.length||a.push([0,0]),a},TrimModifier.prototype.releasePathsData=function(i){var e,t=i.length;for(e=0;e<t;e+=1)segmentsLengthPool.release(i[e]);return i.length=0,i},TrimModifier.prototype.processShapes=function(i){var e,t;if(this._mdf||i){var n=this.o.v%360/360;if(n<0&&(n+=1),this.s.v>1?e=1+n:this.s.v<0?e=0+n:e=this.s.v+n,this.e.v>1?t=1+n:this.e.v<0?t=0+n:t=this.e.v+n,e>t){var r=e;e=t,t=r}e=Math.round(e*1e4)*1e-4,t=Math.round(t*1e4)*1e-4,this.sValue=e,this.eValue=t}else e=this.sValue,t=this.eValue;var s,a,o=this.shapes.length,l,h,u,p,f,d=0;if(t===e)for(a=0;a<o;a+=1)this.shapes[a].localShapeCollection.releaseShapes(),this.shapes[a].shape._mdf=!0,this.shapes[a].shape.paths=this.shapes[a].localShapeCollection,this._mdf&&(this.shapes[a].pathsData.length=0);else if(t===1&&e===0||t===0&&e===1){if(this._mdf)for(a=0;a<o;a+=1)this.shapes[a].pathsData.length=0,this.shapes[a].shape._mdf=!0}else{var m=[],g,y;for(a=0;a<o;a+=1)if(g=this.shapes[a],!g.shape._mdf&&!this._mdf&&!i&&this.m!==2)g.shape.paths=g.localShapeCollection;else{if(s=g.shape.paths,h=s._length,f=0,!g.shape._mdf&&g.pathsData.length)f=g.totalShapeLength;else{for(u=this.releasePathsData(g.pathsData),l=0;l<h;l+=1)p=bez.getSegmentsLength(s.shapes[l]),u.push(p),f+=p.totalLength;g.totalShapeLength=f,g.pathsData=u}d+=f,g.shape._mdf=!0}var c=e,x=t,v=0,_;for(a=o-1;a>=0;a-=1)if(g=this.shapes[a],g.shape._mdf){for(y=g.localShapeCollection,y.releaseShapes(),this.m===2&&o>1?(_=this.calculateShapeEdges(e,t,g.totalShapeLength,v,d),v+=g.totalShapeLength):_=[[c,x]],h=_.length,l=0;l<h;l+=1){c=_[l][0],x=_[l][1],m.length=0,x<=1?m.push({s:g.totalShapeLength*c,e:g.totalShapeLength*x}):c>=1?m.push({s:g.totalShapeLength*(c-1),e:g.totalShapeLength*(x-1)}):(m.push({s:g.totalShapeLength*c,e:g.totalShapeLength}),m.push({s:0,e:g.totalShapeLength*(x-1)}));var b=this.addShapes(g,m[0]);if(m[0].s!==m[0].e){if(m.length>1){var M=g.shape.paths.shapes[g.shape.paths._length-1];if(M.c){var A=b.pop();this.addPaths(b,y),b=this.addShapes(g,m[1],A)}else this.addPaths(b,y),b=this.addShapes(g,m[1])}this.addPaths(b,y)}}g.shape.paths=y}}},TrimModifier.prototype.addPaths=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)e.addShape(i[t])},TrimModifier.prototype.addSegment=function(i,e,t,n,r,s,a){r.setXYAt(e[0],e[1],"o",s),r.setXYAt(t[0],t[1],"i",s+1),a&&r.setXYAt(i[0],i[1],"v",s),r.setXYAt(n[0],n[1],"v",s+1)},TrimModifier.prototype.addSegmentFromArray=function(i,e,t,n){e.setXYAt(i[1],i[5],"o",t),e.setXYAt(i[2],i[6],"i",t+1),n&&e.setXYAt(i[0],i[4],"v",t),e.setXYAt(i[3],i[7],"v",t+1)},TrimModifier.prototype.addShapes=function(i,e,t){var n=i.pathsData,r=i.shape.paths.shapes,s,a=i.shape.paths._length,o,l,h=0,u,p,f,d,m=[],g,y=!0;for(t?(p=t._length,g=t._length):(t=shapePool.newElement(),p=0,g=0),m.push(t),s=0;s<a;s+=1){for(f=n[s].lengths,t.c=r[s].c,l=r[s].c?f.length:f.length+1,o=1;o<l;o+=1)if(u=f[o-1],h+u.addedLength<e.s)h+=u.addedLength,t.c=!1;else if(h>e.e){t.c=!1;break}else e.s<=h&&e.e>=h+u.addedLength?(this.addSegment(r[s].v[o-1],r[s].o[o-1],r[s].i[o],r[s].v[o],t,p,y),y=!1):(d=bez.getNewSegment(r[s].v[o-1],r[s].v[o],r[s].o[o-1],r[s].i[o],(e.s-h)/u.addedLength,(e.e-h)/u.addedLength,f[o-1]),this.addSegmentFromArray(d,t,p,y),y=!1,t.c=!1),h+=u.addedLength,p+=1;if(r[s].c&&f.length){if(u=f[o-1],h<=e.e){var c=f[o-1].addedLength;e.s<=h&&e.e>=h+c?(this.addSegment(r[s].v[o-1],r[s].o[o-1],r[s].i[0],r[s].v[0],t,p,y),y=!1):(d=bez.getNewSegment(r[s].v[o-1],r[s].v[0],r[s].o[o-1],r[s].i[0],(e.s-h)/c,(e.e-h)/c,f[o-1]),this.addSegmentFromArray(d,t,p,y),y=!1,t.c=!1)}else t.c=!1;h+=u.addedLength,p+=1}if(t._length&&(t.setXYAt(t.v[g][0],t.v[g][1],"i",g),t.setXYAt(t.v[t._length-1][0],t.v[t._length-1][1],"o",t._length-1)),h>e.e)break;s<a-1&&(t=shapePool.newElement(),y=!0,m.push(t),p=0)}return m};function PuckerAndBloatModifier(){}extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(i,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(i,e){var t=e/100,n=[0,0],r=i._length,s=0;for(s=0;s<r;s+=1)n[0]+=i.v[s][0],n[1]+=i.v[s][1];n[0]/=r,n[1]/=r;var a=shapePool.newElement();a.c=i.c;var o,l,h,u,p,f;for(s=0;s<r;s+=1)o=i.v[s][0]+(n[0]-i.v[s][0])*t,l=i.v[s][1]+(n[1]-i.v[s][1])*t,h=i.o[s][0]+(n[0]-i.o[s][0])*-t,u=i.o[s][1]+(n[1]-i.o[s][1])*-t,p=i.i[s][0]+(n[0]-i.i[s][0])*-t,f=i.i[s][1]+(n[1]-i.i[s][1])*-t,a.setTripleAt(o,l,h,u,p,f,s);return a},PuckerAndBloatModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.amount.v;if(a!==0){var o,l;for(t=0;t<n;t+=1){if(o=this.shapes[t],l=o.localShapeCollection,!(!o.shape._mdf&&!this._mdf&&!i))for(l.releaseShapes(),o.shape._mdf=!0,e=o.shape.paths.shapes,s=o.shape.paths._length,r=0;r<s;r+=1)l.addShape(this.processPath(e[r],a));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=(function(){var i=[0,0];function e(l){var h=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||h,this.a&&l.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&l.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&l.skewFromAxis(-this.sk.v,this.sa.v),this.r?l.rotate(-this.r.v):l.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?l.translate(this.px.v,this.py.v,-this.pz.v):l.translate(this.px.v,this.py.v,0):l.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function t(l){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||l){var h;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var u,p;if(h=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(u=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/h,0),p=this.p.getValueAtTime(this.p.keyframes[0].t/h,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(u=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/h,0),p=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/h,0)):(u=this.p.pv,p=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/h,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){u=[],p=[];var f=this.px,d=this.py;f._caching.lastFrame+f.offsetTime<=f.keyframes[0].t?(u[0]=f.getValueAtTime((f.keyframes[0].t+.01)/h,0),u[1]=d.getValueAtTime((d.keyframes[0].t+.01)/h,0),p[0]=f.getValueAtTime(f.keyframes[0].t/h,0),p[1]=d.getValueAtTime(d.keyframes[0].t/h,0)):f._caching.lastFrame+f.offsetTime>=f.keyframes[f.keyframes.length-1].t?(u[0]=f.getValueAtTime(f.keyframes[f.keyframes.length-1].t/h,0),u[1]=d.getValueAtTime(d.keyframes[d.keyframes.length-1].t/h,0),p[0]=f.getValueAtTime((f.keyframes[f.keyframes.length-1].t-.01)/h,0),p[1]=d.getValueAtTime((d.keyframes[d.keyframes.length-1].t-.01)/h,0)):(u=[f.pv,d.pv],p[0]=f.getValueAtTime((f._caching.lastFrame+f.offsetTime-.01)/h,f.offsetTime),p[1]=d.getValueAtTime((d._caching.lastFrame+d.offsetTime-.01)/h,d.offsetTime))}else p=i,u=p;this.v.rotate(-Math.atan2(u[1]-p[1],u[0]-p[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function n(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function r(){}function s(l){this._addDynamicProperty(l),this.elem.addDynamicProperty(l),this._isDirty=!0}function a(l,h,u){if(this.elem=l,this.frameId=-1,this.propType="transform",this.data=h,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(u||l),h.p&&h.p.s?(this.px=PropertyFactory.getProp(l,h.p.x,0,0,this),this.py=PropertyFactory.getProp(l,h.p.y,0,0,this),h.p.z&&(this.pz=PropertyFactory.getProp(l,h.p.z,0,0,this))):this.p=PropertyFactory.getProp(l,h.p||{k:[0,0,0]},1,0,this),h.rx){if(this.rx=PropertyFactory.getProp(l,h.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(l,h.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(l,h.rz,0,degToRads,this),h.or.k[0].ti){var p,f=h.or.k.length;for(p=0;p<f;p+=1)h.or.k[p].to=null,h.or.k[p].ti=null}this.or=PropertyFactory.getProp(l,h.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(l,h.r||{k:0},0,degToRads,this);h.sk&&(this.sk=PropertyFactory.getProp(l,h.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(l,h.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(l,h.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(l,h.s||{k:[100,100,100]},1,.01,this),h.o?this.o=PropertyFactory.getProp(l,h.o,0,.01,l):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}a.prototype={applyToMatrix:e,getValue:t,precalculateMatrix:n,autoOrient:r},extendPrototype([DynamicPropertyContainer],a),a.prototype.addDynamicProperty=s,a.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty;function o(l,h,u){return new a(l,h,u)}return{getTransformProperty:o}})();function RepeaterModifier(){}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(i,e.c,0,null,this),this.o=PropertyFactory.getProp(i,e.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(i,e.tr,this),this.so=PropertyFactory.getProp(i,e.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(i,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(i,e,t,n,r,s){var a=s?-1:1,o=n.s.v[0]+(1-n.s.v[0])*(1-r),l=n.s.v[1]+(1-n.s.v[1])*(1-r);i.translate(n.p.v[0]*a*r,n.p.v[1]*a*r,n.p.v[2]),e.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),e.rotate(-n.r.v*a*r),e.translate(n.a.v[0],n.a.v[1],n.a.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.scale(s?1/o:o,s?1/l:l),t.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(i,e,t,n){for(this.elem=i,this.arr=e,this.pos=t,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(i),this.initModifierProperties(i,e[t]);t>0;)t-=1,this._elements.unshift(e[t]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(i){var e,t=i.length;for(e=0;e<t;e+=1)i[e]._processed=!1,i[e].ty==="gr"&&this.resetElements(i[e].it)},RepeaterModifier.prototype.cloneElements=function(i){var e=JSON.parse(JSON.stringify(i));return this.resetElements(e),e},RepeaterModifier.prototype.changeGroupRender=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)i[t]._render=e,i[t].ty==="gr"&&this.changeGroupRender(i[t].it,e)},RepeaterModifier.prototype.processShapes=function(i){var e,t,n,r,s,a=!1;if(this._mdf||i){var o=Math.ceil(this.c.v);if(this._groups.length<o){for(;this._groups.length<o;){var l={it:this.cloneElements(this._elements),ty:"gr"};l.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,l),this._groups.splice(0,0,l),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}s=0;var h;for(n=0;n<=this._groups.length-1;n+=1){if(h=s<o,this._groups[n]._render=h,this.changeGroupRender(this._groups[n].it,h),!h){var u=this.elemsData[n].it,p=u[u.length-1];p.transform.op.v!==0?(p.transform.op._mdf=!0,p.transform.op.v=0):p.transform.op._mdf=!1}s+=1}this._currentCopies=o;var f=this.o.v,d=f%1,m=f>0?Math.floor(f):Math.ceil(f),g=this.pMatrix.props,y=this.rMatrix.props,c=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var x=0;if(f>0){for(;x<m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),x+=1;d&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,d,!1),x+=d)}else if(f<0){for(;x>m;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;d&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-d,!0),x-=d)}n=this.data.m===1?0:this._currentCopies-1,r=this.data.m===1?1:-1,s=this._currentCopies;for(var v,_;s;){if(e=this.elemsData[n].it,t=e[e.length-1].transform.mProps.v.props,_=t.length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),x!==0){for((n!==0&&r===1||n!==this._currentCopies-1&&r===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),v=0;v<_;v+=1)t[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<_;v+=1)t[v]=this.matrix.props[v];x+=1,s-=1,n+=r}}else for(s=this._currentCopies,n=0,r=1;s;)e=this.elemsData[n].it,t=e[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,s-=1,n+=r;return a},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(i,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(i,e){var t=shapePool.newElement();t.c=i.c;var n,r=i._length,s,a,o,l,h,u,p=0,f,d,m,g,y,c;for(n=0;n<r;n+=1)s=i.v[n],o=i.o[n],a=i.i[n],s[0]===o[0]&&s[1]===o[1]&&s[0]===a[0]&&s[1]===a[1]?(n===0||n===r-1)&&!i.c?(t.setTripleAt(s[0],s[1],o[0],o[1],a[0],a[1],p),p+=1):(n===0?l=i.v[r-1]:l=i.v[n-1],h=Math.sqrt(Math.pow(s[0]-l[0],2)+Math.pow(s[1]-l[1],2)),u=h?Math.min(h/2,e)/h:0,y=s[0]+(l[0]-s[0])*u,f=y,c=s[1]-(s[1]-l[1])*u,d=c,m=f-(f-s[0])*roundCorner,g=d-(d-s[1])*roundCorner,t.setTripleAt(f,d,m,g,y,c,p),p+=1,n===r-1?l=i.v[0]:l=i.v[n+1],h=Math.sqrt(Math.pow(s[0]-l[0],2)+Math.pow(s[1]-l[1],2)),u=h?Math.min(h/2,e)/h:0,m=s[0]+(l[0]-s[0])*u,f=m,g=s[1]+(l[1]-s[1])*u,d=g,y=f-(f-s[0])*roundCorner,c=d-(d-s[1])*roundCorner,t.setTripleAt(f,d,m,g,y,c,p),p+=1):(t.setTripleAt(i.v[n][0],i.v[n][1],i.o[n][0],i.o[n][1],i.i[n][0],i.i[n][1],p),p+=1);return t},RoundCornersModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.rd.v;if(a!==0){var o,l;for(t=0;t<n;t+=1){if(o=this.shapes[t],l=o.localShapeCollection,!(!o.shape._mdf&&!this._mdf&&!i))for(l.releaseShapes(),o.shape._mdf=!0,e=o.shape.paths.shapes,s=o.shape.paths._length,r=0;r<s;r+=1)l.addShape(this.processPath(e[r],a));o.shape.paths=o.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function floatEqual(i,e){return Math.abs(i-e)*1e5<=Math.min(Math.abs(i),Math.abs(e))}function floatZero(i){return Math.abs(i)<=1e-5}function lerp(i,e,t){return i*(1-t)+e*t}function lerpPoint(i,e,t){return[lerp(i[0],e[0],t),lerp(i[1],e[1],t)]}function quadRoots(i,e,t){if(i===0)return[];var n=e*e-4*i*t;if(n<0)return[];var r=-e/(2*i);if(n===0)return[r];var s=Math.sqrt(n)/(2*i);return[r-s,r+s]}function polynomialCoefficients(i,e,t,n){return[-i+3*e-3*t+n,3*i-6*e+3*t,-3*i+3*e,i]}function singlePoint(i){return new PolynomialBezier(i,i,i,i,!1)}function PolynomialBezier(i,e,t,n,r){r&&pointEqual(i,e)&&(e=lerpPoint(i,n,1/3)),r&&pointEqual(t,n)&&(t=lerpPoint(i,n,2/3));var s=polynomialCoefficients(i[0],e[0],t[0],n[0]),a=polynomialCoefficients(i[1],e[1],t[1],n[1]);this.a=[s[0],a[0]],this.b=[s[1],a[1]],this.c=[s[2],a[2]],this.d=[s[3],a[3]],this.points=[i,e,t,n]}PolynomialBezier.prototype.point=function(i){return[((this.a[0]*i+this.b[0])*i+this.c[0])*i+this.d[0],((this.a[1]*i+this.b[1])*i+this.c[1])*i+this.d[1]]},PolynomialBezier.prototype.derivative=function(i){return[(3*i*this.a[0]+2*this.b[0])*i+this.c[0],(3*i*this.a[1]+2*this.b[1])*i+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(i){var e=this.derivative(i);return Math.atan2(e[1],e[0])},PolynomialBezier.prototype.normalAngle=function(i){var e=this.derivative(i);return Math.atan2(e[0],e[1])},PolynomialBezier.prototype.inflectionPoints=function(){var i=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(i))return[];var e=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/i,t=e*e-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/i;if(t<0)return[];var n=Math.sqrt(t);return floatZero(n)?n>0&&n<1?[e]:[]:[e-n,e+n].filter(function(r){return r>0&&r<1})},PolynomialBezier.prototype.split=function(i){if(i<=0)return[singlePoint(this.points[0]),this];if(i>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],i),t=lerpPoint(this.points[1],this.points[2],i),n=lerpPoint(this.points[2],this.points[3],i),r=lerpPoint(e,t,i),s=lerpPoint(t,n,i),a=lerpPoint(r,s,i);return[new PolynomialBezier(this.points[0],e,r,a,!0),new PolynomialBezier(a,s,n,this.points[3],!0)]};function extrema(i,e){var t=i.points[0][e],n=i.points[i.points.length-1][e];if(t>n){var r=n;n=t,t=r}for(var s=quadRoots(3*i.a[e],2*i.b[e],i.c[e]),a=0;a<s.length;a+=1)if(s[a]>0&&s[a]<1){var o=i.point(s[a])[e];o<t?t=o:o>n&&(n=o)}return{min:t,max:n}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var i=this.bounds();return{left:i.x.min,right:i.x.max,top:i.y.min,bottom:i.y.max,width:i.x.max-i.x.min,height:i.y.max-i.y.min,cx:(i.x.max+i.x.min)/2,cy:(i.y.max+i.y.min)/2}};function intersectData(i,e,t){var n=i.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:i,t:(e+t)/2,t1:e,t2:t}}function splitData(i){var e=i.bez.split(.5);return[intersectData(e[0],i.t1,i.t),intersectData(e[1],i.t,i.t2)]}function boxIntersect(i,e){return Math.abs(i.cx-e.cx)*2<i.width+e.width&&Math.abs(i.cy-e.cy)*2<i.height+e.height}function intersectsImpl(i,e,t,n,r,s){if(boxIntersect(i,e)){if(t>=s||i.width<=n&&i.height<=n&&e.width<=n&&e.height<=n){r.push([i.t,e.t]);return}var a=splitData(i),o=splitData(e);intersectsImpl(a[0],o[0],t+1,n,r,s),intersectsImpl(a[0],o[1],t+1,n,r,s),intersectsImpl(a[1],o[0],t+1,n,r,s),intersectsImpl(a[1],o[1],t+1,n,r,s)}}PolynomialBezier.prototype.intersections=function(i,e,t){e===void 0&&(e=2),t===void 0&&(t=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(i,0,1),0,e,n,t),n},PolynomialBezier.shapeSegment=function(i,e){var t=(e+1)%i.length();return new PolynomialBezier(i.v[e],i.o[e],i.i[t],i.v[t],!0)},PolynomialBezier.shapeSegmentInverted=function(i,e){var t=(e+1)%i.length();return new PolynomialBezier(i.v[t],i.i[t],i.o[e],i.v[e],!0)};function crossProduct(i,e){return[i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function lineIntersection(i,e,t,n){var r=[i[0],i[1],1],s=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],l=crossProduct(crossProduct(r,s),crossProduct(a,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(i,e,t){return[i[0]+Math.cos(e)*t,i[1]-Math.sin(e)*t]}function pointDistance(i,e){return Math.hypot(i[0]-e[0],i[1]-e[1])}function pointEqual(i,e){return floatEqual(i[0],e[0])&&floatEqual(i[1],e[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(i,e.s,0,null,this),this.frequency=PropertyFactory.getProp(i,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(i,e.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(i,e,t,n,r,s,a){var o=t-Math.PI/2,l=t+Math.PI/2,h=e[0]+Math.cos(t)*n*r,u=e[1]-Math.sin(t)*n*r;i.setTripleAt(h,u,h+Math.cos(o)*s,u-Math.sin(o)*s,h+Math.cos(l)*a,u-Math.sin(l)*a,i.length())}function getPerpendicularVector(i,e){var t=[e[0]-i[0],e[1]-i[1]],n=-Math.PI*.5,r=[Math.cos(n)*t[0]-Math.sin(n)*t[1],Math.sin(n)*t[0]+Math.cos(n)*t[1]];return r}function getProjectingAngle(i,e){var t=e===0?i.length()-1:e-1,n=(e+1)%i.length(),r=i.v[t],s=i.v[n],a=getPerpendicularVector(r,s);return Math.atan2(0,1)-Math.atan2(a[1],a[0])}function zigZagCorner(i,e,t,n,r,s,a){var o=getProjectingAngle(e,t),l=e.v[t%e._length],h=e.v[t===0?e._length-1:t-1],u=e.v[(t+1)%e._length],p=s===2?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0,f=s===2?Math.sqrt(Math.pow(l[0]-u[0],2)+Math.pow(l[1]-u[1],2)):0;setPoint(i,e.v[t%e._length],o,a,n,f/((r+1)*2),p/((r+1)*2))}function zigZagSegment(i,e,t,n,r,s){for(var a=0;a<n;a+=1){var o=(a+1)/(n+1),l=r===2?Math.sqrt(Math.pow(e.points[3][0]-e.points[0][0],2)+Math.pow(e.points[3][1]-e.points[0][1],2)):0,h=e.normalAngle(o),u=e.point(o);setPoint(i,u,h,s,t,l/((n+1)*2),l/((n+1)*2)),s=-s}return s}ZigZagModifier.prototype.processPath=function(i,e,t,n){var r=i._length,s=shapePool.newElement();if(s.c=i.c,i.c||(r-=1),r===0)return s;var a=-1,o=PolynomialBezier.shapeSegment(i,0);zigZagCorner(s,i,0,e,t,n,a);for(var l=0;l<r;l+=1)a=zigZagSegment(s,o,e,t,n,-a),l===r-1&&!i.c?o=null:o=PolynomialBezier.shapeSegment(i,(l+1)%r),zigZagCorner(s,i,l+1,e,t,n,a);return s},ZigZagModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.amplitude.v,o=Math.max(0,Math.round(this.frequency.v)),l=this.pointsType.v;if(a!==0){var h,u;for(t=0;t<n;t+=1){if(h=this.shapes[t],u=h.localShapeCollection,!(!h.shape._mdf&&!this._mdf&&!i))for(u.releaseShapes(),h.shape._mdf=!0,e=h.shape.paths.shapes,s=h.shape.paths._length,r=0;r<s;r+=1)u.addShape(this.processPath(e[r],a,o,l));h.shape.paths=h.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function linearOffset(i,e,t){var n=Math.atan2(e[0]-i[0],e[1]-i[1]);return[polarOffset(i,n,t),polarOffset(e,n,t)]}function offsetSegment(i,e){var t,n,r,s,a,o,l;l=linearOffset(i.points[0],i.points[1],e),t=l[0],n=l[1],l=linearOffset(i.points[1],i.points[2],e),r=l[0],s=l[1],l=linearOffset(i.points[2],i.points[3],e),a=l[0],o=l[1];var h=lineIntersection(t,n,r,s);h===null&&(h=n);var u=lineIntersection(a,o,r,s);return u===null&&(u=a),new PolynomialBezier(t,h,u,o)}function joinLines(i,e,t,n,r){var s=e.points[3],a=t.points[0];if(n===3||pointEqual(s,a))return s;if(n===2){var o=-e.tangentAngle(1),l=-t.tangentAngle(0)+Math.PI,h=lineIntersection(s,polarOffset(s,o+Math.PI/2,100),a,polarOffset(a,o+Math.PI/2,100)),u=h?pointDistance(h,s):pointDistance(s,a)/2,p=polarOffset(s,o,2*u*roundCorner);return i.setXYAt(p[0],p[1],"o",i.length()-1),p=polarOffset(a,l,2*u*roundCorner),i.setTripleAt(a[0],a[1],a[0],a[1],p[0],p[1],i.length()),a}var f=pointEqual(s,e.points[2])?e.points[0]:e.points[2],d=pointEqual(a,t.points[1])?t.points[3]:t.points[1],m=lineIntersection(f,s,a,d);return m&&pointDistance(m,s)<r?(i.setTripleAt(m[0],m[1],m[0],m[1],m[0],m[1],i.length()),m):s}function getIntersection(i,e){var t=i.intersections(e);return t.length&&floatEqual(t[0][0],1)&&t.shift(),t.length?t[0]:null}function pruneSegmentIntersection(i,e){var t=i.slice(),n=e.slice(),r=getIntersection(i[i.length-1],e[0]);return r&&(t[i.length-1]=i[i.length-1].split(r[0])[0],n[0]=e[0].split(r[1])[1]),i.length>1&&e.length>1&&(r=getIntersection(i[0],e[e.length-1]),r)?[[i[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[t,n]}function pruneIntersections(i){for(var e,t=1;t<i.length;t+=1)e=pruneSegmentIntersection(i[t-1],i[t]),i[t-1]=e[0],i[t]=e[1];return i.length>1&&(e=pruneSegmentIntersection(i[i.length-1],i[0]),i[i.length-1]=e[0],i[0]=e[1]),i}function offsetSegmentSplit(i,e){var t=i.inflectionPoints(),n,r,s,a;if(t.length===0)return[offsetSegment(i,e)];if(t.length===1||floatEqual(t[1],1))return s=i.split(t[0]),n=s[0],r=s[1],[offsetSegment(n,e),offsetSegment(r,e)];s=i.split(t[0]),n=s[0];var o=(t[1]-t[0])/(1-t[0]);return s=s[1].split(o),a=s[0],r=s[1],[offsetSegment(n,e),offsetSegment(a,e),offsetSegment(r,e)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(i,e){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(i,e.a,0,null,this),this.miterLimit=PropertyFactory.getProp(i,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(i,e,t,n){var r=shapePool.newElement();r.c=i.c;var s=i.length();i.c||(s-=1);var a,o,l,h=[];for(a=0;a<s;a+=1)l=PolynomialBezier.shapeSegment(i,a),h.push(offsetSegmentSplit(l,e));if(!i.c)for(a=s-1;a>=0;a-=1)l=PolynomialBezier.shapeSegmentInverted(i,a),h.push(offsetSegmentSplit(l,e));h=pruneIntersections(h);var u=null,p=null;for(a=0;a<h.length;a+=1){var f=h[a];for(p&&(u=joinLines(r,p,f[0],t,n)),p=f[f.length-1],o=0;o<f.length;o+=1)l=f[o],u&&pointEqual(l.points[0],u)?r.setXYAt(l.points[1][0],l.points[1][1],"o",r.length()-1):r.setTripleAt(l.points[0][0],l.points[0][1],l.points[1][0],l.points[1][1],l.points[0][0],l.points[0][1],r.length()),r.setTripleAt(l.points[3][0],l.points[3][1],l.points[3][0],l.points[3][1],l.points[2][0],l.points[2][1],r.length()),u=l.points[3]}return h.length&&joinLines(r,p,h[0][0],t,n),r},OffsetPathModifier.prototype.processShapes=function(i){var e,t,n=this.shapes.length,r,s,a=this.amount.v,o=this.miterLimit.v,l=this.lineJoin;if(a!==0){var h,u;for(t=0;t<n;t+=1){if(h=this.shapes[t],u=h.localShapeCollection,!(!h.shape._mdf&&!this._mdf&&!i))for(u.releaseShapes(),h.shape._mdf=!0,e=h.shape.paths.shapes,s=h.shape.paths._length,r=0;r<s;r+=1)u.addShape(this.processPath(e[r],a,l,o));h.shape.paths=h.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function getFontProperties(i){for(var e=i.fStyle?i.fStyle.split(" "):[],t="normal",n="normal",r=e.length,s,a=0;a<r;a+=1)switch(s=e[a].toLowerCase(),s){case"italic":n="italic";break;case"bold":t="700";break;case"black":t="900";break;case"medium":t="500";break;case"regular":case"normal":t="400";break;case"light":case"thin":t="200";break}return{style:n,weight:i.fWeight||t}}var FontManager=(function(){var i=5e3,e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var n=127988,r=917631,s=917601,a=917626,o=65039,l=8205,h=127462,u=127487,p=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function f(C){var L=C.split(","),E,T=L.length,k=[];for(E=0;E<T;E+=1)L[E]!=="sans-serif"&&L[E]!=="monospace"&&k.push(L[E]);return k.join(",")}function d(C,L){var E=createTag("span");E.setAttribute("aria-hidden",!0),E.style.fontFamily=L;var T=createTag("span");T.innerText="giItT1WQy@!-/#",E.style.position="absolute",E.style.left="-10000px",E.style.top="-10000px",E.style.fontSize="300px",E.style.fontVariant="normal",E.style.fontStyle="normal",E.style.fontWeight="normal",E.style.letterSpacing="0",E.appendChild(T),document.body.appendChild(E);var k=T.offsetWidth;return T.style.fontFamily=f(C)+", "+L,{node:T,w:k,parent:E}}function m(){var C,L=this.fonts.length,E,T,k=L;for(C=0;C<L;C+=1)this.fonts[C].loaded?k-=1:this.fonts[C].fOrigin==="n"||this.fonts[C].origin===0?this.fonts[C].loaded=!0:(E=this.fonts[C].monoCase.node,T=this.fonts[C].monoCase.w,E.offsetWidth!==T?(k-=1,this.fonts[C].loaded=!0):(E=this.fonts[C].sansCase.node,T=this.fonts[C].sansCase.w,E.offsetWidth!==T&&(k-=1,this.fonts[C].loaded=!0)),this.fonts[C].loaded&&(this.fonts[C].sansCase.parent.parentNode.removeChild(this.fonts[C].sansCase.parent),this.fonts[C].monoCase.parent.parentNode.removeChild(this.fonts[C].monoCase.parent)));k!==0&&Date.now()-this.initTime<i?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}function g(C,L){var E=document.body&&L?"svg":"canvas",T,k=getFontProperties(C);if(E==="svg"){var B=createNS("text");B.style.fontSize="100px",B.setAttribute("font-family",C.fFamily),B.setAttribute("font-style",k.style),B.setAttribute("font-weight",k.weight),B.textContent="1",C.fClass?(B.style.fontFamily="inherit",B.setAttribute("class",C.fClass)):B.style.fontFamily=C.fFamily,L.appendChild(B),T=B}else{var ee=new OffscreenCanvas(500,500).getContext("2d");ee.font=k.style+" "+k.weight+" 100px "+C.fFamily,T=ee}function oe(X){return E==="svg"?(T.textContent=X,T.getComputedTextLength()):T.measureText(X).width}return{measureText:oe}}function y(C,L){if(!C){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=C.list;return}if(!document.body){this.isLoaded=!0,C.list.forEach(function(me){me.helper=g(me),me.cache={}}),this.fonts=C.list;return}var E=C.list,T,k=E.length,B=k;for(T=0;T<k;T+=1){var ee=!0,oe,X;if(E[T].loaded=!1,E[T].monoCase=d(E[T].fFamily,"monospace"),E[T].sansCase=d(E[T].fFamily,"sans-serif"),!E[T].fPath)E[T].loaded=!0,B-=1;else if(E[T].fOrigin==="p"||E[T].origin===3){if(oe=document.querySelectorAll('style[f-forigin="p"][f-family="'+E[T].fFamily+'"], style[f-origin="3"][f-family="'+E[T].fFamily+'"]'),oe.length>0&&(ee=!1),ee){var Q=createTag("style");Q.setAttribute("f-forigin",E[T].fOrigin),Q.setAttribute("f-origin",E[T].origin),Q.setAttribute("f-family",E[T].fFamily),Q.type="text/css",Q.innerText="@font-face {font-family: "+E[T].fFamily+"; font-style: normal; src: url('"+E[T].fPath+"');}",L.appendChild(Q)}}else if(E[T].fOrigin==="g"||E[T].origin===1){for(oe=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),X=0;X<oe.length;X+=1)oe[X].href.indexOf(E[T].fPath)!==-1&&(ee=!1);if(ee){var ne=createTag("link");ne.setAttribute("f-forigin",E[T].fOrigin),ne.setAttribute("f-origin",E[T].origin),ne.type="text/css",ne.rel="stylesheet",ne.href=E[T].fPath,document.body.appendChild(ne)}}else if(E[T].fOrigin==="t"||E[T].origin===2){for(oe=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),X=0;X<oe.length;X+=1)E[T].fPath===oe[X].src&&(ee=!1);if(ee){var re=createTag("link");re.setAttribute("f-forigin",E[T].fOrigin),re.setAttribute("f-origin",E[T].origin),re.setAttribute("rel","stylesheet"),re.setAttribute("href",E[T].fPath),L.appendChild(re)}}E[T].helper=g(E[T],L),E[T].cache={},this.fonts.push(E[T])}B===0?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}function c(C){if(C){this.chars||(this.chars=[]);var L,E=C.length,T,k=this.chars.length,B;for(L=0;L<E;L+=1){for(T=0,B=!1;T<k;)this.chars[T].style===C[L].style&&this.chars[T].fFamily===C[L].fFamily&&this.chars[T].ch===C[L].ch&&(B=!0),T+=1;B||(this.chars.push(C[L]),k+=1)}}}function x(C,L,E){for(var T=0,k=this.chars.length;T<k;){if(this.chars[T].ch===C&&this.chars[T].style===L&&this.chars[T].fFamily===E)return this.chars[T];T+=1}return(typeof C=="string"&&C.charCodeAt(0)!==13||!C)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",C,L,E)),e}function v(C,L,E){var T=this.getFontByName(L),k=C;if(!T.cache[k]){var B=T.helper;if(C===" "){var ee=B.measureText("|"+C+"|"),oe=B.measureText("||");T.cache[k]=(ee-oe)/100}else T.cache[k]=B.measureText(C)/100}return T.cache[k]*E}function _(C){for(var L=0,E=this.fonts.length;L<E;){if(this.fonts[L].fName===C)return this.fonts[L];L+=1}return this.fonts[0]}function b(C){var L=0,E=C.charCodeAt(0);if(E>=55296&&E<=56319){var T=C.charCodeAt(1);T>=56320&&T<=57343&&(L=(E-55296)*1024+T-56320+65536)}return L}function M(C,L){var E=C.toString(16)+L.toString(16);return p.indexOf(E)!==-1}function A(C){return C===l}function R(C){return C===o}function w(C){var L=b(C);return L>=h&&L<=u}function P(C){return w(C.substr(0,2))&&w(C.substr(2,2))}function N(C){return t.indexOf(C)!==-1}function V(C,L){var E=b(C.substr(L,2));if(E!==n)return!1;var T=0;for(L+=2;T<5;){if(E=b(C.substr(L,2)),E<s||E>a)return!1;T+=1,L+=2}return b(C.substr(L,2))===r}function G(){this.isLoaded=!0}var H=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};H.isModifier=M,H.isZeroWidthJoiner=A,H.isFlagEmoji=P,H.isRegionalCode=w,H.isCombinedCharacter=N,H.isRegionalFlag=V,H.isVariationSelector=R,H.BLACK_FLAG_CODE_POINT=n;var O={addChars:c,addFonts:y,getCharData:x,getFontByName:_,measureText:v,checkLoadedFonts:m,setIsLoaded:G};return H.prototype=O,H})();function SlotManager(i){this.animationData=i}SlotManager.prototype.getProp=function(i){return this.animationData.slots&&this.animationData.slots[i.sid]?Object.assign(i,this.animationData.slots[i.sid].p):i};function slotFactory(i){return new SlotManager(i)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return this.data.ty===5?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(function(){var i={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(e){return i[e]||""}})();function SliderEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function AngleEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function ColorEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,1,0,t)}function PointEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,1,0,t)}function LayerIndexEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function MaskIndexEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function CheckboxEffect(i,e,t){this.p=PropertyFactory.getProp(e,i.v,0,0,t)}function NoValueEffect(){this.p={}}function EffectsManager(i,e){var t=i.ef||[];this.effectElements=[];var n,r=t.length,s;for(n=0;n<r;n+=1)s=new GroupEffect(t[n],e),this.effectElements.push(s)}function GroupEffect(i,e){this.init(i,e)}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(i,e){this.data=i,this.effectElements=[],this.initDynamicPropertyContainer(e);var t,n=this.data.ef.length,r,s=this.data.ef;for(t=0;t<n;t+=1){switch(r=null,s[t].ty){case 0:r=new SliderEffect(s[t],e,this);break;case 1:r=new AngleEffect(s[t],e,this);break;case 2:r=new ColorEffect(s[t],e,this);break;case 3:r=new PointEffect(s[t],e,this);break;case 4:case 7:r=new CheckboxEffect(s[t],e,this);break;case 10:r=new LayerIndexEffect(s[t],e,this);break;case 11:r=new MaskIndexEffect(s[t],e,this);break;case 5:r=new EffectsManager(s[t],e);break;default:r=new NoValueEffect(s[t]);break}r&&this.effectElements.push(r)}};function BaseElement(){}BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if(this.data.masksProperties[e].mode!=="n"&&this.data.masksProperties[e].cl!==!1)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),n=e("effects"),r=e("shape"),s=e("text"),a=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var o=n.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(o),this.data.ty===0||this.data.xt?this.compInterface=a(this):this.data.ty===4?(this.layerInterface.shapeInterface=r(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):this.data.ty===5&&(this.layerInterface.textInterface=s(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm),t=this.baseElement||this.layerElement;t.style["mix-blend-mode"]=e},initBaseData:function(e,t,n){this.globalData=t,this.comp=n,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}};function FrameElement(){}FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var n,r=this.dynamicProperties.length;for(n=0;n<r;n+=1)(t||this._isParent&&this.dynamicProperties[n].propType==="transform")&&(this.dynamicProperties[n].getValue(),this.dynamicProperties[n]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){this.dynamicProperties.indexOf(e)===-1&&this.dynamicProperties.push(e)}};function FootageElement(i,e,t){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(i.refId),this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(i,e,t)}FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var i=getExpressionInterfaces();if(i){var e=i("footage");this.layerInterface=e(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData};function AudioElement(i,e,t){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(i.refId),this.initBaseData(i,e,t),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,i.au&&i.au.lv?i.au.lv:{k:[100]},1,.01,this)}AudioElement.prototype.prepareFrame=function(i){if(this.prepareRenderableFrame(i,!0),this.prepareProperties(i,!0),this.tm._placeholder)this._currentTime=i/this.data.sr;else{var e=this.tm.v;this._currentTime=e}this._volume=this.lv.v[0];var t=this._volume*this._volumeMultiplier;this._previousVolume!==t&&(this._previousVolume=t,this.audio.volume(t))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(i){this.audio.rate(i)},AudioElement.prototype.volume=function(i){this._volumeMultiplier=i,this._previousVolume=i*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(i){var e,t=this.layers.length,n;for(this.completeLayers=!0,e=t-1;e>=0;e-=1)this.elements[e]||(n=this.layers[e],n.ip-n.st<=i-this.layers[e].st&&n.op-n.st>i-this.layers[e].st&&this.buildItem(e)),this.completeLayers=this.elements[e]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(i){switch(i.ty){case 2:return this.createImage(i);case 0:return this.createComp(i);case 1:return this.createSolid(i);case 3:return this.createNull(i);case 4:return this.createShape(i);case 5:return this.createText(i);case 6:return this.createAudio(i);case 13:return this.createCamera(i);case 15:return this.createFootage(i);default:return this.createNull(i)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(i){return new AudioElement(i,this.globalData,this)},BaseRenderer.prototype.createFootage=function(i){return new FootageElement(i,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var i,e=this.layers.length;for(i=0;i<e;i+=1)this.buildItem(i);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(i){this.completeLayers=!1;var e,t=i.length,n,r=this.layers.length;for(e=0;e<t;e+=1)for(n=0;n<r;){if(this.layers[n].id===i[e].id){this.layers[n]=i[e];break}n+=1}},BaseRenderer.prototype.setProjectInterface=function(i){this.globalData.projectInterface=i},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(i,e,t){for(var n=this.elements,r=this.layers,s=0,a=r.length;s<a;)r[s].ind==e&&(!n[s]||n[s]===!0?(this.buildItem(s),this.addPendingElement(i)):(t.push(n[s]),n[s].setAsParent(),r[s].parent!==void 0?this.buildElementParenting(i,r[s].parent,t):i.setHierarchy(t))),s+=1},BaseRenderer.prototype.addPendingElement=function(i){this.pendingElements.push(i)},BaseRenderer.prototype.searchExtraCompositions=function(i){var e,t=i.length;for(e=0;e<t;e+=1)if(i[e].xt){var n=this.createComp(i[e]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(i){var e,t=this.elements.length;for(e=0;e<t;e+=1)if(this.elements[e].data.ind===i)return this.elements[e];return null},BaseRenderer.prototype.getElementByPath=function(i){var e=i.shift(),t;if(typeof e=="number")t=this.elements[e];else{var n,r=this.elements.length;for(n=0;n<r;n+=1)if(this.elements[n].data.nm===e){t=this.elements[n];break}}return i.length===0?t:t.getElementByPath(i)},BaseRenderer.prototype.setupGlobalData=function(i,e){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(i),this.globalData.fontManager.addChars(i.chars),this.globalData.fontManager.addFonts(i.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=i.fr,this.globalData.nm=i.nm,this.globalData.compSize={w:i.w,h:i.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}TransformElement.prototype={initTransform:function(){var e=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:e,localMat:e,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,n=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;n<r;){if(this.hierarchy[n].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}n+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),n=0;n<r;n+=1)t.multiply(this.hierarchy[n].finalTransform.mProp.v)}(!this.localTransforms||this.finalTransform._matMdf)&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var e=0,t=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;e<t;)this.localTransforms[e]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[e]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),e+=1;if(this.finalTransform._localMatMdf){var n=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(n),e=1;e<t;e+=1){var r=this.localTransforms[e].matrix;n.multiply(r)}n.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var s=this.finalTransform.localOpacity;for(e=0;e<t;e+=1)s*=this.localTransforms[e].opacity*.01;this.finalTransform.localOpacity=s}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var e=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(e.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var t=0,n=e.length;for(t=0;t<n;t+=1)this.localTransforms.push(e[t])}}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var n=!0,r=this.comp;n;)r.finalTransform?(r.data.hasMask&&t.splice(0,0,r.finalTransform),r=r.comp):n=!1;var s,a=t.length,o;for(s=0;s<a;s+=1)o=t[s].mat.applyToPointArray(0,0,0),e=[e[0]-o[0],e[1]-o[1],0];return e},mHelper:new Matrix};function MaskElement(i,e,t){this.data=i,this.element=e,this.globalData=t,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n=this.globalData.defs,r,s=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(s),this.solidPath="";var a,o=this.masksProperties,l=0,h=[],u,p,f=createElementID(),d,m,g,y,c="clipPath",x="clip-path";for(r=0;r<s;r+=1)if((o[r].mode!=="a"&&o[r].mode!=="n"||o[r].inv||o[r].o.k!==100||o[r].o.x)&&(c="mask",x="mask"),(o[r].mode==="s"||o[r].mode==="i")&&l===0?(d=createNS("rect"),d.setAttribute("fill","#ffffff"),d.setAttribute("width",this.element.comp.data.w||0),d.setAttribute("height",this.element.comp.data.h||0),h.push(d)):d=null,a=createNS("path"),o[r].mode==="n")this.viewData[r]={op:PropertyFactory.getProp(this.element,o[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,o[r],3),elem:a,lastPath:""},n.appendChild(a);else{l+=1,a.setAttribute("fill",o[r].mode==="s"?"#000000":"#ffffff"),a.setAttribute("clip-rule","nonzero");var v;if(o[r].x.k!==0?(c="mask",x="mask",y=PropertyFactory.getProp(this.element,o[r].x,0,null,this.element),v=createElementID(),m=createNS("filter"),m.setAttribute("id",v),g=createNS("feMorphology"),g.setAttribute("operator","erode"),g.setAttribute("in","SourceGraphic"),g.setAttribute("radius","0"),m.appendChild(g),n.appendChild(m),a.setAttribute("stroke",o[r].mode==="s"?"#000000":"#ffffff")):(g=null,y=null),this.storedData[r]={elem:a,x:y,expan:g,lastPath:"",lastOperator:"",filterId:v,lastRadius:0},o[r].mode==="i"){p=h.length;var _=createNS("g");for(u=0;u<p;u+=1)_.appendChild(h[u]);var b=createNS("mask");b.setAttribute("mask-type","alpha"),b.setAttribute("id",f+"_"+l),b.appendChild(a),n.appendChild(b),_.setAttribute("mask","url("+getLocationHref()+"#"+f+"_"+l+")"),h.length=0,h.push(_)}else h.push(a);o[r].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[r]={elem:a,lastPath:"",op:PropertyFactory.getProp(this.element,o[r].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,o[r],3),invRect:d},this.viewData[r].prop.k||this.drawPath(o[r],this.viewData[r].prop.v,this.viewData[r])}for(this.maskElement=createNS(c),s=h.length,r=0;r<s;r+=1)this.maskElement.appendChild(h[r]);l>0&&(this.maskElement.setAttribute("id",f),this.element.maskedElement.setAttribute(x,"url("+getLocationHref()+"#"+f+")"),n.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(i){return this.viewData[i].prop},MaskElement.prototype.renderFrame=function(i){var e=this.element.finalTransform.mat,t,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||i)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||i)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),this.masksProperties[t].mode!=="n"&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||i)&&this.viewData[t].invRect.setAttribute("transform",e.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||i))){var r=this.storedData[t].expan;this.storedData[t].x.v<0?(this.storedData[t].lastOperator!=="erode"&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),r.setAttribute("radius",-this.storedData[t].x.v)):(this.storedData[t].lastOperator!=="dilate"&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",this.storedData[t].x.v*2))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var i="M0,0 ";return i+=" h"+this.globalData.compSize.w,i+=" v"+this.globalData.compSize.h,i+=" h-"+this.globalData.compSize.w,i+=" v-"+this.globalData.compSize.h+" ",i},MaskElement.prototype.drawPath=function(i,e,t){var n=" M"+e.v[0][0]+","+e.v[0][1],r,s;for(s=e._length,r=1;r<s;r+=1)n+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[r][0]+","+e.i[r][1]+" "+e.v[r][0]+","+e.v[r][1];if(e.c&&s>1&&(n+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),t.lastPath!==n){var a="";t.elem&&(e.c&&(a=i.inv?this.solidPath+n:n),t.elem.setAttribute("d",a)),t.lastPath=n}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=(function(){var i={};i.createFilter=e,i.createAlphaToLuminanceFilter=t;function e(n,r){var s=createNS("filter");return s.setAttribute("id",n),r!==!0&&(s.setAttribute("filterUnits","objectBoundingBox"),s.setAttribute("x","0%"),s.setAttribute("y","0%"),s.setAttribute("width","100%"),s.setAttribute("height","100%")),s}function t(){var n=createNS("feColorMatrix");return n.setAttribute("type","matrix"),n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),n}return i})(),featureSupport=(function(){var i={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(i.maskType=!1),/firefox/i.test(navigator.userAgent)&&(i.svgLumaHidden=!1),i})(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(i){var e,t="SourceGraphic",n=i.data.ef?i.data.ef.length:0,r=createElementID(),s=filtersFactory.createFilter(r,!0),a=0;this.filters=[];var o;for(e=0;e<n;e+=1){o=null;var l=i.data.ef[e].ty;if(registeredEffects$1[l]){var h=registeredEffects$1[l].effect;o=new h(s,i.effectsManager.effectElements[e],i,idPrefix+a,t),t=idPrefix+a,registeredEffects$1[l].countsAsEffect&&(a+=1)}o&&this.filters.push(o)}a&&(i.globalData.defs.appendChild(s),i.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+r+")")),this.filters.length&&i.addRenderableComponent(this)}SVGEffects.prototype.renderFrame=function(i){var e,t=this.filters.length;for(e=0;e<t;e+=1)this.filters[e].renderFrame(i)},SVGEffects.prototype.getEffects=function(i){var e,t=this.filters.length,n=[];for(e=0;e<t;e+=1)this.filters[e].type===i&&n.push(this.filters[e]);return n};function registerEffect$1(i,e,t){registeredEffects$1[i]={effect:e,countsAsEffect:t}}function SVGBaseElement(){}SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.ty===0&&!this.data.hd){var n=createNS("clipPath"),r=createNS("path");r.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var s=createElementID();if(n.setAttribute("id",s),n.appendChild(r),this.globalData.defs.appendChild(n),this.checkMasks()){var a=createNS("g");a.setAttribute("clip-path","url("+getLocationHref()+"#"+s+")"),a.appendChild(this.layerElement),this.transformedElement=a,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+s+")")}this.data.bm!==0&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t=this.layerId+"_"+e,n,r,s,a;if(e===1||e===3){var o=createNS("mask");o.setAttribute("id",t),o.setAttribute("mask-type",e===3?"luminance":"alpha"),s=createNS("use"),s.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),o.appendChild(s),this.globalData.defs.appendChild(o),!featureSupport.maskType&&e===1&&(o.setAttribute("mask-type","luminance"),n=createElementID(),r=filtersFactory.createFilter(n),this.globalData.defs.appendChild(r),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),a=createNS("g"),a.appendChild(s),o.appendChild(a),a.setAttribute("filter","url("+getLocationHref()+"#"+n+")"))}else if(e===2){var l=createNS("mask");l.setAttribute("id",t),l.setAttribute("mask-type","alpha");var h=createNS("g");l.appendChild(h),n=createElementID(),r=filtersFactory.createFilter(n);var u=createNS("feComponentTransfer");u.setAttribute("in","SourceGraphic"),r.appendChild(u);var p=createNS("feFuncA");p.setAttribute("type","table"),p.setAttribute("tableValues","1.0 0.0"),u.appendChild(p),this.globalData.defs.appendChild(r);var f=createNS("rect");f.setAttribute("width",this.comp.data.w),f.setAttribute("height",this.comp.data.h),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("fill","#ffffff"),f.setAttribute("opacity","0"),h.setAttribute("filter","url("+getLocationHref()+"#"+n+")"),h.appendChild(f),s=createNS("use"),s.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),h.appendChild(s),featureSupport.maskType||(l.setAttribute("mask-type","luminance"),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),a=createNS("g"),h.appendChild(f),a.appendChild(this.layerElement),h.appendChild(a)),this.globalData.defs.appendChild(l)}this.matteMasks[e]=t}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}};function HierarchyElement(){}HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){this.data.parent!==void 0&&this.comp.buildElementParenting(this,this.data.parent,[])}};function RenderableDOMElement(){}(function(){var i={initElement:function(t,n,r){this.initFrame(),this.initBaseData(t,n,r),this.initTransform(t,n,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){if(!this.hidden&&(!this.isInRange||this.isTransparent)){var t=this.baseElement||this.layerElement;t.style.display="none",this.hidden=!0}},show:function(){if(this.isInRange&&!this.isTransparent){if(!this.data.hd){var t=this.baseElement||this.layerElement;t.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}};extendPrototype([RenderableElement,createProxyFunction(i)],RenderableDOMElement)})();function IImageElement(i,e,t){this.assetData=e.getAssetData(i.refId),this.assetData&&this.assetData.sid&&(this.assetData=e.slotManager.getProp(this.assetData)),this.initElement(i,e,t),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var i=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect};function ProcessedElement(i,e){this.elem=i,this.pos=e}function IShapeElement(){}IShapeElement.prototype={addShapeToModifiers:function(e){var t,n=this.shapeModifiers.length;for(t=0;t<n;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=0,n=this.shapeModifiers.length;t<n;)if(this.shapeModifiers[t].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();t=this.shapeModifiers.length;var n;for(e=t-1;e>=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n<r;){if(t[n].elem===e)return t[n].pos;n+=1}return 0},addProcessedElement:function(e,t){for(var n=this.processedElements,r=n.length;r;)if(r-=1,n[r].elem===e){n[r].pos=t;return}n.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(i,e,t){this.caches=[],this.styles=[],this.transformers=i,this.lStr="",this.sh=t,this.lvl=e,this._isAnimated=!!t.k;for(var n=0,r=i.length;n<r;){if(i[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0};function SVGStyleData(i,e){this.data=i,this.type=i.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=i.hd===!0,this.pElem=createNS("path"),this.msElem=null}SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1};function DashProperty(i,e,t,n){this.elem=i,this.frameId=-1,this.dataProps=createSizedArray(e.length),this.renderer=t,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",e.length?e.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var r,s=e.length||0,a;for(r=0;r<s;r+=1)a=PropertyFactory.getProp(i,e[r].v,0,0,this),this.k=a.k||this.k,this.dataProps[r]={n:e[r].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}DashProperty.prototype.getValue=function(i){if(!(this.elem.globalData.frameId===this.frameId&&!i)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||i,this._mdf)){var e=0,t=this.dataProps.length;for(this.renderer==="svg"&&(this.dashStr=""),e=0;e<t;e+=1)this.dataProps[e].n!=="o"?this.renderer==="svg"?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty);function SVGStrokeStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(i,e.o,0,.01,this),this.w=PropertyFactory.getProp(i,e.w,0,null,this),this.d=new DashProperty(i,e.d||{},"svg",this),this.c=PropertyFactory.getProp(i,e.c,1,255,this),this.style=t,this._isAnimated=!!this._isAnimated}extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData);function SVGFillStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(i,e.o,0,.01,this),this.c=PropertyFactory.getProp(i,e.c,1,255,this),this.style=t}extendPrototype([DynamicPropertyContainer],SVGFillStyleData);function SVGNoStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.style=t}extendPrototype([DynamicPropertyContainer],SVGNoStyleData);function GradientProperty(i,e,t){this.data=e,this.c=createTypedArray("uint8c",e.p*4);var n=e.k.k[0].s?e.k.k[0].s.length-e.p*4:e.k.k.length-e.p*4;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(t),this.prop=PropertyFactory.getProp(i,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}GradientProperty.prototype.comparePoints=function(i,e){for(var t=0,n=this.o.length/2,r;t<n;){if(r=Math.abs(i[t*4]-i[e*4+t*2]),r>.01)return!1;t+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var i=0,e=this.data.k.k.length;i<e;){if(!this.comparePoints(this.data.k.k[i].s,this.data.p))return!1;i+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(i){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||i){var e,t=this.data.p*4,n,r;for(e=0;e<t;e+=1)n=e%4===0?100:255,r=Math.round(this.prop.v[e]*n),this.c[e]!==r&&(this.c[e]=r,this._cmdf=!i);if(this.o.length)for(t=this.prop.v.length,e=this.data.p*4;e<t;e+=1)n=e%2===0?100:1,r=e%2===0?Math.round(this.prop.v[e]*100):this.prop.v[e],this.o[e-this.data.p*4]!==r&&(this.o[e-this.data.p*4]=r,this._omdf=!i);this._mdf=!i}},extendPrototype([DynamicPropertyContainer],GradientProperty);function SVGGradientFillStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.initGradientData(i,e,t)}SVGGradientFillStyleData.prototype.initGradientData=function(i,e,t){this.o=PropertyFactory.getProp(i,e.o,0,.01,this),this.s=PropertyFactory.getProp(i,e.s,1,null,this),this.e=PropertyFactory.getProp(i,e.e,1,null,this),this.h=PropertyFactory.getProp(i,e.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(i,e.a||{k:0},0,degToRads,this),this.g=new GradientProperty(i,e.g,this),this.style=t,this.stops=[],this.setGradientData(t.pElem,e),this.setGradientOpacity(e,t),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(i,e){var t=createElementID(),n=createNS(e.t===1?"linearGradient":"radialGradient");n.setAttribute("id",t),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var r=[],s,a,o;for(o=e.g.p*4,a=0;a<o;a+=4)s=createNS("stop"),n.appendChild(s),r.push(s);i.setAttribute(e.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+t+")"),this.gf=n,this.cst=r},SVGGradientFillStyleData.prototype.setGradientOpacity=function(i,e){if(this.g._hasOpacity&&!this.g._collapsable){var t,n,r,s=createNS("mask"),a=createNS("path");s.appendChild(a);var o=createElementID(),l=createElementID();s.setAttribute("id",l);var h=createNS(i.t===1?"linearGradient":"radialGradient");h.setAttribute("id",o),h.setAttribute("spreadMethod","pad"),h.setAttribute("gradientUnits","userSpaceOnUse"),r=i.g.k.k[0].s?i.g.k.k[0].s.length:i.g.k.k.length;var u=this.stops;for(n=i.g.p*4;n<r;n+=2)t=createNS("stop"),t.setAttribute("stop-color","rgb(255,255,255)"),h.appendChild(t),u.push(t);a.setAttribute(i.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),i.ty==="gs"&&(a.setAttribute("stroke-linecap",lineCapEnum[i.lc||2]),a.setAttribute("stroke-linejoin",lineJoinEnum[i.lj||2]),i.lj===1&&a.setAttribute("stroke-miterlimit",i.ml)),this.of=h,this.ms=s,this.ost=u,this.maskId=l,e.msElem=a}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData);function SVGGradientStrokeStyleData(i,e,t){this.initDynamicPropertyContainer(i),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(i,e.w,0,null,this),this.d=new DashProperty(i,e.d||{},"svg",this),this.initGradientData(i,e,t),this._isAnimated=!!this._isAnimated}extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(i,e,t){this.transform={mProps:i,op:e,container:t},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}var buildShapeString=function(e,t,n,r){if(t===0)return"";var s=e.o,a=e.i,o=e.v,l,h=" M"+r.applyToPointStringified(o[0][0],o[0][1]);for(l=1;l<t;l+=1)h+=" C"+r.applyToPointStringified(s[l-1][0],s[l-1][1])+" "+r.applyToPointStringified(a[l][0],a[l][1])+" "+r.applyToPointStringified(o[l][0],o[l][1]);return n&&t&&(h+=" C"+r.applyToPointStringified(s[l-1][0],s[l-1][1])+" "+r.applyToPointStringified(a[0][0],a[0][1])+" "+r.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},SVGElementsRenderer=(function(){var i=new Matrix,e=new Matrix,t={createRenderFunction:n};function n(p){switch(p.ty){case"fl":return o;case"gf":return h;case"gs":return l;case"st":return u;case"sh":case"el":case"rc":case"sr":return a;case"tr":return r;case"no":return s;default:return null}}function r(p,f,d){(d||f.transform.op._mdf)&&f.transform.container.setAttribute("opacity",f.transform.op.v),(d||f.transform.mProps._mdf)&&f.transform.container.setAttribute("transform",f.transform.mProps.v.to2dCSS())}function s(){}function a(p,f,d){var m,g,y,c,x,v,_=f.styles.length,b=f.lvl,M,A,R,w;for(v=0;v<_;v+=1){if(c=f.sh._mdf||d,f.styles[v].lvl<b){for(A=e.reset(),R=b-f.styles[v].lvl,w=f.transformers.length-1;!c&&R>0;)c=f.transformers[w].mProps._mdf||c,R-=1,w-=1;if(c)for(R=b-f.styles[v].lvl,w=f.transformers.length-1;R>0;)A.multiply(f.transformers[w].mProps.v),R-=1,w-=1}else A=i;if(M=f.sh.paths,g=M._length,c){for(y="",m=0;m<g;m+=1)x=M.shapes[m],x&&x._length&&(y+=buildShapeString(x,x._length,x.c,A));f.caches[v]=y}else y=f.caches[v];f.styles[v].d+=p.hd===!0?"":y,f.styles[v]._mdf=c||f.styles[v]._mdf}}function o(p,f,d){var m=f.style;(f.c._mdf||d)&&m.pElem.setAttribute("fill","rgb("+bmFloor(f.c.v[0])+","+bmFloor(f.c.v[1])+","+bmFloor(f.c.v[2])+")"),(f.o._mdf||d)&&m.pElem.setAttribute("fill-opacity",f.o.v)}function l(p,f,d){h(p,f,d),u(p,f,d)}function h(p,f,d){var m=f.gf,g=f.g._hasOpacity,y=f.s.v,c=f.e.v;if(f.o._mdf||d){var x=p.ty==="gf"?"fill-opacity":"stroke-opacity";f.style.pElem.setAttribute(x,f.o.v)}if(f.s._mdf||d){var v=p.t===1?"x1":"cx",_=v==="x1"?"y1":"cy";m.setAttribute(v,y[0]),m.setAttribute(_,y[1]),g&&!f.g._collapsable&&(f.of.setAttribute(v,y[0]),f.of.setAttribute(_,y[1]))}var b,M,A,R;if(f.g._cmdf||d){b=f.cst;var w=f.g.c;for(A=b.length,M=0;M<A;M+=1)R=b[M],R.setAttribute("offset",w[M*4]+"%"),R.setAttribute("stop-color","rgb("+w[M*4+1]+","+w[M*4+2]+","+w[M*4+3]+")")}if(g&&(f.g._omdf||d)){var P=f.g.o;for(f.g._collapsable?b=f.cst:b=f.ost,A=b.length,M=0;M<A;M+=1)R=b[M],f.g._collapsable||R.setAttribute("offset",P[M*2]+"%"),R.setAttribute("stop-opacity",P[M*2+1])}if(p.t===1)(f.e._mdf||d)&&(m.setAttribute("x2",c[0]),m.setAttribute("y2",c[1]),g&&!f.g._collapsable&&(f.of.setAttribute("x2",c[0]),f.of.setAttribute("y2",c[1])));else{var N;if((f.s._mdf||f.e._mdf||d)&&(N=Math.sqrt(Math.pow(y[0]-c[0],2)+Math.pow(y[1]-c[1],2)),m.setAttribute("r",N),g&&!f.g._collapsable&&f.of.setAttribute("r",N)),f.s._mdf||f.e._mdf||f.h._mdf||f.a._mdf||d){N||(N=Math.sqrt(Math.pow(y[0]-c[0],2)+Math.pow(y[1]-c[1],2)));var V=Math.atan2(c[1]-y[1],c[0]-y[0]),G=f.h.v;G>=1?G=.99:G<=-1&&(G=-.99);var H=N*G,O=Math.cos(V+f.a.v)*H+y[0],C=Math.sin(V+f.a.v)*H+y[1];m.setAttribute("fx",O),m.setAttribute("fy",C),g&&!f.g._collapsable&&(f.of.setAttribute("fx",O),f.of.setAttribute("fy",C))}}}function u(p,f,d){var m=f.style,g=f.d;g&&(g._mdf||d)&&g.dashStr&&(m.pElem.setAttribute("stroke-dasharray",g.dashStr),m.pElem.setAttribute("stroke-dashoffset",g.dashoffset[0])),f.c&&(f.c._mdf||d)&&m.pElem.setAttribute("stroke","rgb("+bmFloor(f.c.v[0])+","+bmFloor(f.c.v[1])+","+bmFloor(f.c.v[2])+")"),(f.o._mdf||d)&&m.pElem.setAttribute("stroke-opacity",f.o.v),(f.w._mdf||d)&&(m.pElem.setAttribute("stroke-width",f.w.v),m.msElem&&m.msElem.setAttribute("stroke-width",f.w.v))}return t})();function SVGShapeElement(i,e,t){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(i,e,t),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var i,e=this.shapes.length,t,n,r=this.stylesList.length,s,a=[],o=!1;for(n=0;n<r;n+=1){for(s=this.stylesList[n],o=!1,a.length=0,i=0;i<e;i+=1)t=this.shapes[i],t.styles.indexOf(s)!==-1&&(a.push(t),o=t._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(i){var e,t=i.length;for(e=0;e<t;e+=1)i[e].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(i,e){var t,n=new SVGStyleData(i,e),r=n.pElem;if(i.ty==="st")t=new SVGStrokeStyleData(this,i,n);else if(i.ty==="fl")t=new SVGFillStyleData(this,i,n);else if(i.ty==="gf"||i.ty==="gs"){var s=i.ty==="gf"?SVGGradientFillStyleData:SVGGradientStrokeStyleData;t=new s(this,i,n),this.globalData.defs.appendChild(t.gf),t.maskId&&(this.globalData.defs.appendChild(t.ms),this.globalData.defs.appendChild(t.of),r.setAttribute("mask","url("+getLocationHref()+"#"+t.maskId+")"))}else i.ty==="no"&&(t=new SVGNoStyleData(this,i,n));return(i.ty==="st"||i.ty==="gs")&&(r.setAttribute("stroke-linecap",lineCapEnum[i.lc||2]),r.setAttribute("stroke-linejoin",lineJoinEnum[i.lj||2]),r.setAttribute("fill-opacity","0"),i.lj===1&&r.setAttribute("stroke-miterlimit",i.ml)),i.r===2&&r.setAttribute("fill-rule","evenodd"),i.ln&&r.setAttribute("id",i.ln),i.cl&&r.setAttribute("class",i.cl),i.bm&&(r.style["mix-blend-mode"]=getBlendMode(i.bm)),this.stylesList.push(n),this.addToAnimatedContents(i,t),t},SVGShapeElement.prototype.createGroupElement=function(i){var e=new ShapeGroupData;return i.ln&&e.gr.setAttribute("id",i.ln),i.cl&&e.gr.setAttribute("class",i.cl),i.bm&&(e.gr.style["mix-blend-mode"]=getBlendMode(i.bm)),e},SVGShapeElement.prototype.createTransformElement=function(i,e){var t=TransformPropertyFactory.getTransformProperty(this,i,this),n=new SVGTransformData(t,t.o,e);return this.addToAnimatedContents(i,n),n},SVGShapeElement.prototype.createShapeElement=function(i,e,t){var n=4;i.ty==="rc"?n=5:i.ty==="el"?n=6:i.ty==="sr"&&(n=7);var r=ShapePropertyFactory.getShapeProp(this,i,n,this),s=new SVGShapeData(e,t,r);return this.shapes.push(s),this.addShapeToModifiers(s),this.addToAnimatedContents(i,s),s},SVGShapeElement.prototype.addToAnimatedContents=function(i,e){for(var t=0,n=this.animatedContents.length;t<n;){if(this.animatedContents[t].element===e)return;t+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(i),element:e,data:i})},SVGShapeElement.prototype.setElementStyles=function(i){var e=i.styles,t,n=this.stylesList.length;for(t=0;t<n;t+=1)e.indexOf(this.stylesList[t])===-1&&!this.stylesList[t].closed&&e.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var i,e=this.itemsData.length;for(i=0;i<e;i+=1)this.prevViewData[i]=this.itemsData[i];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,i=0;i<e;i+=1)this.dynamicProperties[i].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(i,e,t,n,r,s,a){var o=[].concat(s),l,h=i.length-1,u,p,f=[],d=[],m,g,y;for(l=h;l>=0;l-=1){if(y=this.searchProcessedElement(i[l]),y?e[l]=t[y-1]:i[l]._render=a,i[l].ty==="fl"||i[l].ty==="st"||i[l].ty==="gf"||i[l].ty==="gs"||i[l].ty==="no")y?e[l].style.closed=i[l].hd:e[l]=this.createStyleElement(i[l],r),i[l]._render&&e[l].style.pElem.parentNode!==n&&n.appendChild(e[l].style.pElem),f.push(e[l].style);else if(i[l].ty==="gr"){if(!y)e[l]=this.createGroupElement(i[l]);else for(p=e[l].it.length,u=0;u<p;u+=1)e[l].prevViewData[u]=e[l].it[u];this.searchShapes(i[l].it,e[l].it,e[l].prevViewData,e[l].gr,r+1,o,a),i[l]._render&&e[l].gr.parentNode!==n&&n.appendChild(e[l].gr)}else i[l].ty==="tr"?(y||(e[l]=this.createTransformElement(i[l],n)),m=e[l].transform,o.push(m)):i[l].ty==="sh"||i[l].ty==="rc"||i[l].ty==="el"||i[l].ty==="sr"?(y||(e[l]=this.createShapeElement(i[l],o,r)),this.setElementStyles(e[l])):i[l].ty==="tm"||i[l].ty==="rd"||i[l].ty==="ms"||i[l].ty==="pb"||i[l].ty==="zz"||i[l].ty==="op"?(y?(g=e[l],g.closed=!1):(g=ShapeModifiers.getModifier(i[l].ty),g.init(this,i[l]),e[l]=g,this.shapeModifiers.push(g)),d.push(g)):i[l].ty==="rp"&&(y?(g=e[l],g.closed=!0):(g=ShapeModifiers.getModifier(i[l].ty),e[l]=g,g.init(this,i,l,e),this.shapeModifiers.push(g),a=!1),d.push(g));this.addProcessedElement(i[l],l+1)}for(h=f.length,l=0;l<h;l+=1)f[l].closed=!0;for(h=d.length,l=0;l<h;l+=1)d[l].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var i,e=this.stylesList.length;for(i=0;i<e;i+=1)this.stylesList[i].reset();for(this.renderShape(),i=0;i<e;i+=1)(this.stylesList[i]._mdf||this._isFirstFrame)&&(this.stylesList[i].msElem&&(this.stylesList[i].msElem.setAttribute("d",this.stylesList[i].d),this.stylesList[i].d="M0 0"+this.stylesList[i].d),this.stylesList[i].pElem.setAttribute("d",this.stylesList[i].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var i,e=this.animatedContents.length,t;for(i=0;i<e;i+=1)t=this.animatedContents[i],(this._isFirstFrame||t.element._isAnimated)&&t.data!==!0&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};function LetterProps(i,e,t,n,r,s){this.o=i,this.sw=e,this.sc=t,this.fc=n,this.m=r,this.p=s,this._mdf={o:!0,sw:!!e,sc:!!t,fc:!!n,m:!0,p:!0}}LetterProps.prototype.update=function(i,e,t,n,r,s){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==i&&(this.o=i,this._mdf.o=!0,a=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,a=!0),this.sc!==t&&(this.sc=t,this._mdf.sc=!0,a=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,a=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,a=!0),s.length&&(this.p[0]!==s[0]||this.p[1]!==s[1]||this.p[4]!==s[4]||this.p[5]!==s[5]||this.p[12]!==s[12]||this.p[13]!==s[13])&&(this.p=s,this._mdf.p=!0,a=!0),a};function TextProperty(i,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=i.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=i,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(i,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i},TextProperty.prototype.setCurrentData=function(i){i.__complete||this.completeTextData(i),this.currentData=i,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(i){this.effectsSequence.push(i),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(i){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!i)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,t=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var n,r=this.effectsSequence.length,s=i||this.data.d.k[this.keysIndex].s;for(n=0;n<r;n+=1)t!==this.keysIndex?s=this.effectsSequence[n](s,s.t):s=this.effectsSequence[n](this.currentData,s.t);e!==s&&this.setCurrentData(s),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}},TextProperty.prototype.getKeyframeValue=function(){for(var i=this.data.d.k,e=this.elem.comp.renderedFrame,t=0,n=i.length;t<=n-1&&!(t===n-1||i[t+1].t>e);)t+=1;return this.keysIndex!==t&&(this.keysIndex=t),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(i){for(var e=[],t=0,n=i.length,r,s,a=!1,o=!1,l="";t<n;)a=o,o=!1,r=i.charCodeAt(t),l=i.charAt(t),FontManager.isCombinedCharacter(r)?a=!0:r>=55296&&r<=56319?FontManager.isRegionalFlag(i,t)?l=i.substr(t,14):(s=i.charCodeAt(t+1),s>=56320&&s<=57343&&(FontManager.isModifier(r,s)?(l=i.substr(t,2),a=!0):FontManager.isFlagEmoji(i.substr(t,4))?l=i.substr(t,4):l=i.substr(t,2))):r>56319?(s=i.charCodeAt(t+1),FontManager.isVariationSelector(r)&&(a=!0)):FontManager.isZeroWidthJoiner(r)&&(a=!0,o=!0),a?(e[e.length-1]+=l,a=!1):e.push(l),t+=l.length;return e},TextProperty.prototype.completeTextData=function(i){i.__complete=!0;var e=this.elem.globalData.fontManager,t=this.data,n=[],r,s,a,o=0,l,h=t.m.g,u=0,p=0,f=0,d=[],m=0,g=0,y,c,x=e.getFontByName(i.f),v,_=0,b=getFontProperties(x);i.fWeight=b.weight,i.fStyle=b.style,i.finalSize=i.s,i.finalText=this.buildFinalText(i.t),s=i.finalText.length,i.finalLineHeight=i.lh;var M=i.tr/1e3*i.finalSize,A;if(i.sz)for(var R=!0,w=i.sz[0],P=i.sz[1],N,V;R;){V=this.buildFinalText(i.t),N=0,m=0,s=V.length,M=i.tr/1e3*i.finalSize;var G=-1;for(r=0;r<s;r+=1)A=V[r].charCodeAt(0),a=!1,V[r]===" "?G=r:(A===13||A===3)&&(m=0,a=!0,N+=i.finalLineHeight||i.finalSize*1.2),e.chars?(v=e.getCharData(V[r],x.fStyle,x.fFamily),_=a?0:v.w*i.finalSize/100):_=e.measureText(V[r],i.f,i.finalSize),m+_>w&&V[r]!==" "?(G===-1?s+=1:r=G,N+=i.finalLineHeight||i.finalSize*1.2,V.splice(r,G===r?1:0,"\r"),G=-1,m=0):(m+=_,m+=M);N+=x.ascent*i.finalSize/100,this.canResize&&i.finalSize>this.minimumFontSize&&P<N?(i.finalSize-=1,i.finalLineHeight=i.finalSize*i.lh/i.s):(i.finalText=V,s=i.finalText.length,R=!1)}m=-M,_=0;var H=0,O;for(r=0;r<s;r+=1)if(a=!1,O=i.finalText[r],A=O.charCodeAt(0),A===13||A===3?(H=0,d.push(m),g=m>g?m:g,m=-2*M,l="",a=!0,f+=1):l=O,e.chars?(v=e.getCharData(O,x.fStyle,e.getFontByName(i.f).fFamily),_=a?0:v.w*i.finalSize/100):_=e.measureText(l,i.f,i.finalSize),O===" "?H+=_+M:(m+=_+M+H,H=0),n.push({l:_,an:_,add:u,n:a,anIndexes:[],val:l,line:f,animatorJustifyOffset:0}),h==2){if(u+=_,l===""||l===" "||r===s-1){for((l===""||l===" ")&&(u-=_);p<=r;)n[p].an=u,n[p].ind=o,n[p].extra=_,p+=1;o+=1,u=0}}else if(h==3){if(u+=_,l===""||r===s-1){for(l===""&&(u-=_);p<=r;)n[p].an=u,n[p].ind=o,n[p].extra=_,p+=1;u=0,o+=1}}else n[o].ind=o,n[o].extra=0,o+=1;if(i.l=n,g=m>g?m:g,d.push(m),i.sz)i.boxWidth=i.sz[0],i.justifyOffset=0;else switch(i.boxWidth=g,i.j){case 1:i.justifyOffset=-i.boxWidth;break;case 2:i.justifyOffset=-i.boxWidth/2;break;default:i.justifyOffset=0}i.lineWidths=d;var C=t.a,L,E;c=C.length;var T,k,B=[];for(y=0;y<c;y+=1){for(L=C[y],L.a.sc&&(i.strokeColorAnim=!0),L.a.sw&&(i.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(i.fillColorAnim=!0),k=0,T=L.s.b,r=0;r<s;r+=1)E=n[r],E.anIndexes[y]=k,(T==1&&E.val!==""||T==2&&E.val!==""&&E.val!==" "||T==3&&(E.n||E.val==" "||r==s-1)||T==4&&(E.n||r==s-1))&&(L.s.rn===1&&B.push(k),k+=1);t.a[y].s.totalChars=k;var ee=-1,oe;if(L.s.rn===1)for(r=0;r<s;r+=1)E=n[r],ee!=E.anIndexes[y]&&(ee=E.anIndexes[y],oe=B.splice(Math.floor(Math.random()*B.length),1)[0]),E.anIndexes[y]=oe}i.yOffset=i.finalLineHeight||i.finalSize*1.2,i.ls=i.ls||0,i.ascent=x.ascent*i.finalSize/100},TextProperty.prototype.updateDocumentData=function(i,e){e=e===void 0?this.keysIndex:e;var t=this.copyData({},this.data.d.k[e].s);t=this.copyData(t,i),this.data.d.k[e].s=t,this.recalculate(e),this.setCurrentData(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(i){var e=this.data.d.k[i].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},TextProperty.prototype.canResizeFont=function(i){this.canResize=i,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(i){this.minimumFontSize=Math.floor(i)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=(function(){var i=Math.max,e=Math.min,t=Math.floor;function n(s,a){this._currentTextLength=-1,this.k=!1,this.data=a,this.elem=s,this.comp=s.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(s),this.s=PropertyFactory.getProp(s,a.s||{k:0},0,0,this),"e"in a?this.e=PropertyFactory.getProp(s,a.e,0,0,this):this.e={v:100},this.o=PropertyFactory.getProp(s,a.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(s,a.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(s,a.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(s,a.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(s,a.a,0,.01,this),this.dynamicProperties.length||this.getValue()}n.prototype={getMult:function(a){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var o=0,l=0,h=1,u=1;this.ne.v>0?o=this.ne.v/100:l=-this.ne.v/100,this.xe.v>0?h=1-this.xe.v/100:u=1+this.xe.v/100;var p=BezierFactory.getBezierEasing(o,l,h,u).get,f=0,d=this.finalS,m=this.finalE,g=this.data.sh;if(g===2)m===d?f=a>=m?1:0:f=i(0,e(.5/(m-d)+(a-d)/(m-d),1)),f=p(f);else if(g===3)m===d?f=a>=m?0:1:f=1-i(0,e(.5/(m-d)+(a-d)/(m-d),1)),f=p(f);else if(g===4)m===d?f=0:(f=i(0,e(.5/(m-d)+(a-d)/(m-d),1)),f<.5?f*=2:f=1-2*(f-.5)),f=p(f);else if(g===5){if(m===d)f=0;else{var y=m-d;a=e(i(0,a+.5-d),m-d);var c=-y/2+a,x=y/2;f=Math.sqrt(1-c*c/(x*x))}f=p(f)}else g===6?(m===d?f=0:(a=e(i(0,a+.5-d),m-d),f=(1+Math.cos(Math.PI+Math.PI*2*a/(m-d)))/2),f=p(f)):(a>=t(d)&&(a-d<0?f=i(0,e(e(m,1)-(d-a),1)):f=i(0,e(m-a,1))),f=p(f));if(this.sm.v!==100){var v=this.sm.v*.01;v===0&&(v=1e-8);var _=.5-v*.5;f<_?f=0:(f=(f-_)/v,f>1&&(f=1))}return f*this.a.v},getValue:function(a){this.iterateDynamicProperties(),this._mdf=a||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,a&&this.data.r===2&&(this.e.v=this._currentTextLength);var o=this.data.r===2?1:100/this.data.totalChars,l=this.o.v/o,h=this.s.v/o+l,u=this.e.v/o+l;if(h>u){var p=h;h=u,u=p}this.finalS=h,this.finalE=u}},extendPrototype([DynamicPropertyContainer],n);function r(s,a,o){return new n(s,a)}return{getTextSelectorProp:r}})();function TextAnimatorDataProperty(i,e,t){var n={propType:!1},r=PropertyFactory.getProp,s=e.a;this.a={r:s.r?r(i,s.r,0,degToRads,t):n,rx:s.rx?r(i,s.rx,0,degToRads,t):n,ry:s.ry?r(i,s.ry,0,degToRads,t):n,sk:s.sk?r(i,s.sk,0,degToRads,t):n,sa:s.sa?r(i,s.sa,0,degToRads,t):n,s:s.s?r(i,s.s,1,.01,t):n,a:s.a?r(i,s.a,1,0,t):n,o:s.o?r(i,s.o,0,.01,t):n,p:s.p?r(i,s.p,1,0,t):n,sw:s.sw?r(i,s.sw,0,0,t):n,sc:s.sc?r(i,s.sc,1,0,t):n,fc:s.fc?r(i,s.fc,1,0,t):n,fh:s.fh?r(i,s.fh,0,0,t):n,fs:s.fs?r(i,s.fs,0,.01,t):n,fb:s.fb?r(i,s.fb,0,.01,t):n,t:s.t?r(i,s.t,0,0,t):n},this.s=TextSelectorProp.getTextSelectorProp(i,e.s,t),this.s.t=e.s.t}function TextAnimatorProperty(i,e,t){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=i,this._renderType=e,this._elem=t,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(t)}TextAnimatorProperty.prototype.searchProperties=function(){var i,e=this._textData.a.length,t,n=PropertyFactory.getProp;for(i=0;i<e;i+=1)t=this._textData.a[i],this._animatorsData[i]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(i,e){if(this.lettersChangedFlag=e,!(!this._mdf&&!this._isFirstFrame&&!e&&(!this._hasMaskedPath||!this._pathData.m._mdf))){this._isFirstFrame=!1;var t=this._moreOptions.alignment.v,n=this._animatorsData,r=this._textData,s=this.mHelper,a=this._renderType,o=this.renderedLetters.length,l,h,u,p,f=i.l,d,m,g,y,c,x,v,_,b,M,A,R,w,P,N;if(this._hasMaskedPath){if(N=this._pathData.m,!this._pathData.n||this._pathData._mdf){var V=N.v;this._pathData.r.v&&(V=V.reverse()),d={tLength:0,segments:[]},p=V._length-1;var G;for(R=0,u=0;u<p;u+=1)G=bez.buildBezierData(V.v[u],V.v[u+1],[V.o[u][0]-V.v[u][0],V.o[u][1]-V.v[u][1]],[V.i[u+1][0]-V.v[u+1][0],V.i[u+1][1]-V.v[u+1][1]]),d.tLength+=G.segmentLength,d.segments.push(G),R+=G.segmentLength;u=p,N.v.c&&(G=bez.buildBezierData(V.v[u],V.v[0],[V.o[u][0]-V.v[u][0],V.o[u][1]-V.v[u][1]],[V.i[0][0]-V.v[0][0],V.i[0][1]-V.v[0][1]]),d.tLength+=G.segmentLength,d.segments.push(G),R+=G.segmentLength),this._pathData.pi=d}if(d=this._pathData.pi,m=this._pathData.f.v,v=0,x=1,y=0,c=!0,M=d.segments,m<0&&N.v.c)for(d.tLength<Math.abs(m)&&(m=-Math.abs(m)%d.tLength),v=M.length-1,b=M[v].points,x=b.length-1;m<0;)m+=b[x].partialLength,x-=1,x<0&&(v-=1,b=M[v].points,x=b.length-1);b=M[v].points,_=b[x-1],g=b[x],A=g.partialLength}p=f.length,l=0,h=0;var H=i.finalSize*1.2*.714,O=!0,C,L,E,T,k;T=n.length;var B,ee=-1,oe,X,Q,ne=m,re=v,me=x,Fe=-1,Ee,Ne,Be,_e,U,qe,Le,Ie,ge="",ke=this.defaultPropsArray,ve;if(i.j===2||i.j===1){var D=0,I=0,q=i.j===2?-.5:-1,J=0,te=!0;for(u=0;u<p;u+=1)if(f[u].n){for(D&&(D+=I);J<u;)f[J].animatorJustifyOffset=D,J+=1;D=0,te=!0}else{for(E=0;E<T;E+=1)C=n[E].a,C.t.propType&&(te&&i.j===2&&(I+=C.t.v*q),L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?D+=C.t.v*B[0]*q:D+=C.t.v*B*q);te=!1}for(D&&(D+=I);J<u;)f[J].animatorJustifyOffset=D,J+=1}for(u=0;u<p;u+=1){if(s.reset(),Ee=1,f[u].n)l=0,h+=i.yOffset,h+=O?1:0,m=ne,O=!1,this._hasMaskedPath&&(v=re,x=me,b=M[v].points,_=b[x-1],g=b[x],A=g.partialLength,y=0),ge="",Ie="",qe="",ve="",ke=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Fe!==f[u].line){switch(i.j){case 1:m+=R-i.lineWidths[f[u].line];break;case 2:m+=(R-i.lineWidths[f[u].line])/2;break}Fe=f[u].line}ee!==f[u].ind&&(f[ee]&&(m+=f[ee].extra),m+=f[u].an/2,ee=f[u].ind),m+=t[0]*f[u].an*.005;var K=0;for(E=0;E<T;E+=1)C=n[E].a,C.p.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?K+=C.p.v[0]*B[0]:K+=C.p.v[0]*B),C.a.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?K+=C.a.v[0]*B[0]:K+=C.a.v[0]*B);for(c=!0,this._pathData.a.v&&(m=f[0].an*.5+(R-this._pathData.f.v-f[0].an*.5-f[f.length-1].an*.5)*ee/(p-1),m+=this._pathData.f.v);c;)y+A>=m+K||!b?(w=(m+K-y)/g.partialLength,X=_.point[0]+(g.point[0]-_.point[0])*w,Q=_.point[1]+(g.point[1]-_.point[1])*w,s.translate(-t[0]*f[u].an*.005,-(t[1]*H)*.01),c=!1):b&&(y+=g.partialLength,x+=1,x>=b.length&&(x=0,v+=1,M[v]?b=M[v].points:N.v.c?(x=0,v=0,b=M[v].points):(y-=g.partialLength,b=null)),b&&(_=g,g=b[x],A=g.partialLength));oe=f[u].an/2-f[u].add,s.translate(-oe,0,0)}else oe=f[u].an/2-f[u].add,s.translate(-oe,0,0),s.translate(-t[0]*f[u].an*.005,-t[1]*H*.01,0);for(E=0;E<T;E+=1)C=n[E].a,C.t.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),(l!==0||i.j!==0)&&(this._hasMaskedPath?B.length?m+=C.t.v*B[0]:m+=C.t.v*B:B.length?l+=C.t.v*B[0]:l+=C.t.v*B));for(i.strokeWidthAnim&&(Be=i.sw||0),i.strokeColorAnim&&(i.sc?Ne=[i.sc[0],i.sc[1],i.sc[2]]:Ne=[0,0,0]),i.fillColorAnim&&i.fc&&(_e=[i.fc[0],i.fc[1],i.fc[2]]),E=0;E<T;E+=1)C=n[E].a,C.a.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?s.translate(-C.a.v[0]*B[0],-C.a.v[1]*B[1],C.a.v[2]*B[2]):s.translate(-C.a.v[0]*B,-C.a.v[1]*B,C.a.v[2]*B));for(E=0;E<T;E+=1)C=n[E].a,C.s.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),B.length?s.scale(1+(C.s.v[0]-1)*B[0],1+(C.s.v[1]-1)*B[1],1):s.scale(1+(C.s.v[0]-1)*B,1+(C.s.v[1]-1)*B,1));for(E=0;E<T;E+=1){if(C=n[E].a,L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),C.sk.propType&&(B.length?s.skewFromAxis(-C.sk.v*B[0],C.sa.v*B[1]):s.skewFromAxis(-C.sk.v*B,C.sa.v*B)),C.r.propType&&(B.length?s.rotateZ(-C.r.v*B[2]):s.rotateZ(-C.r.v*B)),C.ry.propType&&(B.length?s.rotateY(C.ry.v*B[1]):s.rotateY(C.ry.v*B)),C.rx.propType&&(B.length?s.rotateX(C.rx.v*B[0]):s.rotateX(C.rx.v*B)),C.o.propType&&(B.length?Ee+=(C.o.v*B[0]-Ee)*B[0]:Ee+=(C.o.v*B-Ee)*B),i.strokeWidthAnim&&C.sw.propType&&(B.length?Be+=C.sw.v*B[0]:Be+=C.sw.v*B),i.strokeColorAnim&&C.sc.propType)for(U=0;U<3;U+=1)B.length?Ne[U]+=(C.sc.v[U]-Ne[U])*B[0]:Ne[U]+=(C.sc.v[U]-Ne[U])*B;if(i.fillColorAnim&&i.fc){if(C.fc.propType)for(U=0;U<3;U+=1)B.length?_e[U]+=(C.fc.v[U]-_e[U])*B[0]:_e[U]+=(C.fc.v[U]-_e[U])*B;C.fh.propType&&(B.length?_e=addHueToRGB(_e,C.fh.v*B[0]):_e=addHueToRGB(_e,C.fh.v*B)),C.fs.propType&&(B.length?_e=addSaturationToRGB(_e,C.fs.v*B[0]):_e=addSaturationToRGB(_e,C.fs.v*B)),C.fb.propType&&(B.length?_e=addBrightnessToRGB(_e,C.fb.v*B[0]):_e=addBrightnessToRGB(_e,C.fb.v*B))}}for(E=0;E<T;E+=1)C=n[E].a,C.p.propType&&(L=n[E].s,B=L.getMult(f[u].anIndexes[E],r.a[E].s.totalChars),this._hasMaskedPath?B.length?s.translate(0,C.p.v[1]*B[0],-C.p.v[2]*B[1]):s.translate(0,C.p.v[1]*B,-C.p.v[2]*B):B.length?s.translate(C.p.v[0]*B[0],C.p.v[1]*B[1],-C.p.v[2]*B[2]):s.translate(C.p.v[0]*B,C.p.v[1]*B,-C.p.v[2]*B));if(i.strokeWidthAnim&&(qe=Be<0?0:Be),i.strokeColorAnim&&(Le="rgb("+Math.round(Ne[0]*255)+","+Math.round(Ne[1]*255)+","+Math.round(Ne[2]*255)+")"),i.fillColorAnim&&i.fc&&(Ie="rgb("+Math.round(_e[0]*255)+","+Math.round(_e[1]*255)+","+Math.round(_e[2]*255)+")"),this._hasMaskedPath){if(s.translate(0,-i.ls),s.translate(0,t[1]*H*.01+h,0),this._pathData.p.v){P=(g.point[1]-_.point[1])/(g.point[0]-_.point[0]);var de=Math.atan(P)*180/Math.PI;g.point[0]<_.point[0]&&(de+=180),s.rotate(-de*Math.PI/180)}s.translate(X,Q,0),m-=t[0]*f[u].an*.005,f[u+1]&&ee!==f[u+1].ind&&(m+=f[u].an/2,m+=i.tr*.001*i.finalSize)}else{switch(s.translate(l,h,0),i.ps&&s.translate(i.ps[0],i.ps[1]+i.ascent,0),i.j){case 1:s.translate(f[u].animatorJustifyOffset+i.justifyOffset+(i.boxWidth-i.lineWidths[f[u].line]),0,0);break;case 2:s.translate(f[u].animatorJustifyOffset+i.justifyOffset+(i.boxWidth-i.lineWidths[f[u].line])/2,0,0);break}s.translate(0,-i.ls),s.translate(oe,0,0),s.translate(t[0]*f[u].an*.005,t[1]*H*.01,0),l+=f[u].l+i.tr*.001*i.finalSize}a==="html"?ge=s.toCSS():a==="svg"?ge=s.to2dCSS():ke=[s.props[0],s.props[1],s.props[2],s.props[3],s.props[4],s.props[5],s.props[6],s.props[7],s.props[8],s.props[9],s.props[10],s.props[11],s.props[12],s.props[13],s.props[14],s.props[15]],ve=Ee}o<=u?(k=new LetterProps(ve,qe,Le,Ie,ge,ke),this.renderedLetters.push(k),o+=1,this.lettersChangedFlag=!0):(k=this.renderedLetters[u],this.lettersChangedFlag=k.update(ve,qe,Le,Ie,ge,ke)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty);function ITextElement(){}ITextElement.prototype.initElement=function(i,e,t){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(i,e,t),this.textProperty=new TextProperty(this,i.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(i.t,this.renderType,this),this.initTransform(i,e,t),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(i){this._mdf=!1,this.prepareRenderableFrame(i),this.prepareProperties(i,this.isInRange)},ITextElement.prototype.createPathShape=function(i,e){var t,n=e.length,r,s="";for(t=0;t<n;t+=1)e[t].ty==="sh"&&(r=e[t].ks.k,s+=buildShapeString(r,r.i.length,!0,i));return s},ITextElement.prototype.updateDocumentData=function(i,e){this.textProperty.updateDocumentData(i,e)},ITextElement.prototype.canResizeFont=function(i){this.textProperty.canResizeFont(i)},ITextElement.prototype.setMinimumFontSize=function(i){this.textProperty.setMinimumFontSize(i)},ITextElement.prototype.applyTextPropertiesToMatrix=function(i,e,t,n,r){switch(i.ps&&e.translate(i.ps[0],i.ps[1]+i.ascent,0),e.translate(0,-i.ls,0),i.j){case 1:e.translate(i.justifyOffset+(i.boxWidth-i.lineWidths[t]),0,0);break;case 2:e.translate(i.justifyOffset+(i.boxWidth-i.lineWidths[t])/2,0,0);break}e.translate(n,r,0)},ITextElement.prototype.buildColor=function(i){return"rgb("+Math.round(i[0]*255)+","+Math.round(i[1]*255)+","+Math.round(i[2]*255)+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(i,e,t){this.textSpans=[],this.renderType="svg",this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(i){for(var e=0,t=i.length,n=[],r="";e<t;)i[e]==="\r"||i[e]===""?(n.push(r),r=""):r+=i[e],e+=1;return n.push(r),n},SVGTextLottieElement.prototype.buildShapeData=function(i,e){if(i.shapes&&i.shapes.length){var t=i.shapes[0];if(t.it){var n=t.it[t.it.length-1];n.s&&(n.s.k[0]=e,n.s.k[1]=e)}}return i},SVGTextLottieElement.prototype.buildNewText=function(){this.addDynamicProperty(this);var i,e,t=this.textProperty.currentData;this.renderedLetters=createSizedArray(t?t.l.length:0),t.fc?this.layerElement.setAttribute("fill",this.buildColor(t.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),t.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(t.sc)),this.layerElement.setAttribute("stroke-width",t.sw)),this.layerElement.setAttribute("font-size",t.finalSize);var n=this.globalData.fontManager.getFontByName(t.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var r=t.fWeight,s=t.fStyle;this.layerElement.setAttribute("font-style",s),this.layerElement.setAttribute("font-weight",r)}this.layerElement.setAttribute("aria-label",t.t);var a=t.l||[],o=!!this.globalData.fontManager.chars;e=a.length;var l,h=this.mHelper,u="",p=this.data.singleShape,f=0,d=0,m=!0,g=t.tr*.001*t.finalSize;if(p&&!o&&!t.sz){var y=this.textContainer,c="start";switch(t.j){case 1:c="end";break;case 2:c="middle";break;default:c="start";break}y.setAttribute("text-anchor",c),y.setAttribute("letter-spacing",g);var x=this.buildTextContents(t.finalText);for(e=x.length,d=t.ps?t.ps[1]+t.ascent:0,i=0;i<e;i+=1)l=this.textSpans[i].span||createNS("tspan"),l.textContent=x[i],l.setAttribute("x",0),l.setAttribute("y",d),l.style.display="inherit",y.appendChild(l),this.textSpans[i]||(this.textSpans[i]={span:null,glyph:null}),this.textSpans[i].span=l,d+=t.finalLineHeight;this.layerElement.appendChild(y)}else{var v=this.textSpans.length,_;for(i=0;i<e;i+=1){if(this.textSpans[i]||(this.textSpans[i]={span:null,childSpan:null,glyph:null}),!o||!p||i===0){if(l=v>i?this.textSpans[i].span:createNS(o?"g":"text"),v<=i){if(l.setAttribute("stroke-linecap","butt"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("stroke-miterlimit","4"),this.textSpans[i].span=l,o){var b=createNS("g");l.appendChild(b),this.textSpans[i].childSpan=b}this.textSpans[i].span=l,this.layerElement.appendChild(l)}l.style.display="inherit"}if(h.reset(),p&&(a[i].n&&(f=-g,d+=t.yOffset,d+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(t,h,a[i].line,f,d),f+=a[i].l||0,f+=g),o){_=this.globalData.fontManager.getCharData(t.finalText[i],n.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);var M;if(_.t===1)M=new SVGCompElement(_.data,this.globalData,this);else{var A=emptyShapeData;_.data&&_.data.shapes&&(A=this.buildShapeData(_.data,t.finalSize)),M=new SVGShapeElement(A,this.globalData,this)}if(this.textSpans[i].glyph){var R=this.textSpans[i].glyph;this.textSpans[i].childSpan.removeChild(R.layerElement),R.destroy()}this.textSpans[i].glyph=M,M._debug=!0,M.prepareFrame(0),M.renderFrame(),this.textSpans[i].childSpan.appendChild(M.layerElement),_.t===1&&this.textSpans[i].childSpan.setAttribute("transform","scale("+t.finalSize/100+","+t.finalSize/100+")")}else p&&l.setAttribute("transform","translate("+h.props[12]+","+h.props[13]+")"),l.textContent=a[i].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}p&&l&&l.setAttribute("d",u)}for(;i<this.textSpans.length;)this.textSpans[i].span.style.display="none",i+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var i=this.layerElement.getBBox();this.bbox={top:i.y,left:i.x,width:i.width,height:i.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var i,e=this.textSpans.length,t;for(this.renderedFrame=this.comp.renderedFrame,i=0;i<e;i+=1)t=this.textSpans[i].glyph,t&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){this._sizeChanged=!0;var i,e,t=this.textAnimator.renderedLetters,n=this.textProperty.currentData.l;e=n.length;var r,s,a;for(i=0;i<e;i+=1)n[i].n||(r=t[i],s=this.textSpans[i].span,a=this.textSpans[i].glyph,a&&a.renderFrame(),r._mdf.m&&s.setAttribute("transform",r.m),r._mdf.o&&s.setAttribute("opacity",r.o),r._mdf.sw&&s.setAttribute("stroke-width",r.sw),r._mdf.sc&&s.setAttribute("stroke",r.sc),r._mdf.fc&&s.setAttribute("fill",r.fc))}};function ISolidElement(i,e,t){this.initElement(i,e,t)}extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var i=createNS("rect");i.setAttribute("width",this.data.sw),i.setAttribute("height",this.data.sh),i.setAttribute("fill",this.data.sc),this.layerElement.appendChild(i)};function NullElement(i,e,t){this.initFrame(),this.initBaseData(i,e,t),this.initFrame(),this.initTransform(i,e,t),this.initHierarchy()}NullElement.prototype.prepareFrame=function(i){this.prepareProperties(i,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement);function SVGRendererBase(){}extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(i){return new NullElement(i,this.globalData,this)},SVGRendererBase.prototype.createShape=function(i){return new SVGShapeElement(i,this.globalData,this)},SVGRendererBase.prototype.createText=function(i){return new SVGTextLottieElement(i,this.globalData,this)},SVGRendererBase.prototype.createImage=function(i){return new IImageElement(i,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(i){return new ISolidElement(i,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(i){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+i.w+" "+i.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",i.w),this.svgElement.setAttribute("height",i.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),this.renderConfig.focusable!==void 0&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(i,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=i;var t=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",i.w),n.setAttribute("height",i.h),n.setAttribute("x",0),n.setAttribute("y",0);var r=createElementID();t.setAttribute("id",r),t.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+r+")"),e.appendChild(t),this.layers=i.layers,this.elements=createSizedArray(i.layers.length)},SVGRendererBase.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var i,e=this.layers?this.layers.length:0;for(i=0;i<e;i+=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(i){var e=0,t=this.layers.length;for(e=0;e<t;e+=1)if(this.layers[e].ind===i)return e;return-1},SVGRendererBase.prototype.buildItem=function(i){var e=this.elements;if(!(e[i]||this.layers[i].ty===99)){e[i]=!0;var t=this.createItem(this.layers[i]);if(e[i]=t,getExpressionsPlugin()&&(this.layers[i].ty===0&&this.globalData.projectInterface.registerComposition(t),t.initExpressions()),this.appendElementInPos(t,i),this.layers[i].tt){var n="tp"in this.layers[i]?this.findIndexByInd(this.layers[i].tp):i-1;if(n===-1)return;if(!this.elements[n]||this.elements[n]===!0)this.buildItem(n),this.addPendingElement(t);else{var r=e[n],s=r.getMatte(this.layers[i].tt);t.setMatte(s)}}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();if(i.checkParenting(),i.data.tt)for(var e=0,t=this.elements.length;e<t;){if(this.elements[e]===i){var n="tp"in i.data?this.findIndexByInd(i.data.tp):e-1,r=this.elements[n],s=r.getMatte(this.layers[e].tt);i.setMatte(s);break}e+=1}}},SVGRendererBase.prototype.renderFrame=function(i){if(!(this.renderedFrame===i||this.destroyed)){i===null?i=this.renderedFrame:this.renderedFrame=i,this.globalData.frameNum=i,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=i,this.globalData._mdf=!1;var e,t=this.layers.length;for(this.completeLayers||this.checkLayers(i),e=t-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(i-this.layers[e].st);if(this.globalData._mdf)for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(i,e){var t=i.getBaseElement();if(t){for(var n=0,r;n<e;)this.elements[n]&&this.elements[n]!==!0&&this.elements[n].getBaseElement()&&(r=this.elements[n].getBaseElement()),n+=1;r?this.layerElement.insertBefore(t,r):this.layerElement.appendChild(t)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"};function ICompElement(){}extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(i,e,t){this.initFrame(),this.initBaseData(i,e,t),this.initTransform(i,e,t),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),(this.data.xt||!e.progressiveLoad)&&this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(i){if(this._mdf=!1,this.prepareRenderableFrame(i),this.prepareProperties(i,this.isInRange),!(!this.isInRange&&!this.data.xt)){if(this.tm._placeholder)this.renderedFrame=i/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var t,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&(this.elements[t].prepareFrame(this.renderedFrame-this.layers[t].st),this.elements[t]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var i,e=this.layers.length;for(i=0;i<e;i+=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame()},ICompElement.prototype.setElements=function(i){this.elements=i},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var i,e=this.layers.length;for(i=0;i<e;i+=1)this.elements[i]&&this.elements[i].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()};function SVGCompElement(i,e,t){this.layers=i.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(i,e,t),this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0}}extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(i){return new SVGCompElement(i,this.globalData,this)};function SVGRenderer(i,e){this.animationItem=i,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var t="";if(e&&e.title){var n=createNS("title"),r=createElementID();n.setAttribute("id",r),n.textContent=e.title,this.svgElement.appendChild(n),t+=r}if(e&&e.description){var s=createNS("desc"),a=createElementID();s.setAttribute("id",a),s.textContent=e.description,this.svgElement.appendChild(s),t+=" "+a}t&&this.svgElement.setAttribute("aria-labelledby",t);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&e.hideOnTransparent===!1),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"},width:e&&e.width,height:e&&e.height,runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(i){return new SVGCompElement(i,this.globalData,this)};function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}ShapeTransformManager.prototype={addTransformSequence:function(e){var t,n=e.length,r="_";for(t=0;t<n;t+=1)r+=e[t].transform.key+"_";var s=this.sequences[r];return s||(s={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[r]=s,this.sequenceList.push(s)),s},processSequence:function(e,t){for(var n=0,r=e.transforms.length,s=t;n<r&&!t;){if(e.transforms[n].transform.mProps._mdf){s=!0;break}n+=1}if(s)for(e.finalTransform.reset(),n=r-1;n>=0;n-=1)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=s},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t<n;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,n=null,r=null;function s(){var l=createNS("svg"),h=createNS("filter"),u=createNS("feColorMatrix");return h.setAttribute("id",e),u.setAttribute("type","matrix"),u.setAttribute("color-interpolation-filters","sRGB"),u.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),h.appendChild(u),l.appendChild(h),l.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(l.style.display="none"),l}function a(){t||(r=s(),document.body.appendChild(r),t=createTag("canvas"),n=t.getContext("2d"),n.filter="url(#"+e+")",n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1))}function o(l){return t||a(),t.width=l.width,t.height=l.height,n.filter="url(#"+e+")",t}return{load:a,get:o}};function createCanvas(i,e){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(i,e);var t=createTag("canvas");return t.width=i,t.height=e,t}var assetLoader=(function(){return{loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas}})(),registeredEffects={};function CVEffects(i){var e,t=i.data.ef?i.data.ef.length:0;this.filters=[];var n;for(e=0;e<t;e+=1){n=null;var r=i.data.ef[e].ty;if(registeredEffects[r]){var s=registeredEffects[r].effect;n=new s(i.effectsManager.effectElements[e],i)}n&&this.filters.push(n)}this.filters.length&&i.addRenderableComponent(this)}CVEffects.prototype.renderFrame=function(i){var e,t=this.filters.length;for(e=0;e<t;e+=1)this.filters[e].renderFrame(i)},CVEffects.prototype.getEffects=function(i){var e,t=this.filters.length,n=[];for(e=0;e<t;e+=1)this.filters[e].type===i&&n.push(this.filters[e]);return n};function registerEffect(i,e){registeredEffects[i]={effect:e}}function CVMaskElement(i,e){this.data=i,this.element=e,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var t,n=this.masksProperties.length,r=!1;for(t=0;t<n;t+=1)this.masksProperties[t].mode!=="n"&&(r=!0),this.viewData[t]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[t],3);this.hasMasks=r,r&&this.element.addRenderableComponent(this)}CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var i=this.element.finalTransform.mat,e=this.element.canvasContext,t,n=this.masksProperties.length,r,s,a;for(e.beginPath(),t=0;t<n;t+=1)if(this.masksProperties[t].mode!=="n"){this.masksProperties[t].inv&&(e.moveTo(0,0),e.lineTo(this.element.globalData.compSize.w,0),e.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),e.lineTo(0,this.element.globalData.compSize.h),e.lineTo(0,0)),a=this.viewData[t].v,r=i.applyToPointArray(a.v[0][0],a.v[0][1],0),e.moveTo(r[0],r[1]);var o,l=a._length;for(o=1;o<l;o+=1)s=i.applyToTriplePoints(a.o[o-1],a.i[o],a.v[o]),e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);s=i.applyToTriplePoints(a.o[o-1],a.i[0],a.v[0]),e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}this.element.globalData.renderer.save(!0),e.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};function CVBaseElement(){}var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0],t=e.getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var n=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(n.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas),s=r.getContext("2d");s.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(i,e,t,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var r=4;e.ty==="rc"?r=5:e.ty==="el"?r=6:e.ty==="sr"&&(r=7),this.sh=ShapePropertyFactory.getShapeProp(i,e,r,i);var s,a=t.length,o;for(s=0;s<a;s+=1)t[s].closed||(o={transforms:n.addTransformSequence(t[s].transforms),trNodes:[]},this.styledShapes.push(o),t[s].elements.push(o))}CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated;function CVShapeElement(i,e,t){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(i,e){var t={data:i,type:i.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:i.hd===!0},n={};if(i.ty==="fl"||i.ty==="st"?(n.c=PropertyFactory.getProp(this,i.c,1,255,this),n.c.k||(t.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):(i.ty==="gf"||i.ty==="gs")&&(n.s=PropertyFactory.getProp(this,i.s,1,null,this),n.e=PropertyFactory.getProp(this,i.e,1,null,this),n.h=PropertyFactory.getProp(this,i.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,i.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,i.g,this)),n.o=PropertyFactory.getProp(this,i.o,0,.01,this),i.ty==="st"||i.ty==="gs"){if(t.lc=lineCapEnum[i.lc||2],t.lj=lineJoinEnum[i.lj||2],i.lj==1&&(t.ml=i.ml),n.w=PropertyFactory.getProp(this,i.w,0,null,this),n.w.k||(t.wi=n.w.v),i.d){var r=new DashProperty(this,i.d,"canvas",this);n.d=r,n.d.k||(t.da=n.d.dashArray,t.do=n.d.dashoffset[0])}}else t.r=i.r===2?"evenodd":"nonzero";return this.stylesList.push(t),n.style=t,n},CVShapeElement.prototype.createGroupElement=function(){var i={it:[],prevViewData:[]};return i},CVShapeElement.prototype.createTransformElement=function(i){var e={transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,i.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,i,this)}};return e},CVShapeElement.prototype.createShapeElement=function(i){var e=new CVShapeData(this,i,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var i,e=this.itemsData.length;for(i=0;i<e;i+=1)this.prevViewData[i]=this.itemsData[i];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),e=this.dynamicProperties.length,i=0;i<e;i+=1)this.dynamicProperties[i].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(i){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.push(i)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var i,e=this.stylesList.length;for(i=0;i<e;i+=1)this.stylesList[i].closed||this.stylesList[i].transforms.pop()},CVShapeElement.prototype.closeStyles=function(i){var e,t=i.length;for(e=0;e<t;e+=1)i[e].closed=!0},CVShapeElement.prototype.searchShapes=function(i,e,t,n,r){var s,a=i.length-1,o,l,h=[],u=[],p,f,d,m=[].concat(r);for(s=a;s>=0;s-=1){if(p=this.searchProcessedElement(i[s]),p?e[s]=t[p-1]:i[s]._shouldRender=n,i[s].ty==="fl"||i[s].ty==="st"||i[s].ty==="gf"||i[s].ty==="gs")p?e[s].style.closed=!1:e[s]=this.createStyleElement(i[s],m),h.push(e[s].style);else if(i[s].ty==="gr"){if(!p)e[s]=this.createGroupElement(i[s]);else for(l=e[s].it.length,o=0;o<l;o+=1)e[s].prevViewData[o]=e[s].it[o];this.searchShapes(i[s].it,e[s].it,e[s].prevViewData,n,m)}else i[s].ty==="tr"?(p||(d=this.createTransformElement(i[s]),e[s]=d),m.push(e[s]),this.addTransformToStyleList(e[s])):i[s].ty==="sh"||i[s].ty==="rc"||i[s].ty==="el"||i[s].ty==="sr"?p||(e[s]=this.createShapeElement(i[s])):i[s].ty==="tm"||i[s].ty==="rd"||i[s].ty==="pb"||i[s].ty==="zz"||i[s].ty==="op"?(p?(f=e[s],f.closed=!1):(f=ShapeModifiers.getModifier(i[s].ty),f.init(this,i[s]),e[s]=f,this.shapeModifiers.push(f)),u.push(f)):i[s].ty==="rp"&&(p?(f=e[s],f.closed=!0):(f=ShapeModifiers.getModifier(i[s].ty),e[s]=f,f.init(this,i,s,e),this.shapeModifiers.push(f),n=!1),u.push(f));this.addProcessedElement(i[s],s+1)}for(this.removeTransformFromStyleList(),this.closeStyles(h),a=u.length,s=0;s<a;s+=1)u[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(i,e){(i._opMdf||e.op._mdf||this._isFirstFrame)&&(e.opacity=i.opacity,e.opacity*=e.op.v,e._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var i,e=this.stylesList.length,t,n,r,s,a,o,l=this.globalData.renderer,h=this.globalData.canvasContext,u,p;for(i=0;i<e;i+=1)if(p=this.stylesList[i],u=p.type,!((u==="st"||u==="gs")&&p.wi===0||!p.data._shouldRender||p.coOp===0||this.globalData.currentGlobalAlpha===0)){for(l.save(),a=p.elements,u==="st"||u==="gs"?(l.ctxStrokeStyle(u==="st"?p.co:p.grd),l.ctxLineWidth(p.wi),l.ctxLineCap(p.lc),l.ctxLineJoin(p.lj),l.ctxMiterLimit(p.ml||0)):l.ctxFillStyle(u==="fl"?p.co:p.grd),l.ctxOpacity(p.coOp),u!=="st"&&u!=="gs"&&h.beginPath(),l.ctxTransform(p.preTransforms.finalTransform.props),n=a.length,t=0;t<n;t+=1){for((u==="st"||u==="gs")&&(h.beginPath(),p.da&&(h.setLineDash(p.da),h.lineDashOffset=p.do)),o=a[t].trNodes,s=o.length,r=0;r<s;r+=1)o[r].t==="m"?h.moveTo(o[r].p[0],o[r].p[1]):o[r].t==="c"?h.bezierCurveTo(o[r].pts[0],o[r].pts[1],o[r].pts[2],o[r].pts[3],o[r].pts[4],o[r].pts[5]):h.closePath();(u==="st"||u==="gs")&&(l.ctxStroke(),p.da&&h.setLineDash(this.dashResetter))}u!=="st"&&u!=="gs"&&this.globalData.renderer.ctxFill(p.r),l.restore()}},CVShapeElement.prototype.renderShape=function(i,e,t,n){var r,s=e.length-1,a;for(a=i,r=s;r>=0;r-=1)e[r].ty==="tr"?(a=t[r].transform,this.renderShapeTransform(i,a)):e[r].ty==="sh"||e[r].ty==="el"||e[r].ty==="rc"||e[r].ty==="sr"?this.renderPath(e[r],t[r]):e[r].ty==="fl"?this.renderFill(e[r],t[r],a):e[r].ty==="st"?this.renderStroke(e[r],t[r],a):e[r].ty==="gf"||e[r].ty==="gs"?this.renderGradientFill(e[r],t[r],a):e[r].ty==="gr"?this.renderShape(a,e[r].it,t[r].it):e[r].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(i,e){if(this._isFirstFrame||e._mdf||i.transforms._mdf){var t=i.trNodes,n=e.paths,r,s,a,o=n._length;t.length=0;var l=i.transforms.finalTransform;for(a=0;a<o;a+=1){var h=n.shapes[a];if(h&&h.v){for(s=h._length,r=1;r<s;r+=1)r===1&&t.push({t:"m",p:l.applyToPointArray(h.v[0][0],h.v[0][1],0)}),t.push({t:"c",pts:l.applyToTriplePoints(h.o[r-1],h.i[r],h.v[r])});s===1&&t.push({t:"m",p:l.applyToPointArray(h.v[0][0],h.v[0][1],0)}),h.c&&s&&(t.push({t:"c",pts:l.applyToTriplePoints(h.o[r-1],h.i[0],h.v[0])}),t.push({t:"z"}))}}i.trNodes=t}},CVShapeElement.prototype.renderPath=function(i,e){if(i.hd!==!0&&i._shouldRender){var t,n=e.styledShapes.length;for(t=0;t<n;t+=1)this.renderStyledShape(e.styledShapes[t],e.sh)}},CVShapeElement.prototype.renderFill=function(i,e,t){var n=e.style;(e.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||t._opMdf||this._isFirstFrame)&&(n.coOp=e.o.v*t.opacity)},CVShapeElement.prototype.renderGradientFill=function(i,e,t){var n=e.style,r;if(!n.grd||e.g._mdf||e.s._mdf||e.e._mdf||i.t!==1&&(e.h._mdf||e.a._mdf)){var s=this.globalData.canvasContext,a=e.s.v,o=e.e.v;if(i.t===1)r=s.createLinearGradient(a[0],a[1],o[0],o[1]);else{var l=Math.sqrt(Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)),h=Math.atan2(o[1]-a[1],o[0]-a[0]),u=e.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var p=l*u,f=Math.cos(h+e.a.v)*p+a[0],d=Math.sin(h+e.a.v)*p+a[1];r=s.createRadialGradient(f,d,0,a[0],a[1],l)}var m,g=i.g.p,y=e.g.c,c=1;for(m=0;m<g;m+=1)e.g._hasOpacity&&e.g._collapsable&&(c=e.g.o[m*2+1]),r.addColorStop(y[m*4]/100,"rgba("+y[m*4+1]+","+y[m*4+2]+","+y[m*4+3]+","+c+")");n.grd=r}n.coOp=e.o.v*t.opacity},CVShapeElement.prototype.renderStroke=function(i,e,t){var n=e.style,r=e.d;r&&(r._mdf||this._isFirstFrame)&&(n.da=r.dashArray,n.do=r.dashoffset[0]),(e.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||t._opMdf||this._isFirstFrame)&&(n.coOp=e.o.v*t.opacity),(e.w._mdf||this._isFirstFrame)&&(n.wi=e.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0};function CVTextElement(i,e,t){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i.l?i.l.length:0);var e=!1;i.fc?(e=!0,this.values.fill=this.buildColor(i.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=e;var t=!1;i.sc&&(t=!0,this.values.stroke=this.buildColor(i.sc),this.values.sWidth=i.sw);var n=this.globalData.fontManager.getFontByName(i.f),r,s,a=i.l,o=this.mHelper;this.stroke=t,this.values.fValue=i.finalSize+"px "+this.globalData.fontManager.getFontByName(i.f).fFamily,s=i.finalText.length;var l,h,u,p,f,d,m,g,y,c,x=this.data.singleShape,v=i.tr*.001*i.finalSize,_=0,b=0,M=!0,A=0;for(r=0;r<s;r+=1){l=this.globalData.fontManager.getCharData(i.finalText[r],n.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily),h=l&&l.data||{},o.reset(),x&&a[r].n&&(_=-v,b+=i.yOffset,b+=M?1:0,M=!1),f=h.shapes?h.shapes[0].it:[],m=f.length,o.scale(i.finalSize/100,i.finalSize/100),x&&this.applyTextPropertiesToMatrix(i,o,a[r].line,_,b),y=createSizedArray(m-1);var R=0;for(d=0;d<m;d+=1)if(f[d].ty==="sh"){for(p=f[d].ks.k.i.length,g=f[d].ks.k,c=[],u=1;u<p;u+=1)u===1&&c.push(o.applyToX(g.v[0][0],g.v[0][1],0),o.applyToY(g.v[0][0],g.v[0][1],0)),c.push(o.applyToX(g.o[u-1][0],g.o[u-1][1],0),o.applyToY(g.o[u-1][0],g.o[u-1][1],0),o.applyToX(g.i[u][0],g.i[u][1],0),o.applyToY(g.i[u][0],g.i[u][1],0),o.applyToX(g.v[u][0],g.v[u][1],0),o.applyToY(g.v[u][0],g.v[u][1],0));c.push(o.applyToX(g.o[u-1][0],g.o[u-1][1],0),o.applyToY(g.o[u-1][0],g.o[u-1][1],0),o.applyToX(g.i[0][0],g.i[0][1],0),o.applyToY(g.i[0][0],g.i[0][1],0),o.applyToX(g.v[0][0],g.v[0][1],0),o.applyToY(g.v[0][0],g.v[0][1],0)),y[R]=c,R+=1}x&&(_+=a[r].l,_+=v),this.textSpans[A]?this.textSpans[A].elem=y:this.textSpans[A]={elem:y},A+=1}},CVTextElement.prototype.renderInnerContent=function(){this.validateText();var i=this.canvasContext;i.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var e,t,n,r,s,a,o=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;t=l.length;var h,u=null,p=null,f=null,d,m,g=this.globalData.renderer;for(e=0;e<t;e+=1)if(!l[e].n){if(h=o[e],h&&(g.save(),g.ctxTransform(h.p),g.ctxOpacity(h.o)),this.fill){for(h&&h.fc?u!==h.fc&&(g.ctxFillStyle(h.fc),u=h.fc):u!==this.values.fill&&(u=this.values.fill,g.ctxFillStyle(this.values.fill)),d=this.textSpans[e].elem,r=d.length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(m=d[n],a=m.length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),g.ctxFill()}if(this.stroke){for(h&&h.sw?f!==h.sw&&(f=h.sw,g.ctxLineWidth(h.sw)):f!==this.values.sWidth&&(f=this.values.sWidth,g.ctxLineWidth(this.values.sWidth)),h&&h.sc?p!==h.sc&&(p=h.sc,g.ctxStrokeStyle(h.sc)):p!==this.values.stroke&&(p=this.values.stroke,g.ctxStrokeStyle(this.values.stroke)),d=this.textSpans[e].elem,r=d.length,this.globalData.canvasContext.beginPath(),n=0;n<r;n+=1)for(m=d[n],a=m.length,this.globalData.canvasContext.moveTo(m[0],m[1]),s=2;s<a;s+=6)this.globalData.canvasContext.bezierCurveTo(m[s],m[s+1],m[s+2],m[s+3],m[s+4],m[s+5]);this.globalData.canvasContext.closePath(),g.ctxStroke()}h&&this.globalData.renderer.restore()}};function CVImageElement(i,e,t){this.assetData=e.getAssetData(i.refId),this.img=e.imageLoader.getAsset(this.assetData),this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var i=createTag("canvas");i.width=this.assetData.w,i.height=this.assetData.h;var e=i.getContext("2d"),t=this.img.width,n=this.img.height,r=t/n,s=this.assetData.w/this.assetData.h,a,o,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;r>s&&l==="xMidYMid slice"||r<s&&l!=="xMidYMid slice"?(o=n,a=o*s):(a=t,o=a/s),e.drawImage(this.img,(t-a)/2,(n-o)/2,a,o,0,0,this.assetData.w,this.assetData.h),this.img=i}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null};function CVSolidElement(i,e,t){this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)};function CanvasRendererBase(){}extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(i){return new CVShapeElement(i,this.globalData,this)},CanvasRendererBase.prototype.createText=function(i){return new CVTextElement(i,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(i){return new CVImageElement(i,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(i){return new CVSolidElement(i,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(i){i[0]===1&&i[1]===0&&i[4]===0&&i[5]===1&&i[12]===0&&i[13]===0||this.canvasContext.transform(i[0],i[1],i[4],i[5],i[12],i[13])},CanvasRendererBase.prototype.ctxOpacity=function(i){this.canvasContext.globalAlpha*=i<0?0:i},CanvasRendererBase.prototype.ctxFillStyle=function(i){this.canvasContext.fillStyle=i},CanvasRendererBase.prototype.ctxStrokeStyle=function(i){this.canvasContext.strokeStyle=i},CanvasRendererBase.prototype.ctxLineWidth=function(i){this.canvasContext.lineWidth=i},CanvasRendererBase.prototype.ctxLineCap=function(i){this.canvasContext.lineCap=i},CanvasRendererBase.prototype.ctxLineJoin=function(i){this.canvasContext.lineJoin=i},CanvasRendererBase.prototype.ctxMiterLimit=function(i){this.canvasContext.miterLimit=i},CanvasRendererBase.prototype.ctxFill=function(i){this.canvasContext.fill(i)},CanvasRendererBase.prototype.ctxFillRect=function(i,e,t,n){this.canvasContext.fillRect(i,e,t,n)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){if(!this.renderConfig.clearCanvas){this.canvasContext.restore();return}this.contextData.reset()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(i){if(!this.renderConfig.clearCanvas){this.canvasContext.restore();return}i&&(this.globalData.blendMode="source-over"),this.contextData.restore(i)},CanvasRendererBase.prototype.configAnimation=function(i){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var e=this.animationItem.container.style;e.width="100%",e.height="100%";var t="0px 0px 0px";e.transformOrigin=t,e.mozTransformOrigin=t,e.webkitTransformOrigin=t,e["-webkit-transform"]=t,e.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=i,this.layers=i.layers,this.transformCanvas={w:i.w,h:i.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(i,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(i.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(i,e){this.reset();var t,n;i?(t=i,n=e,this.canvasContext.canvas.width=t,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(t=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(t=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=t*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr);var r,s;if(this.renderConfig.preserveAspectRatio.indexOf("meet")!==-1||this.renderConfig.preserveAspectRatio.indexOf("slice")!==-1){var a=this.renderConfig.preserveAspectRatio.split(" "),o=a[1]||"meet",l=a[0]||"xMidYMid",h=l.substr(0,4),u=l.substr(4);r=t/n,s=this.transformCanvas.w/this.transformCanvas.h,s>r&&o==="meet"||s<r&&o==="slice"?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=t/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),h==="xMid"&&(s<r&&o==="meet"||s>r&&o==="slice")?this.transformCanvas.tx=(t-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:h==="xMax"&&(s<r&&o==="meet"||s>r&&o==="slice")?this.transformCanvas.tx=(t-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u==="YMid"&&(s>r&&o==="meet"||s<r&&o==="slice")?this.transformCanvas.ty=(n-this.transformCanvas.h*(t/this.transformCanvas.w))/2*this.renderConfig.dpr:u==="YMax"&&(s>r&&o==="meet"||s<r&&o==="slice")?this.transformCanvas.ty=(n-this.transformCanvas.h*(t/this.transformCanvas.w))*this.renderConfig.dpr:this.transformCanvas.ty=0}else this.renderConfig.preserveAspectRatio==="none"?(this.transformCanvas.sx=t/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText="");var i,e=this.layers?this.layers.length:0;for(i=e-1;i>=0;i-=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(i,e){if(!(this.renderedFrame===i&&this.renderConfig.clearCanvas===!0&&!e||this.destroyed||i===-1)){this.renderedFrame=i,this.globalData.frameNum=i-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=i;var t,n=this.layers.length;for(this.completeLayers||this.checkLayers(i),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(i-this.layers[t].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),t=n-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(i){var e=this.elements;if(!(e[i]||this.layers[i].ty===99)){var t=this.createItem(this.layers[i],this,this.globalData);e[i]=t,t.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();i.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var i,e=15;for(i=0;i<e;i+=1){var t=new CanvasContext;this.stack[i]=t}this._length=e,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}CVContextData.prototype.duplicate=function(){var i=this._length*2,e=0;for(e=this._length;e<i;e+=1)this.stack[e]=new CanvasContext;this._length=i},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(i){this.cArrPos-=1;var e=this.stack[this.cArrPos],t=e.transform,n,r=this.cTr.props;for(n=0;n<16;n+=1)r[n]=t[n];if(i){this.nativeContext.restore();var s=this.stack[this.cArrPos+1];this.appliedFillStyle=s.fillStyle,this.appliedStrokeStyle=s.strokeStyle,this.appliedLineWidth=s.lineWidth,this.appliedLineCap=s.lineCap,this.appliedLineJoin=s.lineJoin,this.appliedMiterLimit=s.miterLimit}this.nativeContext.setTransform(t[0],t[1],t[4],t[5],t[12],t[13]),(i||e.opacity!==-1&&this.currentOpacity!==e.opacity)&&(this.nativeContext.globalAlpha=e.opacity,this.currentOpacity=e.opacity),this.currentFillStyle=e.fillStyle,this.currentStrokeStyle=e.strokeStyle,this.currentLineWidth=e.lineWidth,this.currentLineCap=e.lineCap,this.currentLineJoin=e.lineJoin,this.currentMiterLimit=e.miterLimit},CVContextData.prototype.save=function(i){i&&this.nativeContext.save();var e=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var t=this.stack[this.cArrPos],n;for(n=0;n<16;n+=1)t.transform[n]=e[n];this.cArrPos+=1;var r=this.stack[this.cArrPos];r.opacity=t.opacity,r.fillStyle=t.fillStyle,r.strokeStyle=t.strokeStyle,r.lineWidth=t.lineWidth,r.lineCap=t.lineCap,r.lineJoin=t.lineJoin,r.miterLimit=t.miterLimit},CVContextData.prototype.setOpacity=function(i){this.stack[this.cArrPos].opacity=i},CVContextData.prototype.setContext=function(i){this.nativeContext=i},CVContextData.prototype.fillStyle=function(i){this.stack[this.cArrPos].fillStyle!==i&&(this.currentFillStyle=i,this.stack[this.cArrPos].fillStyle=i)},CVContextData.prototype.strokeStyle=function(i){this.stack[this.cArrPos].strokeStyle!==i&&(this.currentStrokeStyle=i,this.stack[this.cArrPos].strokeStyle=i)},CVContextData.prototype.lineWidth=function(i){this.stack[this.cArrPos].lineWidth!==i&&(this.currentLineWidth=i,this.stack[this.cArrPos].lineWidth=i)},CVContextData.prototype.lineCap=function(i){this.stack[this.cArrPos].lineCap!==i&&(this.currentLineCap=i,this.stack[this.cArrPos].lineCap=i)},CVContextData.prototype.lineJoin=function(i){this.stack[this.cArrPos].lineJoin!==i&&(this.currentLineJoin=i,this.stack[this.cArrPos].lineJoin=i)},CVContextData.prototype.miterLimit=function(i){this.stack[this.cArrPos].miterLimit!==i&&(this.currentMiterLimit=i,this.stack[this.cArrPos].miterLimit=i)},CVContextData.prototype.transform=function(i){this.transformMat.cloneFromProps(i);var e=this.cTr;this.transformMat.multiply(e),e.cloneFromProps(this.transformMat.props);var t=e.props;this.nativeContext.setTransform(t[0],t[1],t[4],t[5],t[12],t[13])},CVContextData.prototype.opacity=function(i){var e=this.stack[this.cArrPos].opacity;e*=i<0?0:i,this.stack[this.cArrPos].opacity!==e&&(this.currentOpacity!==i&&(this.nativeContext.globalAlpha=i,this.currentOpacity=i),this.stack[this.cArrPos].opacity=e)},CVContextData.prototype.fill=function(i){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(i)},CVContextData.prototype.fillRect=function(i,e,t,n){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(i,e,t,n)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()};function CVCompElement(i,e,t){this.completeLayers=!1,this.layers=i.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(i,e,t),this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0}}extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var i=this.canvasContext;i.beginPath(),i.moveTo(0,0),i.lineTo(this.data.w,0),i.lineTo(this.data.w,this.data.h),i.lineTo(0,this.data.h),i.lineTo(0,0),i.clip();var e,t=this.layers.length;for(e=t-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var i,e=this.layers.length;for(i=e-1;i>=0;i-=1)this.elements[i]&&this.elements[i].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(i){return new CVCompElement(i,this.globalData,this)};function CanvasRenderer(i,e){this.animationItem=i,this.renderConfig={clearCanvas:e&&e.clearCanvas!==void 0?e.clearCanvas:!0,context:e&&e.context||null,progressiveLoad:e&&e.progressiveLoad||!1,preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",className:e&&e.className||"",id:e&&e.id||"",runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.renderConfig.dpr=e&&e.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=e&&e.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(i){return new CVCompElement(i,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(i,e,t){this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var i;this.data.hasMask?(i=createNS("rect"),i.setAttribute("width",this.data.sw),i.setAttribute("height",this.data.sh),i.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(i=createTag("div"),i.style.width=this.data.sw+"px",i.style.height=this.data.sh+"px",i.style.backgroundColor=this.data.sc),this.layerElement.appendChild(i)};function HShapeElement(i,e,t){this.shapes=[],this.shapesData=i.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(i,e,t),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var i;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),i=this.svgElement;else{i=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;i.setAttribute("width",e.w),i.setAttribute("height",e.h),i.appendChild(this.shapesContainer),this.layerElement.appendChild(i)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=i},HShapeElement.prototype.getTransformedPoint=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)e=i[t].mProps.v.applyToPointArray(e[0],e[1],0);return e},HShapeElement.prototype.calculateShapeBoundingBox=function(i,e){var t=i.sh.v,n=i.transformers,r,s=t._length,a,o,l,h;if(!(s<=1)){for(r=0;r<s-1;r+=1)a=this.getTransformedPoint(n,t.v[r]),o=this.getTransformedPoint(n,t.o[r]),l=this.getTransformedPoint(n,t.i[r+1]),h=this.getTransformedPoint(n,t.v[r+1]),this.checkBounds(a,o,l,h,e);t.c&&(a=this.getTransformedPoint(n,t.v[r]),o=this.getTransformedPoint(n,t.o[r]),l=this.getTransformedPoint(n,t.i[0]),h=this.getTransformedPoint(n,t.v[0]),this.checkBounds(a,o,l,h,e))}},HShapeElement.prototype.checkBounds=function(i,e,t,n,r){this.getBoundsOfCurve(i,e,t,n);var s=this.shapeBoundingBox;r.x=bmMin(s.left,r.x),r.xMax=bmMax(s.right,r.xMax),r.y=bmMin(s.top,r.y),r.yMax=bmMax(s.bottom,r.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(i,e,t,n){for(var r=[[i[0],n[0]],[i[1],n[1]]],s,a,o,l,h,u,p,f=0;f<2;++f)a=6*i[f]-12*e[f]+6*t[f],s=-3*i[f]+9*e[f]-9*t[f]+3*n[f],o=3*e[f]-3*i[f],a|=0,s|=0,o|=0,s===0&&a===0||(s===0?(l=-o/a,l>0&&l<1&&r[f].push(this.calculateF(l,i,e,t,n,f))):(h=a*a-4*o*s,h>=0&&(u=(-a+bmSqrt(h))/(2*s),u>0&&u<1&&r[f].push(this.calculateF(u,i,e,t,n,f)),p=(-a-bmSqrt(h))/(2*s),p>0&&p<1&&r[f].push(this.calculateF(p,i,e,t,n,f)))));this.shapeBoundingBox.left=bmMin.apply(null,r[0]),this.shapeBoundingBox.top=bmMin.apply(null,r[1]),this.shapeBoundingBox.right=bmMax.apply(null,r[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,r[1])},HShapeElement.prototype.calculateF=function(i,e,t,n,r,s){return bmPow(1-i,3)*e[s]+3*bmPow(1-i,2)*i*t[s]+3*(1-i)*bmPow(i,2)*n[s]+bmPow(i,3)*r[s]},HShapeElement.prototype.calculateBoundingBox=function(i,e){var t,n=i.length;for(t=0;t<n;t+=1)i[t]&&i[t].sh?this.calculateShapeBoundingBox(i[t],e):i[t]&&i[t].it?this.calculateBoundingBox(i[t].it,e):i[t]&&i[t].style&&i[t].w&&this.expandStrokeBoundingBox(i[t].w,e)},HShapeElement.prototype.expandStrokeBoundingBox=function(i,e){var t=0;if(i.keyframes){for(var n=0;n<i.keyframes.length;n+=1){var r=i.keyframes[n].s;r>t&&(t=r)}t*=i.mult}else t=i.v*i.mult;e.x-=t,e.xMax+=t,e.y-=t,e.yMax+=t},HShapeElement.prototype.currentBoxContains=function(i){return this.currentBBox.x<=i.x&&this.currentBBox.y<=i.y&&this.currentBBox.width+this.currentBBox.x>=i.x+i.width&&this.currentBBox.height+this.currentBBox.y>=i.y+i.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var i=this.tempBoundingBox,e=999999;if(i.x=e,i.xMax=-e,i.y=e,i.yMax=-e,this.calculateBoundingBox(this.itemsData,i),i.width=i.xMax<i.x?0:i.xMax-i.x,i.height=i.yMax<i.y?0:i.yMax-i.y,this.currentBoxContains(i))return;var t=!1;if(this.currentBBox.w!==i.width&&(this.currentBBox.w=i.width,this.shapeCont.setAttribute("width",i.width),t=!0),this.currentBBox.h!==i.height&&(this.currentBBox.h=i.height,this.shapeCont.setAttribute("height",i.height),t=!0),t||this.currentBBox.x!==i.x||this.currentBBox.y!==i.y){this.currentBBox.w=i.width,this.currentBBox.h=i.height,this.currentBBox.x=i.x,this.currentBBox.y=i.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,r="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=r,n.webkitTransform=r}}};function HTextElement(i,e,t){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var i=createNS("g");this.maskedElement.appendChild(i),this.innerElem=i}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var i=this.textProperty.currentData;this.renderedLetters=createSizedArray(i.l?i.l.length:0);var e=this.innerElem.style,t=i.fc?this.buildColor(i.fc):"rgba(0,0,0,0)";e.fill=t,e.color=t,i.sc&&(e.stroke=this.buildColor(i.sc),e.strokeWidth=i.sw+"px");var n=this.globalData.fontManager.getFontByName(i.f);if(!this.globalData.fontManager.chars)if(e.fontSize=i.finalSize+"px",e.lineHeight=i.finalSize+"px",n.fClass)this.innerElem.className=n.fClass;else{e.fontFamily=n.fFamily;var r=i.fWeight,s=i.fStyle;e.fontStyle=s,e.fontWeight=r}var a,o,l=i.l;o=l.length;var h,u,p,f=this.mHelper,d,m="",g=0;for(a=0;a<o;a+=1){if(this.globalData.fontManager.chars?(this.textPaths[g]?h=this.textPaths[g]:(h=createNS("path"),h.setAttribute("stroke-linecap",lineCapEnum[1]),h.setAttribute("stroke-linejoin",lineJoinEnum[2]),h.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[g]?(u=this.textSpans[g],p=u.children[0]):(u=createTag("div"),u.style.lineHeight=0,p=createNS("svg"),p.appendChild(h),styleDiv(u)))):this.isMasked?h=this.textPaths[g]?this.textPaths[g]:createNS("text"):this.textSpans[g]?(u=this.textSpans[g],h=this.textPaths[g]):(u=createTag("span"),styleDiv(u),h=createTag("span"),styleDiv(h),u.appendChild(h)),this.globalData.fontManager.chars){var y=this.globalData.fontManager.getCharData(i.finalText[a],n.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily),c;if(y?c=y.data:c=null,f.reset(),c&&c.shapes&&c.shapes.length&&(d=c.shapes[0].it,f.scale(i.finalSize/100,i.finalSize/100),m=this.createPathShape(f,d),h.setAttribute("d",m)),this.isMasked)this.innerElem.appendChild(h);else{if(this.innerElem.appendChild(u),c&&c.shapes){document.body.appendChild(p);var x=p.getBBox();p.setAttribute("width",x.width+2),p.setAttribute("height",x.height+2),p.setAttribute("viewBox",x.x-1+" "+(x.y-1)+" "+(x.width+2)+" "+(x.height+2));var v=p.style,_="translate("+(x.x-1)+"px,"+(x.y-1)+"px)";v.transform=_,v.webkitTransform=_,l[a].yOffset=x.y-1}else p.setAttribute("width",1),p.setAttribute("height",1);u.appendChild(p)}}else if(h.textContent=l[a].val,h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(h);else{this.innerElem.appendChild(u);var b=h.style,M="translate3d(0,"+-i.finalSize/1.2+"px,0)";b.transform=M,b.webkitTransform=M}this.isMasked?this.textSpans[g]=h:this.textSpans[g]=u,this.textSpans[g].style.display="block",this.textPaths[g]=h,g+=1}for(;g<this.textSpans.length;)this.textSpans[g].style.display="none",g+=1},HTextElement.prototype.renderInnerContent=function(){this.validateText();var i;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),i=this.svgElement.style;var e="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";i.transform=e,i.webkitTransform=e}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),!(!this.lettersChangedFlag&&!this.textAnimator.lettersChangedFlag)){var t,n,r=0,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;n=a.length;var o,l,h;for(t=0;t<n;t+=1)a[t].n?r+=1:(l=this.textSpans[t],h=this.textPaths[t],o=s[r],r+=1,o._mdf.m&&(this.isMasked?l.setAttribute("transform",o.m):(l.style.webkitTransform=o.m,l.style.transform=o.m)),l.style.opacity=o.o,o.sw&&o._mdf.sw&&h.setAttribute("stroke-width",o.sw),o.sc&&o._mdf.sc&&h.setAttribute("stroke",o.sc),o.fc&&o._mdf.fc&&(h.setAttribute("fill",o.fc),h.style.color=o.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var u=this.innerElem.getBBox();this.currentBBox.w!==u.width&&(this.currentBBox.w=u.width,this.svgElement.setAttribute("width",u.width)),this.currentBBox.h!==u.height&&(this.currentBBox.h=u.height,this.svgElement.setAttribute("height",u.height));var p=1;if(this.currentBBox.w!==u.width+p*2||this.currentBBox.h!==u.height+p*2||this.currentBBox.x!==u.x-p||this.currentBBox.y!==u.y-p){this.currentBBox.w=u.width+p*2,this.currentBBox.h=u.height+p*2,this.currentBBox.x=u.x-p,this.currentBBox.y=u.y-p,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),i=this.svgElement.style;var f="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";i.transform=f,i.webkitTransform=f}}}};function HCameraElement(i,e,t){this.initFrame(),this.initBaseData(i,e,t),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,i.pe,0,0,this),i.ks.p.s?(this.px=n(this,i.ks.p.x,1,0,this),this.py=n(this,i.ks.p.y,1,0,this),this.pz=n(this,i.ks.p.z,1,0,this)):this.p=n(this,i.ks.p,1,0,this),i.ks.a&&(this.a=n(this,i.ks.a,1,0,this)),i.ks.or.k.length&&i.ks.or.k[0].to){var r,s=i.ks.or.k.length;for(r=0;r<s;r+=1)i.ks.or.k[r].to=null,i.ks.or.k[r].ti=null}this.or=n(this,i.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,i.ks.rx,0,degToRads,this),this.ry=n(this,i.ks.ry,0,degToRads,this),this.rz=n(this,i.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var i,e=this.comp.threeDElements.length,t,n,r;for(i=0;i<e;i+=1)if(t=this.comp.threeDElements[i],t.type==="3d"){n=t.perspectiveElem.style,r=t.container.style;var s=this.pe.v+"px",a="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";n.perspective=s,n.webkitPerspective=s,r.transformOrigin=a,r.mozTransformOrigin=a,r.webkitTransformOrigin=a,n.transform=o,n.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var i=this._isFirstFrame,e,t;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)i=this.hierarchy[e].finalTransform.mProp._mdf||i;if(i||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(t=this.hierarchy.length-1,e=t;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var r;this.p?r=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:r=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var s=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),a=[r[0]/s,r[1]/s,r[2]/s],o=Math.sqrt(a[2]*a[2]+a[0]*a[0]),l=Math.atan2(a[1],o),h=Math.atan2(a[0],-a[2]);this.mat.rotateY(h).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var u=!this._prevMat.equals(this.mat);if((u||this.pe._mdf)&&this.comp.threeDElements){t=this.comp.threeDElements.length;var p,f,d;for(e=0;e<t;e+=1)if(p=this.comp.threeDElements[e],p.type==="3d"){if(u){var m=this.mat.toCSS();d=p.container.style,d.transform=m,d.webkitTransform=m}this.pe._mdf&&(f=p.perspectiveElem.style,f.perspective=this.pe.v+"px",f.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(i){this.prepareProperties(i,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null};function HImageElement(i,e,t){this.assetData=e.getAssetData(i.refId),this.initElement(i,e,t)}extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var i=this.globalData.getAssetsPath(this.assetData),e=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(e),e.crossOrigin="anonymous",e.src=i,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)};function HybridRendererBase(i,e){this.animationItem=i,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&e.hideOnTransparent===!1),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var i=this.pendingElements.pop();i.checkParenting()}},HybridRendererBase.prototype.appendElementInPos=function(i,e){var t=i.getBaseElement();if(t){var n=this.layers[e];if(!n.ddd||!this.supports3d)if(this.threeDElements)this.addTo3dContainer(t,e);else{for(var r=0,s,a,o;r<e;)this.elements[r]&&this.elements[r]!==!0&&this.elements[r].getBaseElement&&(a=this.elements[r],o=this.layers[r].ddd?this.getThreeDContainerByPos(r):a.getBaseElement(),s=o||s),r+=1;s?(!n.ddd||!this.supports3d)&&this.layerElement.insertBefore(t,s):(!n.ddd||!this.supports3d)&&this.layerElement.appendChild(t)}else this.addTo3dContainer(t,e)}},HybridRendererBase.prototype.createShape=function(i){return this.supports3d?new HShapeElement(i,this.globalData,this):new SVGShapeElement(i,this.globalData,this)},HybridRendererBase.prototype.createText=function(i){return this.supports3d?new HTextElement(i,this.globalData,this):new SVGTextLottieElement(i,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(i){return this.camera=new HCameraElement(i,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(i){return this.supports3d?new HImageElement(i,this.globalData,this):new IImageElement(i,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(i){return this.supports3d?new HSolidElement(i,this.globalData,this):new ISolidElement(i,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(i){for(var e=0,t=this.threeDElements.length;e<t;){if(this.threeDElements[e].startPos<=i&&this.threeDElements[e].endPos>=i)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(i,e){var t=createTag("div"),n,r;styleDiv(t);var s=createTag("div");if(styleDiv(s),e==="3d"){n=t.style,n.width=this.globalData.compSize.w+"px",n.height=this.globalData.compSize.h+"px";var a="50% 50%";n.webkitTransformOrigin=a,n.mozTransformOrigin=a,n.transformOrigin=a,r=s.style;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.transform=o,r.webkitTransform=o}t.appendChild(s);var l={container:s,perspectiveElem:t,startPos:i,endPos:i,type:e};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var i,e=this.layers.length,t,n="";for(i=0;i<e;i+=1)this.layers[i].ddd&&this.layers[i].ty!==3?(n!=="3d"&&(n="3d",t=this.createThreeDContainer(i,"3d")),t.endPos=Math.max(t.endPos,i)):(n!=="2d"&&(n="2d",t=this.createThreeDContainer(i,"2d")),t.endPos=Math.max(t.endPos,i));for(e=this.threeDElements.length,i=e-1;i>=0;i-=1)this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(i,e){for(var t=0,n=this.threeDElements.length;t<n;){if(e<=this.threeDElements[t].endPos){for(var r=this.threeDElements[t].startPos,s;r<e;)this.elements[r]&&this.elements[r].getBaseElement&&(s=this.elements[r].getBaseElement()),r+=1;s?this.threeDElements[t].container.insertBefore(i,s):this.threeDElements[t].container.appendChild(i);break}t+=1}},HybridRendererBase.prototype.configAnimation=function(i){var e=createTag("div"),t=this.animationItem.wrapper,n=e.style;n.width=i.w+"px",n.height=i.h+"px",this.resizerElem=e,styleDiv(e),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&e.setAttribute("class",this.renderConfig.className),t.appendChild(e),n.overflow="hidden";var r=createNS("svg");r.setAttribute("width","1"),r.setAttribute("height","1"),styleDiv(r),this.resizerElem.appendChild(r);var s=createNS("defs");r.appendChild(s),this.data=i,this.setupGlobalData(i,r),this.globalData.defs=s,this.layers=i.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var i,e=this.layers?this.layers.length:0;for(i=0;i<e;i+=1)this.elements[i]&&this.elements[i].destroy&&this.elements[i].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var i=this.animationItem.wrapper.offsetWidth,e=this.animationItem.wrapper.offsetHeight,t=i/e,n=this.globalData.compSize.w/this.globalData.compSize.h,r,s,a,o;n>t?(r=i/this.globalData.compSize.w,s=i/this.globalData.compSize.w,a=0,o=(e-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(r=e/this.globalData.compSize.h,s=e/this.globalData.compSize.h,a=(i-this.globalData.compSize.w*(e/this.globalData.compSize.h))/2,o=0);var l=this.resizerElem.style;l.webkitTransform="matrix3d("+r+",0,0,0,0,"+s+",0,0,0,0,1,0,"+a+","+o+",0,1)",l.transform=l.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var i=this.globalData.compSize.w,e=this.globalData.compSize.h,t,n=this.threeDElements.length;for(t=0;t<n;t+=1){var r=this.threeDElements[t].perspectiveElem.style;r.webkitPerspective=Math.sqrt(Math.pow(i,2)+Math.pow(e,2))+"px",r.perspective=r.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(i){var e,t=i.length,n=createTag("div");for(e=0;e<t;e+=1)if(i[e].xt){var r=this.createComp(i[e],n,this.globalData.comp,null);r.initExpressions(),this.globalData.projectInterface.registerComposition(r)}};function HCompElement(i,e,t){this.layers=i.layers,this.supports3d=!i.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(i,e,t),this.tm=i.tm?PropertyFactory.getProp(this,i.tm,0,e.frameRate,this):{_placeholder:!0}}extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(i,e){for(var t=0,n;t<e;)this.elements[t]&&this.elements[t].getBaseElement&&(n=this.elements[t].getBaseElement()),t+=1;n?this.layerElement.insertBefore(i,n):this.layerElement.appendChild(i)},HCompElement.prototype.createComp=function(i){return this.supports3d?new HCompElement(i,this.globalData,this):new SVGCompElement(i,this.globalData,this)};function HybridRenderer(i,e){this.animationItem=i,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:e&&e.className||"",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(e&&e.hideOnTransparent===!1),filterSize:{width:e&&e.filterSize&&e.filterSize.width||"400%",height:e&&e.filterSize&&e.filterSize.height||"400%",x:e&&e.filterSize&&e.filterSize.x||"-100%",y:e&&e.filterSize&&e.filterSize.y||"-100%"},runExpressions:!e||e.runExpressions===void 0||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(i){return this.supports3d?new HCompElement(i,this.globalData,this):new SVGCompElement(i,this.globalData,this)};var CompExpressionInterface=(function(){return function(i){function e(t){for(var n=0,r=i.layers.length;n<r;){if(i.layers[n].nm===t||i.layers[n].ind===t)return i.elements[n].layerInterface;n+=1}return null}return Object.defineProperty(e,"_name",{value:i.data.nm}),e.layer=e,e.pixelAspect=1,e.height=i.data.h||i.globalData.compSize.h,e.width=i.data.w||i.globalData.compSize.w,e.pixelAspect=1,e.frameDuration=1/i.globalData.frameRate,e.displayStartTime=0,e.numLayers=i.layers.length,e}})();function _typeof$2(i){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(i)}function seedRandom(i,e){var t=this,n=256,r=6,s=52,a="random",o=e.pow(n,r),l=e.pow(2,s),h=l*2,u=n-1,p;function f(v,_,b){var M=[];_=_===!0?{entropy:!0}:_||{};var A=y(g(_.entropy?[v,x(i)]:v===null?c():v,3),M),R=new d(M),w=function(){for(var N=R.g(r),V=o,G=0;N<l;)N=(N+G)*n,V*=n,G=R.g(1);for(;N>=h;)N/=2,V/=2,G>>>=1;return(N+G)/V};return w.int32=function(){return R.g(4)|0},w.quick=function(){return R.g(4)/4294967296},w.double=w,y(x(R.S),i),(_.pass||b||function(P,N,V,G){return G&&(G.S&&m(G,R),P.state=function(){return m(R,{})}),V?(e[a]=P,N):P})(w,A,"global"in _?_.global:this==e,_.state)}e["seed"+a]=f;function d(v){var _,b=v.length,M=this,A=0,R=M.i=M.j=0,w=M.S=[];for(b||(v=[b++]);A<n;)w[A]=A++;for(A=0;A<n;A++)w[A]=w[R=u&R+v[A%b]+(_=w[A])],w[R]=_;M.g=function(P){for(var N,V=0,G=M.i,H=M.j,O=M.S;P--;)N=O[G=u&G+1],V=V*n+O[u&(O[G]=O[H=u&H+N])+(O[H]=N)];return M.i=G,M.j=H,V}}function m(v,_){return _.i=v.i,_.j=v.j,_.S=v.S.slice(),_}function g(v,_){var b=[],M=_typeof$2(v),A;if(_&&M=="object")for(A in v)try{b.push(g(v[A],_-1))}catch{}return b.length?b:M=="string"?v:v+"\0"}function y(v,_){for(var b=v+"",M,A=0;A<b.length;)_[u&A]=u&(M^=_[u&A]*19)+b.charCodeAt(A++);return x(_)}function c(){try{var v=new Uint8Array(n);return(t.crypto||t.msCrypto).getRandomValues(v),x(v)}catch{var _=t.navigator,b=_&&_.plugins;return[+new Date,t,b,t.screen,x(i)]}}function x(v){return String.fromCharCode.apply(0,v)}y(e.random(),i)}function initialize$2(i){seedRandom([],i)}var propTypes={SHAPE:"shape"};function _typeof$1(i){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(i)}var ExpressionManager=(function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};initialize$2(BMMath);function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(i){return i.constructor===Array||i.constructor===Float32Array}function isNumerable(i,e){return i==="number"||e instanceof Number||i==="boolean"||i==="string"}function $bm_neg(i){var e=_typeof$1(i);if(e==="number"||i instanceof Number||e==="boolean")return-i;if($bm_isInstanceOfArray(i)){var t,n=i.length,r=[];for(t=0;t<n;t+=1)r[t]=-i[t];return r}return i.propType?i.v:-i}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(i,e){var t=_typeof$1(i),n=_typeof$1(e);if(isNumerable(t,i)&&isNumerable(n,e)||t==="string"||n==="string")return i+e;if($bm_isInstanceOfArray(i)&&isNumerable(n,e))return i=i.slice(0),i[0]+=e,i;if(isNumerable(t,i)&&$bm_isInstanceOfArray(e))return e=e.slice(0),e[0]=i+e[0],e;if($bm_isInstanceOfArray(i)&&$bm_isInstanceOfArray(e)){for(var r=0,s=i.length,a=e.length,o=[];r<s||r<a;)(typeof i[r]=="number"||i[r]instanceof Number)&&(typeof e[r]=="number"||e[r]instanceof Number)?o[r]=i[r]+e[r]:o[r]=e[r]===void 0?i[r]:i[r]||e[r],r+=1;return o}return 0}var add=sum;function sub(i,e){var t=_typeof$1(i),n=_typeof$1(e);if(isNumerable(t,i)&&isNumerable(n,e))return t==="string"&&(i=parseInt(i,10)),n==="string"&&(e=parseInt(e,10)),i-e;if($bm_isInstanceOfArray(i)&&isNumerable(n,e))return i=i.slice(0),i[0]-=e,i;if(isNumerable(t,i)&&$bm_isInstanceOfArray(e))return e=e.slice(0),e[0]=i-e[0],e;if($bm_isInstanceOfArray(i)&&$bm_isInstanceOfArray(e)){for(var r=0,s=i.length,a=e.length,o=[];r<s||r<a;)(typeof i[r]=="number"||i[r]instanceof Number)&&(typeof e[r]=="number"||e[r]instanceof Number)?o[r]=i[r]-e[r]:o[r]=e[r]===void 0?i[r]:i[r]||e[r],r+=1;return o}return 0}function mul(i,e){var t=_typeof$1(i),n=_typeof$1(e),r;if(isNumerable(t,i)&&isNumerable(n,e))return i*e;var s,a;if($bm_isInstanceOfArray(i)&&isNumerable(n,e)){for(a=i.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i[s]*e;return r}if(isNumerable(t,i)&&$bm_isInstanceOfArray(e)){for(a=e.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i*e[s];return r}return 0}function div(i,e){var t=_typeof$1(i),n=_typeof$1(e),r;if(isNumerable(t,i)&&isNumerable(n,e))return i/e;var s,a;if($bm_isInstanceOfArray(i)&&isNumerable(n,e)){for(a=i.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i[s]/e;return r}if(isNumerable(t,i)&&$bm_isInstanceOfArray(e)){for(a=e.length,r=createTypedArray("float32",a),s=0;s<a;s+=1)r[s]=i/e[s];return r}return 0}function mod(i,e){return typeof i=="string"&&(i=parseInt(i,10)),typeof e=="string"&&(e=parseInt(e,10)),i%e}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(i,e,t){if(e>t){var n=t;t=e,e=n}return Math.min(Math.max(i,e),t)}function radiansToDegrees(i){return i/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(i){return i*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(i,e){if(typeof i=="number"||i instanceof Number)return e=e||0,Math.abs(i-e);e||(e=helperLengthArray);var t,n=Math.min(i.length,e.length),r=0;for(t=0;t<n;t+=1)r+=Math.pow(e[t]-i[t],2);return Math.sqrt(r)}function normalize(i){return div(i,length(i))}function rgbToHsl(i){var e=i[0],t=i[1],n=i[2],r=Math.max(e,t,n),s=Math.min(e,t,n),a,o,l=(r+s)/2;if(r===s)a=0,o=0;else{var h=r-s;switch(o=l>.5?h/(2-r-s):h/(r+s),r){case e:a=(t-n)/h+(t<n?6:0);break;case t:a=(n-e)/h+2;break;case n:a=(e-t)/h+4;break}a/=6}return[a,o,l,i[3]]}function hue2rgb(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function hslToRgb(i){var e=i[0],t=i[1],n=i[2],r,s,a;if(t===0)r=n,a=n,s=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=hue2rgb(l,o,e+1/3),s=hue2rgb(l,o,e),a=hue2rgb(l,o,e-1/3)}return[r,s,a,i[3]]}function linear(i,e,t,n,r){if((n===void 0||r===void 0)&&(n=e,r=t,e=0,t=1),t<e){var s=t;t=e,e=s}if(i<=e)return n;if(i>=t)return r;var a=t===e?0:(i-e)/(t-e);if(!n.length)return n+(r-n)*a;var o,l=n.length,h=createTypedArray("float32",l);for(o=0;o<l;o+=1)h[o]=n[o]+(r[o]-n[o])*a;return h}function random(i,e){if(e===void 0&&(i===void 0?(i=0,e=1):(e=i,i=void 0)),e.length){var t,n=e.length;i||(i=createTypedArray("float32",n));var r=createTypedArray("float32",n),s=BMMath.random();for(t=0;t<n;t+=1)r[t]=i[t]+s*(e[t]-i[t]);return r}i===void 0&&(i=0);var a=BMMath.random();return i+a*(e-i)}function createPath(i,e,t,n){var r,s=i.length,a=shapePool.newElement();a.setPathData(!!n,s);var o=[0,0],l,h;for(r=0;r<s;r+=1)l=e&&e[r]?e[r]:o,h=t&&t[r]?t[r]:o,a.setTripleAt(i[r][0],i[r][1],h[0]+i[r][0],h[1]+i[r][1],l[0]+i[r][0],l[1]+i[r][1],r,!0);return a}function initiateExpression(elem,data,property){function noOp(i){return i}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=val.indexOf("random")!==-1,elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty._name=elem.data.nm,thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||this.data.hd!==!0,wiggle=(function i(e,t){var n,r,s=this.pv.length?this.pv.length:1,a=createTypedArray("float32",s);e=5;var o=Math.floor(time*e);for(n=0,r=0;n<o;){for(r=0;r<s;r+=1)a[r]+=-t+t*2*BMMath.random();n+=1}var l=time*e,h=l-Math.floor(l),u=createTypedArray("float32",s);if(s>1){for(r=0;r<s;r+=1)u[r]=this.pv[r]+a[r]+(-t+t*2*BMMath.random())*h;return u}return this.pv+a[0]+(-t+t*2*BMMath.random())*h}).bind(this);thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty));function loopInDuration(i,e){return loopIn(i,e,!0)}function loopOutDuration(i,e){return loopOut(i,e,!0)}this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);function lookAt(i,e){var t=[e[0]-i[0],e[1]-i[1],e[2]-i[2]],n=Math.atan2(t[0],Math.sqrt(t[1]*t[1]+t[2]*t[2]))/degToRads,r=-Math.atan2(t[1],t[2])/degToRads;return[r,n,0]}function easeOut(i,e,t,n,r){return applyEase(easeOutBez,i,e,t,n,r)}function easeIn(i,e,t,n,r){return applyEase(easeInBez,i,e,t,n,r)}function ease(i,e,t,n,r){return applyEase(easeInOutBez,i,e,t,n,r)}function applyEase(i,e,t,n,r,s){r===void 0?(r=t,s=n):e=(e-t)/(n-t),e>1?e=1:e<0&&(e=0);var a=i(e);if($bm_isInstanceOfArray(r)){var o,l=r.length,h=createTypedArray("float32",l);for(o=0;o<l;o+=1)h[o]=(s[o]-r[o])*a+r[o];return h}return(s-r)*a+r}function nearestKey(i){var e,t=data.k.length,n,r;if(!data.k.length||typeof data.k[0]=="number")n=0,r=0;else if(n=-1,i*=elem.comp.globalData.frameRate,i<data.k[0].t)n=1,r=data.k[0].t;else{for(e=0;e<t-1;e+=1)if(i===data.k[e].t){n=e+1,r=data.k[e].t;break}else if(i>data.k[e].t&&i<data.k[e+1].t){i-data.k[e].t>data.k[e+1].t-i?(n=e+2,r=data.k[e+1].t):(n=e+1,r=data.k[e].t);break}n===-1&&(n=e+1,r=data.k[e].t)}var s={};return s.index=n,s.time=r/elem.comp.globalData.frameRate,s}function key(i){var e,t,n;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+i);i-=1,e={time:data.k[i].t/elem.comp.globalData.frameRate,value:[]};var r=Object.prototype.hasOwnProperty.call(data.k[i],"s")?data.k[i].s:data.k[i-1].e;for(n=r.length,t=0;t<n;t+=1)e[t]=r[t],e.value[t]=r[t];return e}function framesToTime(i,e){return e||(e=elem.comp.globalData.frameRate),i/e}function timeToFrames(i,e){return!i&&i!==0&&(i=time),e||(e=elem.comp.globalData.frameRate),i*e}function seedRandom(i){BMMath.seedrandom(randSeed+i)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(i,e){return typeof value=="string"?e===void 0?value.substring(i):value.substring(i,e):""}function substr(i,e){return typeof value=="string"?e===void 0?value.substr(i):value.substr(i,e):""}function posterizeTime(i){time=i===0?0:Math.floor(time*i)/i,value=valueAtTime(time)}var time,velocity,value,text,textIndex,textTotal,selectorValue,index=elem.data.ind,hasParent=!!(elem.hierarchy&&elem.hierarchy.length),parent,randSeed=Math.floor(Math.random()*1e6),globalData=elem.globalData;function executeExpression(i){return value=i,this.frameExpressionId===elem.globalData.frameId&&this.propType!=="textSelector"?value:(this.propType==="textSelector"&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),elemType===4&&!content&&(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),hasParent=!!(elem.hierarchy&&elem.hierarchy.length),hasParent&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt,scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob})(),Expressions=(function(){var i={};i.initExpressions=e,i.resetFrame=ExpressionManager.resetFrame;function e(t){var n=0,r=[];function s(){n+=1}function a(){n-=1,n===0&&l()}function o(h){r.indexOf(h)===-1&&r.push(h)}function l(){var h,u=r.length;for(h=0;h<u;h+=1)r[h].release();r.length=0}t.renderer.compInterface=CompExpressionInterface(t.renderer),t.renderer.globalData.projectInterface.registerComposition(t.renderer),t.renderer.globalData.pushExpression=s,t.renderer.globalData.popExpression=a,t.renderer.globalData.registerExpressionProperty=o}return i})(),MaskManagerInterface=(function(){function i(t,n){this._mask=t,this._data=n}Object.defineProperty(i.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(i.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),this._mask.op.v*100}});var e=function(n){var r=createSizedArray(n.viewData.length),s,a=n.viewData.length;for(s=0;s<a;s+=1)r[s]=new i(n.viewData[s],n.masksProperties[s]);var o=function(h){for(s=0;s<a;){if(n.masksProperties[s].nm===h)return r[s];s+=1}return null};return o};return e})(),ExpressionPropertyInterface=(function(){var i={pv:0,v:0,mult:1},e={pv:[0,0,0],v:[0,0,0],mult:1};function t(a,o,l){Object.defineProperty(a,"velocity",{get:function(){return o.getVelocityAtTime(o.comp.currentFrame)}}),a.numKeys=o.keyframes?o.keyframes.length:0,a.key=function(h){if(!a.numKeys)return 0;var u="";"s"in o.keyframes[h-1]?u=o.keyframes[h-1].s:"e"in o.keyframes[h-2]?u=o.keyframes[h-2].e:u=o.keyframes[h-2].s;var p=l==="unidimensional"?new Number(u):Object.assign({},u);return p.time=o.keyframes[h-1].t/o.elem.comp.globalData.frameRate,p.value=l==="unidimensional"?u[0]:u,p},a.valueAtTime=o.getValueAtTime,a.speedAtTime=o.getSpeedAtTime,a.velocityAtTime=o.getVelocityAtTime,a.propertyGroup=o.propertyGroup}function n(a){(!a||!("pv"in a))&&(a=i);var o=1/a.mult,l=a.pv*o,h=new Number(l);return h.value=l,t(h,a,"unidimensional"),function(){return a.k&&a.getValue(),l=a.v*o,h.value!==l&&(h=new Number(l),h.value=l,h[0]=l,t(h,a,"unidimensional")),h}}function r(a){(!a||!("pv"in a))&&(a=e);var o=1/a.mult,l=a.data&&a.data.l||a.pv.length,h=createTypedArray("float32",l),u=createTypedArray("float32",l);return h.value=u,t(h,a,"multidimensional"),function(){a.k&&a.getValue();for(var p=0;p<l;p+=1)u[p]=a.v[p]*o,h[p]=u[p];return h}}function s(){return i}return function(a){return a?a.propType==="unidimensional"?n(a):r(a):s}})(),TransformExpressionInterface=(function(){return function(i){function e(a){switch(a){case"scale":case"Scale":case"ADBE Scale":case 6:return e.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return e.rotation;case"ADBE Rotate X":return e.xRotation;case"ADBE Rotate Y":return e.yRotation;case"position":case"Position":case"ADBE Position":case 2:return e.position;case"ADBE Position_0":return e.xPosition;case"ADBE Position_1":return e.yPosition;case"ADBE Position_2":return e.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return e.anchorPoint;case"opacity":case"Opacity":case 11:return e.opacity;default:return null}}Object.defineProperty(e,"rotation",{get:ExpressionPropertyInterface(i.r||i.rz)}),Object.defineProperty(e,"zRotation",{get:ExpressionPropertyInterface(i.rz||i.r)}),Object.defineProperty(e,"xRotation",{get:ExpressionPropertyInterface(i.rx)}),Object.defineProperty(e,"yRotation",{get:ExpressionPropertyInterface(i.ry)}),Object.defineProperty(e,"scale",{get:ExpressionPropertyInterface(i.s)});var t,n,r,s;return i.p?s=ExpressionPropertyInterface(i.p):(t=ExpressionPropertyInterface(i.px),n=ExpressionPropertyInterface(i.py),i.pz&&(r=ExpressionPropertyInterface(i.pz))),Object.defineProperty(e,"position",{get:function(){return i.p?s():[t(),n(),r?r():0]}}),Object.defineProperty(e,"xPosition",{get:ExpressionPropertyInterface(i.px)}),Object.defineProperty(e,"yPosition",{get:ExpressionPropertyInterface(i.py)}),Object.defineProperty(e,"zPosition",{get:ExpressionPropertyInterface(i.pz)}),Object.defineProperty(e,"anchorPoint",{get:ExpressionPropertyInterface(i.a)}),Object.defineProperty(e,"opacity",{get:ExpressionPropertyInterface(i.o)}),Object.defineProperty(e,"skew",{get:ExpressionPropertyInterface(i.sk)}),Object.defineProperty(e,"skewAxis",{get:ExpressionPropertyInterface(i.sa)}),Object.defineProperty(e,"orientation",{get:ExpressionPropertyInterface(i.or)}),e}})(),LayerExpressionInterface=(function(){function i(h){var u=new Matrix;if(h!==void 0){var p=this._elem.finalTransform.mProp.getValueAtTime(h);p.clone(u)}else{var f=this._elem.finalTransform.mProp;f.applyToMatrix(u)}return u}function e(h,u){var p=this.getMatrix(u);return p.props[12]=0,p.props[13]=0,p.props[14]=0,this.applyPoint(p,h)}function t(h,u){var p=this.getMatrix(u);return this.applyPoint(p,h)}function n(h,u){var p=this.getMatrix(u);return p.props[12]=0,p.props[13]=0,p.props[14]=0,this.invertPoint(p,h)}function r(h,u){var p=this.getMatrix(u);return this.invertPoint(p,h)}function s(h,u){if(this._elem.hierarchy&&this._elem.hierarchy.length){var p,f=this._elem.hierarchy.length;for(p=0;p<f;p+=1)this._elem.hierarchy[p].finalTransform.mProp.applyToMatrix(h)}return h.applyToPointArray(u[0],u[1],u[2]||0)}function a(h,u){if(this._elem.hierarchy&&this._elem.hierarchy.length){var p,f=this._elem.hierarchy.length;for(p=0;p<f;p+=1)this._elem.hierarchy[p].finalTransform.mProp.applyToMatrix(h)}return h.inversePoint(u)}function o(h){var u=new Matrix;if(u.reset(),this._elem.finalTransform.mProp.applyToMatrix(u),this._elem.hierarchy&&this._elem.hierarchy.length){var p,f=this._elem.hierarchy.length;for(p=0;p<f;p+=1)this._elem.hierarchy[p].finalTransform.mProp.applyToMatrix(u);return u.inversePoint(h)}return u.inversePoint(h)}function l(){return[1,1,1,1]}return function(h){var u;function p(g){d.mask=new MaskManagerInterface(g,h)}function f(g){d.effect=g}function d(g){switch(g){case"ADBE Root Vectors Group":case"Contents":case 2:return d.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return u;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return d.effect;case"ADBE Text Properties":return d.textInterface;default:return null}}d.getMatrix=i,d.invertPoint=a,d.applyPoint=s,d.toWorld=t,d.toWorldVec=e,d.fromWorld=r,d.fromWorldVec=n,d.toComp=t,d.fromComp=o,d.sampleImage=l,d.sourceRectAtTime=h.sourceRectAtTime.bind(h),d._elem=h,u=TransformExpressionInterface(h.finalTransform.mProp);var m=getDescriptor(u,"anchorPoint");return Object.defineProperties(d,{hasParent:{get:function(){return h.hierarchy.length}},parent:{get:function(){return h.hierarchy[0].layerInterface}},rotation:getDescriptor(u,"rotation"),scale:getDescriptor(u,"scale"),position:getDescriptor(u,"position"),opacity:getDescriptor(u,"opacity"),anchorPoint:m,anchor_point:m,transform:{get:function(){return u}},active:{get:function(){return h.isInRange}}}),d.startTime=h.data.st,d.index=h.data.ind,d.source=h.data.refId,d.height=h.data.ty===0?h.data.h:100,d.width=h.data.ty===0?h.data.w:100,d.inPoint=h.data.ip/h.comp.globalData.frameRate,d.outPoint=h.data.op/h.comp.globalData.frameRate,d._name=h.data.nm,d.registerMaskInterface=p,d.registerEffectsInterface=f,d}})(),propertyGroupFactory=(function(){return function(i,e){return function(t){return t=t===void 0?1:t,t<=0?i:e(t-1)}}})(),PropertyInterface=(function(){return function(i,e){var t={_name:i};function n(r){return r=r===void 0?1:r,r<=0?t:e(r-1)}return n}})(),EffectsExpressionInterface=(function(){var i={createEffectsInterface:e};function e(r,s){if(r.effectsManager){var a=[],o=r.data.ef,l,h=r.effectsManager.effectElements.length;for(l=0;l<h;l+=1)a.push(t(o[l],r.effectsManager.effectElements[l],s,r));var u=r.data.ef||[],p=function(d){for(l=0,h=u.length;l<h;){if(d===u[l].nm||d===u[l].mn||d===u[l].ix)return a[l];l+=1}return null};return Object.defineProperty(p,"numProperties",{get:function(){return u.length}}),p}return null}function t(r,s,a,o){function l(d){for(var m=r.ef,g=0,y=m.length;g<y;){if(d===m[g].nm||d===m[g].mn||d===m[g].ix)return m[g].ty===5?u[g]:u[g]();g+=1}throw new Error}var h=propertyGroupFactory(l,a),u=[],p,f=r.ef.length;for(p=0;p<f;p+=1)r.ef[p].ty===5?u.push(t(r.ef[p],s.effectElements[p],s.effectElements[p].propertyGroup,o)):u.push(n(s.effectElements[p],r.ef[p].ty,o,h));return r.mn==="ADBE Color Control"&&Object.defineProperty(l,"color",{get:function(){return u[0]()}}),Object.defineProperties(l,{numProperties:{get:function(){return r.np}},_name:{value:r.nm},propertyGroup:{value:h}}),l.enabled=r.en!==0,l.active=l.enabled,l}function n(r,s,a,o){var l=ExpressionPropertyInterface(r.p);function h(){return s===10?a.comp.compInterface(r.p.v):l()}return r.p.setGroupProperty&&r.p.setGroupProperty(PropertyInterface("",o)),h}return i})(),ShapePathInterface=(function(){return function(e,t,n){var r=t.sh;function s(o){return o==="Shape"||o==="shape"||o==="Path"||o==="path"||o==="ADBE Vector Shape"||o===2?s.path:null}var a=propertyGroupFactory(s,n);return r.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(s,{path:{get:function(){return r.k&&r.getValue(),r}},shape:{get:function(){return r.k&&r.getValue(),r}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:n}}),s}})(),ShapeExpressionInterface=(function(){function i(m,g,y){var c=[],x,v=m?m.length:0;for(x=0;x<v;x+=1)m[x].ty==="gr"?c.push(t(m[x],g[x],y)):m[x].ty==="fl"?c.push(n(m[x],g[x],y)):m[x].ty==="st"?c.push(a(m[x],g[x],y)):m[x].ty==="tm"?c.push(o(m[x],g[x],y)):m[x].ty==="tr"||(m[x].ty==="el"?c.push(h(m[x],g[x],y)):m[x].ty==="sr"?c.push(u(m[x],g[x],y)):m[x].ty==="sh"?c.push(ShapePathInterface(m[x],g[x],y)):m[x].ty==="rc"?c.push(p(m[x],g[x],y)):m[x].ty==="rd"?c.push(f(m[x],g[x],y)):m[x].ty==="rp"?c.push(d(m[x],g[x],y)):m[x].ty==="gf"?c.push(r(m[x],g[x],y)):c.push(s(m[x],g[x])));return c}function e(m,g,y){var c,x=function(b){for(var M=0,A=c.length;M<A;){if(c[M]._name===b||c[M].mn===b||c[M].propertyIndex===b||c[M].ix===b||c[M].ind===b)return c[M];M+=1}return typeof b=="number"?c[b-1]:null};x.propertyGroup=propertyGroupFactory(x,y),c=i(m.it,g.it,x.propertyGroup),x.numProperties=c.length;var v=l(m.it[m.it.length-1],g.it[g.it.length-1],x.propertyGroup);return x.transform=v,x.propertyIndex=m.cix,x._name=m.nm,x}function t(m,g,y){var c=function(b){switch(b){case"ADBE Vectors Group":case"Contents":case 2:return c.content;default:return c.transform}};c.propertyGroup=propertyGroupFactory(c,y);var x=e(m,g,c.propertyGroup),v=l(m.it[m.it.length-1],g.it[g.it.length-1],c.propertyGroup);return c.content=x,c.transform=v,Object.defineProperty(c,"_name",{get:function(){return m.nm}}),c.numProperties=m.np,c.propertyIndex=m.ix,c.nm=m.nm,c.mn=m.mn,c}function n(m,g,y){function c(x){return x==="Color"||x==="color"?c.color:x==="Opacity"||x==="opacity"?c.opacity:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(g.c)},opacity:{get:ExpressionPropertyInterface(g.o)},_name:{value:m.nm},mn:{value:m.mn}}),g.c.setGroupProperty(PropertyInterface("Color",y)),g.o.setGroupProperty(PropertyInterface("Opacity",y)),c}function r(m,g,y){function c(x){return x==="Start Point"||x==="start point"?c.startPoint:x==="End Point"||x==="end point"?c.endPoint:x==="Opacity"||x==="opacity"?c.opacity:null}return Object.defineProperties(c,{startPoint:{get:ExpressionPropertyInterface(g.s)},endPoint:{get:ExpressionPropertyInterface(g.e)},opacity:{get:ExpressionPropertyInterface(g.o)},type:{get:function(){return"a"}},_name:{value:m.nm},mn:{value:m.mn}}),g.s.setGroupProperty(PropertyInterface("Start Point",y)),g.e.setGroupProperty(PropertyInterface("End Point",y)),g.o.setGroupProperty(PropertyInterface("Opacity",y)),c}function s(){function m(){return null}return m}function a(m,g,y){var c=propertyGroupFactory(A,y),x=propertyGroupFactory(M,c);function v(R){Object.defineProperty(M,m.d[R].nm,{get:ExpressionPropertyInterface(g.d.dataProps[R].p)})}var _,b=m.d?m.d.length:0,M={};for(_=0;_<b;_+=1)v(_),g.d.dataProps[_].p.setGroupProperty(x);function A(R){return R==="Color"||R==="color"?A.color:R==="Opacity"||R==="opacity"?A.opacity:R==="Stroke Width"||R==="stroke width"?A.strokeWidth:null}return Object.defineProperties(A,{color:{get:ExpressionPropertyInterface(g.c)},opacity:{get:ExpressionPropertyInterface(g.o)},strokeWidth:{get:ExpressionPropertyInterface(g.w)},dash:{get:function(){return M}},_name:{value:m.nm},mn:{value:m.mn}}),g.c.setGroupProperty(PropertyInterface("Color",c)),g.o.setGroupProperty(PropertyInterface("Opacity",c)),g.w.setGroupProperty(PropertyInterface("Stroke Width",c)),A}function o(m,g,y){function c(v){return v===m.e.ix||v==="End"||v==="end"?c.end:v===m.s.ix?c.start:v===m.o.ix?c.offset:null}var x=propertyGroupFactory(c,y);return c.propertyIndex=m.ix,g.s.setGroupProperty(PropertyInterface("Start",x)),g.e.setGroupProperty(PropertyInterface("End",x)),g.o.setGroupProperty(PropertyInterface("Offset",x)),c.propertyIndex=m.ix,c.propertyGroup=y,Object.defineProperties(c,{start:{get:ExpressionPropertyInterface(g.s)},end:{get:ExpressionPropertyInterface(g.e)},offset:{get:ExpressionPropertyInterface(g.o)},_name:{value:m.nm}}),c.mn=m.mn,c}function l(m,g,y){function c(v){return m.a.ix===v||v==="Anchor Point"?c.anchorPoint:m.o.ix===v||v==="Opacity"?c.opacity:m.p.ix===v||v==="Position"?c.position:m.r.ix===v||v==="Rotation"||v==="ADBE Vector Rotation"?c.rotation:m.s.ix===v||v==="Scale"?c.scale:m.sk&&m.sk.ix===v||v==="Skew"?c.skew:m.sa&&m.sa.ix===v||v==="Skew Axis"?c.skewAxis:null}var x=propertyGroupFactory(c,y);return g.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",x)),g.transform.mProps.p.setGroupProperty(PropertyInterface("Position",x)),g.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",x)),g.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",x)),g.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",x)),g.transform.mProps.sk&&(g.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",x)),g.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",x))),g.transform.op.setGroupProperty(PropertyInterface("Opacity",x)),Object.defineProperties(c,{opacity:{get:ExpressionPropertyInterface(g.transform.mProps.o)},position:{get:ExpressionPropertyInterface(g.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(g.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(g.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(g.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(g.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(g.transform.mProps.sa)},_name:{value:m.nm}}),c.ty="tr",c.mn=m.mn,c.propertyGroup=y,c}function h(m,g,y){function c(_){return m.p.ix===_?c.position:m.s.ix===_?c.size:null}var x=propertyGroupFactory(c,y);c.propertyIndex=m.ix;var v=g.sh.ty==="tm"?g.sh.prop:g.sh;return v.s.setGroupProperty(PropertyInterface("Size",x)),v.p.setGroupProperty(PropertyInterface("Position",x)),Object.defineProperties(c,{size:{get:ExpressionPropertyInterface(v.s)},position:{get:ExpressionPropertyInterface(v.p)},_name:{value:m.nm}}),c.mn=m.mn,c}function u(m,g,y){function c(_){return m.p.ix===_?c.position:m.r.ix===_?c.rotation:m.pt.ix===_?c.points:m.or.ix===_||_==="ADBE Vector Star Outer Radius"?c.outerRadius:m.os.ix===_?c.outerRoundness:m.ir&&(m.ir.ix===_||_==="ADBE Vector Star Inner Radius")?c.innerRadius:m.is&&m.is.ix===_?c.innerRoundness:null}var x=propertyGroupFactory(c,y),v=g.sh.ty==="tm"?g.sh.prop:g.sh;return c.propertyIndex=m.ix,v.or.setGroupProperty(PropertyInterface("Outer Radius",x)),v.os.setGroupProperty(PropertyInterface("Outer Roundness",x)),v.pt.setGroupProperty(PropertyInterface("Points",x)),v.p.setGroupProperty(PropertyInterface("Position",x)),v.r.setGroupProperty(PropertyInterface("Rotation",x)),m.ir&&(v.ir.setGroupProperty(PropertyInterface("Inner Radius",x)),v.is.setGroupProperty(PropertyInterface("Inner Roundness",x))),Object.defineProperties(c,{position:{get:ExpressionPropertyInterface(v.p)},rotation:{get:ExpressionPropertyInterface(v.r)},points:{get:ExpressionPropertyInterface(v.pt)},outerRadius:{get:ExpressionPropertyInterface(v.or)},outerRoundness:{get:ExpressionPropertyInterface(v.os)},innerRadius:{get:ExpressionPropertyInterface(v.ir)},innerRoundness:{get:ExpressionPropertyInterface(v.is)},_name:{value:m.nm}}),c.mn=m.mn,c}function p(m,g,y){function c(_){return m.p.ix===_?c.position:m.r.ix===_?c.roundness:m.s.ix===_||_==="Size"||_==="ADBE Vector Rect Size"?c.size:null}var x=propertyGroupFactory(c,y),v=g.sh.ty==="tm"?g.sh.prop:g.sh;return c.propertyIndex=m.ix,v.p.setGroupProperty(PropertyInterface("Position",x)),v.s.setGroupProperty(PropertyInterface("Size",x)),v.r.setGroupProperty(PropertyInterface("Rotation",x)),Object.defineProperties(c,{position:{get:ExpressionPropertyInterface(v.p)},roundness:{get:ExpressionPropertyInterface(v.r)},size:{get:ExpressionPropertyInterface(v.s)},_name:{value:m.nm}}),c.mn=m.mn,c}function f(m,g,y){function c(_){return m.r.ix===_||_==="Round Corners 1"?c.radius:null}var x=propertyGroupFactory(c,y),v=g;return c.propertyIndex=m.ix,v.rd.setGroupProperty(PropertyInterface("Radius",x)),Object.defineProperties(c,{radius:{get:ExpressionPropertyInterface(v.rd)},_name:{value:m.nm}}),c.mn=m.mn,c}function d(m,g,y){function c(_){return m.c.ix===_||_==="Copies"?c.copies:m.o.ix===_||_==="Offset"?c.offset:null}var x=propertyGroupFactory(c,y),v=g;return c.propertyIndex=m.ix,v.c.setGroupProperty(PropertyInterface("Copies",x)),v.o.setGroupProperty(PropertyInterface("Offset",x)),Object.defineProperties(c,{copies:{get:ExpressionPropertyInterface(v.c)},offset:{get:ExpressionPropertyInterface(v.o)},_name:{value:m.nm}}),c.mn=m.mn,c}return function(m,g,y){var c;function x(_){if(typeof _=="number")return _=_===void 0?1:_,_===0?y:c[_-1];for(var b=0,M=c.length;b<M;){if(c[b]._name===_)return c[b];b+=1}return null}function v(){return y}return x.propertyGroup=propertyGroupFactory(x,v),c=i(m,g,x.propertyGroup),x.numProperties=c.length,x._name="Contents",x}})(),TextExpressionInterface=(function(){return function(i){var e;function t(n){return n==="ADBE Text Document"?t.sourceText:null}return Object.defineProperty(t,"sourceText",{get:function(){i.textProperty.getValue();var r=i.textProperty.currentData.t;return(!e||r!==e.value)&&(e=new String(r),e.value=r||new String(r),Object.defineProperty(e,"style",{get:function(){return{fillColor:i.textProperty.currentData.fc}}})),e}}),t}})();function _typeof(i){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(i)}var FootageInterface=(function(){var i=function(n){var r="",s=n.getFootageData();function a(){return r="",s=n.getFootageData(),o}function o(l){if(s[l])return r=l,s=s[l],_typeof(s)==="object"?o:s;var h=l.indexOf(r);if(h!==-1){var u=parseInt(l.substr(h+r.length),10);return s=s[u],_typeof(s)==="object"?o:s}return""}return a},e=function(n){function r(s){return s==="Outline"?r.outlineInterface():null}return r._name="Outline",r.outlineInterface=i(n),r};return function(t){function n(r){return r==="Data"?n.dataInterface:null}return n._name="Data",n.dataInterface=e(t),n}})(),interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(i){return interfaces[i]||null}var expressionHelpers=(function(){function i(a,o,l){o.x&&(l.k=!0,l.x=!0,l.initiateExpression=ExpressionManager.initiateExpression,l.effectsSequence.push(l.initiateExpression(a,o,l).bind(l)))}function e(a){return a*=this.elem.globalData.frameRate,a-=this.offsetTime,a!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<a?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(a,this._cachingAtTime),this._cachingAtTime.lastFrame=a),this._cachingAtTime.value}function t(a){var o=-.01,l=this.getValueAtTime(a),h=this.getValueAtTime(a+o),u=0;if(l.length){var p;for(p=0;p<l.length;p+=1)u+=Math.pow(h[p]-l[p],2);u=Math.sqrt(u)*100}else u=0;return u}function n(a){if(this.vel!==void 0)return this.vel;var o=-.001,l=this.getValueAtTime(a),h=this.getValueAtTime(a+o),u;if(l.length){u=createTypedArray("float32",l.length);var p;for(p=0;p<l.length;p+=1)u[p]=(h[p]-l[p])/o}else u=(h-l)/o;return u}function r(){return this.pv}function s(a){this.propertyGroup=a}return{searchExpressions:i,getSpeedAtTime:t,getVelocityAtTime:n,getValueAtTime:e,getStaticValueAtTime:r,setGroupProperty:s}})();function addPropertyDecorator(){function i(f,d,m){if(!this.k||!this.keyframes)return this.pv;f=f?f.toLowerCase():"";var g=this.comp.renderedFrame,y=this.keyframes,c=y[y.length-1].t;if(g<=c)return this.pv;var x,v;m?(d?x=Math.abs(c-this.elem.comp.globalData.frameRate*d):x=Math.max(0,c-this.elem.data.ip),v=c-x):((!d||d>y.length-1)&&(d=y.length-1),v=y[y.length-1-d].t,x=c-v);var _,b,M;if(f==="pingpong"){var A=Math.floor((g-v)/x);if(A%2!==0)return this.getValueAtTime((x-(g-v)%x+v)/this.comp.globalData.frameRate,0)}else if(f==="offset"){var R=this.getValueAtTime(v/this.comp.globalData.frameRate,0),w=this.getValueAtTime(c/this.comp.globalData.frameRate,0),P=this.getValueAtTime(((g-v)%x+v)/this.comp.globalData.frameRate,0),N=Math.floor((g-v)/x);if(this.pv.length){for(M=new Array(R.length),b=M.length,_=0;_<b;_+=1)M[_]=(w[_]-R[_])*N+P[_];return M}return(w-R)*N+P}else if(f==="continue"){var V=this.getValueAtTime(c/this.comp.globalData.frameRate,0),G=this.getValueAtTime((c-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(M=new Array(V.length),b=M.length,_=0;_<b;_+=1)M[_]=V[_]+(V[_]-G[_])*((g-c)/this.comp.globalData.frameRate)/5e-4;return M}return V+(V-G)*((g-c)/.001)}return this.getValueAtTime(((g-v)%x+v)/this.comp.globalData.frameRate,0)}function e(f,d,m){if(!this.k)return this.pv;f=f?f.toLowerCase():"";var g=this.comp.renderedFrame,y=this.keyframes,c=y[0].t;if(g>=c)return this.pv;var x,v;m?(d?x=Math.abs(this.elem.comp.globalData.frameRate*d):x=Math.max(0,this.elem.data.op-c),v=c+x):((!d||d>y.length-1)&&(d=y.length-1),v=y[d].t,x=v-c);var _,b,M;if(f==="pingpong"){var A=Math.floor((c-g)/x);if(A%2===0)return this.getValueAtTime(((c-g)%x+c)/this.comp.globalData.frameRate,0)}else if(f==="offset"){var R=this.getValueAtTime(c/this.comp.globalData.frameRate,0),w=this.getValueAtTime(v/this.comp.globalData.frameRate,0),P=this.getValueAtTime((x-(c-g)%x+c)/this.comp.globalData.frameRate,0),N=Math.floor((c-g)/x)+1;if(this.pv.length){for(M=new Array(R.length),b=M.length,_=0;_<b;_+=1)M[_]=P[_]-(w[_]-R[_])*N;return M}return P-(w-R)*N}else if(f==="continue"){var V=this.getValueAtTime(c/this.comp.globalData.frameRate,0),G=this.getValueAtTime((c+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(M=new Array(V.length),b=M.length,_=0;_<b;_+=1)M[_]=V[_]+(V[_]-G[_])*(c-g)/.001;return M}return V+(V-G)*(c-g)/.001}return this.getValueAtTime((x-((c-g)%x+c))/this.comp.globalData.frameRate,0)}function t(f,d){if(!this.k)return this.pv;if(f=(f||.4)*.5,d=Math.floor(d||5),d<=1)return this.pv;var m=this.comp.renderedFrame/this.comp.globalData.frameRate,g=m-f,y=m+f,c=d>1?(y-g)/(d-1):1,x=0,v=0,_;this.pv.length?_=createTypedArray("float32",this.pv.length):_=0;for(var b;x<d;){if(b=this.getValueAtTime(g+x*c),this.pv.length)for(v=0;v<this.pv.length;v+=1)_[v]+=b[v];else _+=b;x+=1}if(this.pv.length)for(v=0;v<this.pv.length;v+=1)_[v]/=d;else _/=d;return _}function n(f){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var d=this._transformCachingAtTime.v;if(d.cloneFromProps(this.pre.props),this.appliedTransformations<1){var m=this.a.getValueAtTime(f);d.translate(-m[0]*this.a.mult,-m[1]*this.a.mult,m[2]*this.a.mult)}if(this.appliedTransformations<2){var g=this.s.getValueAtTime(f);d.scale(g[0]*this.s.mult,g[1]*this.s.mult,g[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var y=this.sk.getValueAtTime(f),c=this.sa.getValueAtTime(f);d.skewFromAxis(-y*this.sk.mult,c*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var x=this.r.getValueAtTime(f);d.rotate(-x*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var v=this.rz.getValueAtTime(f),_=this.ry.getValueAtTime(f),b=this.rx.getValueAtTime(f),M=this.or.getValueAtTime(f);d.rotateZ(-v*this.rz.mult).rotateY(_*this.ry.mult).rotateX(b*this.rx.mult).rotateZ(-M[2]*this.or.mult).rotateY(M[1]*this.or.mult).rotateX(M[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var A=this.px.getValueAtTime(f),R=this.py.getValueAtTime(f);if(this.data.p.z){var w=this.pz.getValueAtTime(f);d.translate(A*this.px.mult,R*this.py.mult,-w*this.pz.mult)}else d.translate(A*this.px.mult,R*this.py.mult,0)}else{var P=this.p.getValueAtTime(f);d.translate(P[0]*this.p.mult,P[1]*this.p.mult,-P[2]*this.p.mult)}return d}function r(){return this.v.clone(new Matrix)}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(f,d,m){var g=s(f,d,m);return g.dynamicProperties.length?g.getValueAtTime=n.bind(g):g.getValueAtTime=r.bind(g),g.setGroupProperty=expressionHelpers.setGroupProperty,g};var a=PropertyFactory.getProp;PropertyFactory.getProp=function(f,d,m,g,y){var c=a(f,d,m,g,y);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=i,c.loopIn=e,c.smooth=t,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=d.a===1?d.k.length:0,c.propertyIndex=d.ix;var x=0;return m!==0&&(x=createTypedArray("float32",d.a===1?d.k[0].s.length:d.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:x},expressionHelpers.searchExpressions(f,d,c),c.k&&y.addDynamicProperty(c),c};function o(f){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),f*=this.elem.globalData.frameRate,f-=this.offsetTime,f!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<f?this._caching.lastIndex:0,this._cachingAtTime.lastTime=f,this.interpolateShape(f,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue}var l=ShapePropertyFactory.getConstructorFunction(),h=ShapePropertyFactory.getKeyframedConstructorFunction();function u(){}u.prototype={vertices:function(d,m){this.k&&this.getValue();var g=this.v;m!==void 0&&(g=this.getValueAtTime(m,0));var y,c=g._length,x=g[d],v=g.v,_=createSizedArray(c);for(y=0;y<c;y+=1)d==="i"||d==="o"?_[y]=[x[y][0]-v[y][0],x[y][1]-v[y][1]]:_[y]=[x[y][0],x[y][1]];return _},points:function(d){return this.vertices("v",d)},inTangents:function(d){return this.vertices("i",d)},outTangents:function(d){return this.vertices("o",d)},isClosed:function(){return this.v.c},pointOnPath:function(d,m){var g=this.v;m!==void 0&&(g=this.getValueAtTime(m,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(g));for(var y=this._segmentsLength,c=y.lengths,x=y.totalLength*d,v=0,_=c.length,b=0,M;v<_;){if(b+c[v].addedLength>x){var A=v,R=g.c&&v===_-1?0:v+1,w=(x-b)/c[v].addedLength;M=bez.getPointInSegment(g.v[A],g.v[R],g.o[A],g.i[R],w,c[v]);break}else b+=c[v].addedLength;v+=1}return M||(M=g.c?[g.v[0][0],g.v[0][1]]:[g.v[g._length-1][0],g.v[g._length-1][1]]),M},vectorOnPath:function(d,m,g){d==1?d=this.v.c:d==0&&(d=.999);var y=this.pointOnPath(d,m),c=this.pointOnPath(d+.001,m),x=c[0]-y[0],v=c[1]-y[1],_=Math.sqrt(Math.pow(x,2)+Math.pow(v,2));if(_===0)return[0,0];var b=g==="tangent"?[x/_,v/_]:[-v/_,x/_];return b},tangentOnPath:function(d,m){return this.vectorOnPath(d,m,"tangent")},normalOnPath:function(d,m){return this.vectorOnPath(d,m,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([u],l),extendPrototype([u],h),h.prototype.getValueAtTime=o,h.prototype.initiateExpression=ExpressionManager.initiateExpression;var p=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(f,d,m,g,y){var c=p(f,d,m,g,y);return c.propertyIndex=d.ix,c.lock=!1,m===3?expressionHelpers.searchExpressions(f,d.pt,c):m===4&&expressionHelpers.searchExpressions(f,d.ks,c),c.k&&f.addDynamicProperty(c),c}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function i(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(e,t){var n=this.calculateExpression(t);if(e.t!==n){var r={};return this.copyData(r,e),r.t=n.toString(),r.__complete=!1,r}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=i}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function i(e,t){var n=createNS("feMerge");n.setAttribute("result",e);var r,s;for(s=0;s<t.length;s+=1)r=createNS("feMergeNode"),r.setAttribute("in",t[s]),n.appendChild(r),n.appendChild(r);return n}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(i,e,t,n,r){this.filterManager=e;var s=createNS("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=s,s.setAttribute("result",n+"_tint_1"),i.appendChild(s),s=createNS("feColorMatrix"),s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result",n+"_tint_2"),i.appendChild(s),this.matrixFilter=s;var a=this.createMergeNode(n,[r,n+"_tint_1",n+"_tint_2"]);i.appendChild(a)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,t=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",t[0]-e[0]+" 0 0 0 "+e[0]+" "+(t[1]-e[1])+" 0 0 0 "+e[1]+" "+(t[2]-e[2])+" 0 0 0 "+e[2]+" 0 0 0 1 0")}};function SVGFillFilter(i,e,t,n){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),r.setAttribute("result",n),i.appendChild(r),this.matrixFilter=r}SVGFillFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=this.filterManager.effectElements[2].p.v,t=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+e[0]+" 0 0 0 0 "+e[1]+" 0 0 0 0 "+e[2]+" 0 0 0 "+t+" 0")}};function SVGStrokeEffect(i,e,t){this.initialized=!1,this.filterManager=e,this.elem=t,this.paths=[]}SVGStrokeEffect.prototype.initialize=function(){var i=this.elem.layerElement.children||this.elem.layerElement.childNodes,e,t,n,r;for(this.filterManager.effectElements[1].p.v===1?(r=this.elem.maskManager.masksProperties.length,n=0):(n=this.filterManager.effectElements[0].p.v-1,r=n+1),t=createNS("g"),t.setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1),n;n<r;n+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:n});if(this.filterManager.effectElements[10].p.v===3){var s=createNS("mask"),a=createElementID();s.setAttribute("id",a),s.setAttribute("mask-type","alpha"),s.appendChild(t),this.elem.globalData.defs.appendChild(s);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+a+")");i[0];)o.appendChild(i[0]);this.elem.layerElement.appendChild(o),this.masker=s,t.setAttribute("stroke","#fff")}else if(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2){if(this.filterManager.effectElements[10].p.v===2)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(i){this.initialized||this.initialize();var e,t=this.paths.length,n,r;for(e=0;e<t;e+=1)if(this.paths[e].m!==-1&&(n=this.elem.maskManager.viewData[this.paths[e].m],r=this.paths[e].p,(i||this.filterManager._mdf||n.prop._mdf)&&r.setAttribute("d",n.lastPath),i||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||n.prop._mdf)){var s;if(this.filterManager.effectElements[7].p.v!==0||this.filterManager.effectElements[8].p.v!==100){var a=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)*.01,o=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)*.01,l=r.getTotalLength();s="0 0 0 "+l*a+" ";var h=l*(o-a),u=1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01,p=Math.floor(h/u),f;for(f=0;f<p;f+=1)s+="1 "+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01+" ";s+="0 "+l*10+" 0 0"}else s="1 "+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01;r.setAttribute("stroke-dasharray",s)}if((i||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",this.filterManager.effectElements[4].p.v*2),(i||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2)&&(i||this.filterManager.effectElements[3].p._mdf)){var d=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(d[0]*255)+","+bmFloor(d[1]*255)+","+bmFloor(d[2]*255)+")")}};function SVGTritoneFilter(i,e,t,n){this.filterManager=e;var r=createNS("feColorMatrix");r.setAttribute("type","matrix"),r.setAttribute("color-interpolation-filters","linearRGB"),r.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),i.appendChild(r);var s=createNS("feComponentTransfer");s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),this.matrixFilter=s;var a=createNS("feFuncR");a.setAttribute("type","table"),s.appendChild(a),this.feFuncR=a;var o=createNS("feFuncG");o.setAttribute("type","table"),s.appendChild(o),this.feFuncG=o;var l=createNS("feFuncB");l.setAttribute("type","table"),s.appendChild(l),this.feFuncB=l,i.appendChild(s)}SVGTritoneFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=this.filterManager.effectElements[0].p.v,t=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,r=n[0]+" "+t[0]+" "+e[0],s=n[1]+" "+t[1]+" "+e[1],a=n[2]+" "+t[2]+" "+e[2];this.feFuncR.setAttribute("tableValues",r),this.feFuncG.setAttribute("tableValues",s),this.feFuncB.setAttribute("tableValues",a)}};function SVGProLevelsFilter(i,e,t,n){this.filterManager=e;var r=this.filterManager.effectElements,s=createNS("feComponentTransfer");(r[10].p.k||r[10].p.v!==0||r[11].p.k||r[11].p.v!==1||r[12].p.k||r[12].p.v!==1||r[13].p.k||r[13].p.v!==0||r[14].p.k||r[14].p.v!==1)&&(this.feFuncR=this.createFeFunc("feFuncR",s)),(r[17].p.k||r[17].p.v!==0||r[18].p.k||r[18].p.v!==1||r[19].p.k||r[19].p.v!==1||r[20].p.k||r[20].p.v!==0||r[21].p.k||r[21].p.v!==1)&&(this.feFuncG=this.createFeFunc("feFuncG",s)),(r[24].p.k||r[24].p.v!==0||r[25].p.k||r[25].p.v!==1||r[26].p.k||r[26].p.v!==1||r[27].p.k||r[27].p.v!==0||r[28].p.k||r[28].p.v!==1)&&(this.feFuncB=this.createFeFunc("feFuncB",s)),(r[31].p.k||r[31].p.v!==0||r[32].p.k||r[32].p.v!==1||r[33].p.k||r[33].p.v!==1||r[34].p.k||r[34].p.v!==0||r[35].p.k||r[35].p.v!==1)&&(this.feFuncA=this.createFeFunc("feFuncA",s)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(s.setAttribute("color-interpolation-filters","sRGB"),i.appendChild(s)),(r[3].p.k||r[3].p.v!==0||r[4].p.k||r[4].p.v!==1||r[5].p.k||r[5].p.v!==1||r[6].p.k||r[6].p.v!==0||r[7].p.k||r[7].p.v!==1)&&(s=createNS("feComponentTransfer"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),i.appendChild(s),this.feFuncRComposed=this.createFeFunc("feFuncR",s),this.feFuncGComposed=this.createFeFunc("feFuncG",s),this.feFuncBComposed=this.createFeFunc("feFuncB",s))}SVGProLevelsFilter.prototype.createFeFunc=function(i,e){var t=createNS(i);return t.setAttribute("type","table"),e.appendChild(t),t},SVGProLevelsFilter.prototype.getTableValue=function(i,e,t,n,r){for(var s=0,a=256,o,l=Math.min(i,e),h=Math.max(i,e),u=Array.call(null,{length:a}),p,f=0,d=r-n,m=e-i;s<=256;)o=s/256,o<=l?p=m<0?r:n:o>=h?p=m<0?n:r:p=n+d*Math.pow((o-i)/m,1/t),u[f]=p,f+=1,s+=256/(a-1);return u.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e,t=this.filterManager.effectElements;this.feFuncRComposed&&(i||t[3].p._mdf||t[4].p._mdf||t[5].p._mdf||t[6].p._mdf||t[7].p._mdf)&&(e=this.getTableValue(t[3].p.v,t[4].p.v,t[5].p.v,t[6].p.v,t[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(i||t[10].p._mdf||t[11].p._mdf||t[12].p._mdf||t[13].p._mdf||t[14].p._mdf)&&(e=this.getTableValue(t[10].p.v,t[11].p.v,t[12].p.v,t[13].p.v,t[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(i||t[17].p._mdf||t[18].p._mdf||t[19].p._mdf||t[20].p._mdf||t[21].p._mdf)&&(e=this.getTableValue(t[17].p.v,t[18].p.v,t[19].p.v,t[20].p.v,t[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(i||t[24].p._mdf||t[25].p._mdf||t[26].p._mdf||t[27].p._mdf||t[28].p._mdf)&&(e=this.getTableValue(t[24].p.v,t[25].p.v,t[26].p.v,t[27].p.v,t[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(i||t[31].p._mdf||t[32].p._mdf||t[33].p._mdf||t[34].p._mdf||t[35].p._mdf)&&(e=this.getTableValue(t[31].p.v,t[32].p.v,t[33].p.v,t[34].p.v,t[35].p.v),this.feFuncA.setAttribute("tableValues",e))}};function SVGDropShadowEffect(i,e,t,n,r){var s=e.container.globalData.renderConfig.filterSize,a=e.data.fs||s;i.setAttribute("x",a.x||s.x),i.setAttribute("y",a.y||s.y),i.setAttribute("width",a.width||s.width),i.setAttribute("height",a.height||s.height),this.filterManager=e;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",n+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,i.appendChild(o);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,i.appendChild(l);var h=createNS("feFlood");h.setAttribute("flood-color","#00ff00"),h.setAttribute("flood-opacity","1"),h.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=h,i.appendChild(h);var u=createNS("feComposite");u.setAttribute("in",n+"_drop_shadow_3"),u.setAttribute("in2",n+"_drop_shadow_2"),u.setAttribute("operator","in"),u.setAttribute("result",n+"_drop_shadow_4"),i.appendChild(u);var p=this.createMergeNode(n,[n+"_drop_shadow_4",r]);i.appendChild(p)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){if((i||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),i||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(e[0]*255),Math.round(e[1]*255),Math.round(e[2]*255)))}if((i||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),i||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var t=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=t*Math.cos(n),s=t*Math.sin(n);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",s)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(i,e,t){this.initialized=!1,this.filterManager=e,this.filterElem=i,this.elem=t,t.matteElement=createNS("g"),t.matteElement.appendChild(t.layerElement),t.matteElement.appendChild(t.transformedElement),t.baseElement=t.matteElement}SVGMatte3Effect.prototype.findSymbol=function(i){for(var e=0,t=_svgMatteSymbols.length;e<t;){if(_svgMatteSymbols[e]===i)return _svgMatteSymbols[e];e+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(i,e){var t=i.layerElement.parentNode;if(t){for(var n=t.children,r=0,s=n.length;r<s&&n[r]!==i.layerElement;)r+=1;var a;r<=s-2&&(a=n[r+1]);var o=createNS("use");o.setAttribute("href","#"+e),a?t.insertBefore(o,a):t.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(i,e){if(!this.findSymbol(e)){var t=createElementID(),n=createNS("mask");n.setAttribute("id",e.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(e);var r=i.globalData.defs;r.appendChild(n);var s=createNS("symbol");s.setAttribute("id",t),this.replaceInParent(e,t),s.appendChild(e.layerElement),r.appendChild(s);var a=createNS("use");a.setAttribute("href","#"+t),n.appendChild(a),e.data.hd=!1,e.show()}i.setMatte(e.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var i=this.filterManager.effectElements[0].p.v,e=this.elem.comp.elements,t=0,n=e.length;t<n;)e[t]&&e[t].data.ind===i&&this.setElementAsMask(this.elem,e[t]),t+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()};function SVGGaussianBlurEffect(i,e,t,n){i.setAttribute("x","-100%"),i.setAttribute("y","-100%"),i.setAttribute("width","300%"),i.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");r.setAttribute("result",n),i.appendChild(r),this.feGaussianBlur=r}SVGGaussianBlurEffect.prototype.renderFrame=function(i){if(i||this.filterManager._mdf){var e=.3,t=this.filterManager.effectElements[0].p.v*e,n=this.filterManager.effectElements[1].p.v,r=n==3?0:t,s=n==2?0:t;this.feGaussianBlur.setAttribute("stdDeviation",r+" "+s);var a=this.filterManager.effectElements[2].p.v==1?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}};function TransformEffect(){}TransformEffect.prototype.init=function(i){this.effectsManager=i,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(i){if(this._opMdf=!1,this._mdf=!1,i||this.effectsManager._mdf){var e=this.effectsManager.effectElements,t=e[0].p.v,n=e[1].p.v,r=e[2].p.v===1,s=e[3].p.v,a=r?s:e[4].p.v,o=e[5].p.v,l=e[6].p.v,h=e[7].p.v;this.matrix.reset(),this.matrix.translate(-t[0],-t[1],t[2]),this.matrix.scale(a*.01,s*.01,1),this.matrix.rotate(-h*degToRads),this.matrix.skewFromAxis(-o*degToRads,(l+90)*degToRads),this.matrix.translate(n[0],n[1],0),this._mdf=!0,this.opacity!==e[8].p.v&&(this.opacity=e[8].p.v,this._opMdf=!0)}};function SVGTransformEffect(i,e){this.init(e)}extendPrototype([TransformEffect],SVGTransformEffect);function CVTransformEffect(i){this.init(i)}return extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie}))})(lottie$2,lottie$2.exports)),lottie$2.exports}var lottieExports=requireLottie();const lottie=getDefaultExportFromCjs(lottieExports);class VesselPlayer{constructor(e){this.active="a",this.animation=null,this.activeVideo=null,this.mediaType="lottie",this.crossfadeMs=300,this.idlePayload=null,this.autoIdleHandler=null,this.currentClipUrl="",this.currentVisualTier="",this.isPlaying=!1,this.pendingPlay=null,this.currentPlay=Promise.resolve(),this.stage=e,this.halo=e.querySelector(".vessel-halo"),this.layerA=e.querySelector(".vessel-layer-a"),this.layerB=e.querySelector(".vessel-layer-b"),this.layerA.style.opacity="1",this.layerB.style.opacity="0"}setConfig(e){this.crossfadeMs=e.crossfadeMs,this.mediaType=e.rendererType==="webm"?"webm":"lottie",this.stage.style.setProperty("--crossfade-ms",`${e.crossfadeMs}ms`)}setIdlePayload(e){this.idlePayload=e}setAutoIdleHandler(e){this.autoIdleHandler=e}play(e,t){return this.isPlaying?(this.pendingPlay={payload:e,config:t},this.currentPlay):(this.isPlaying=!0,this.currentPlay=this.playInternal(e,t).finally(()=>{if(this.isPlaying=!1,this.pendingPlay){const n=this.pendingPlay;this.pendingPlay=null,this.play(n.payload,n.config)}}),this.currentPlay)}async playInternal(e,t){const n=e.broadcast.visual_state??e.broadcast.state;n!==this.currentVisualTier&&(this.currentVisualTier=n,this.crossfadeMs=t.crossfadeMs,await this.playClip(e.clipUrl,{loop:e.loop,crossfadeMs:t.crossfadeMs,returnToIdle:e.returnToIdle,onComplete:e.returnToIdle?()=>this.handleAutoIdle():void 0}),this.pulseHalo())}async handleAutoIdle(){if(this.autoIdleHandler){await this.autoIdleHandler();return}await this.playIdleFallback()}async playIdleFallback(){this.idlePayload&&await this.playClip(this.idlePayload.clipUrl,{loop:this.idlePayload.loop,crossfadeMs:this.crossfadeMs,returnToIdle:!1})}async playClip(e,t,n=0){return this.mediaType==="webm"?this.playWebMClip(e,t,n):this.playLottieClip(e,t,n)}async playLottieClip(e,t,n=0){try{const r=await fetch(e);if(!r.ok)throw new Error(`clip fetch failed: ${r.status}`);const s=await r.json(),a=this.active==="a"?this.layerB:this.layerA,o=this.active==="a"?this.layerA:this.layerB;a.replaceChildren();const l=lottie.loadAnimation({container:a,renderer:"canvas",loop:t.loop,autoplay:!0,animationData:s,rendererSettings:{clearCanvas:!0,progressiveLoad:!1}});await this.waitForLottieReady(l,e),t.onComplete&&!t.loop&&this.scheduleOneShotComplete(l,s,t.onComplete),await this.crossfade(o,a,t.crossfadeMs),this.animation?.destroy(),o.replaceChildren(),this.animation=l,this.active=this.active==="a"?"b":"a",this.currentClipUrl=e,await this.ensureLottiePainted(l,t.loop)}catch(r){if(window.eidolaShrine.log(String(r)),n<1){await this.playLottieClip(e,t,n+1);return}this.idlePayload&&e!==this.idlePayload.clipUrl&&await this.playIdleFallback()}}async playWebMClip(e,t,n=0){try{const r=this.active==="a"?this.layerB:this.layerA,s=this.active==="a"?this.layerA:this.layerB;r.replaceChildren();const a=document.createElement("video");a.muted=!0,a.playsInline=!0,a.loop=t.loop,a.preload="auto",a.style.width="100%",a.style.height="100%",a.style.objectFit="contain",r.appendChild(a),await this.waitForWebMReady(a,e),await a.play(),t.onComplete&&!t.loop&&a.addEventListener("ended",()=>{t.onComplete?.()},{once:!0}),await this.crossfade(s,r,t.crossfadeMs),this.animation?.destroy(),this.animation=null,this.activeVideo?.pause(),s.replaceChildren(),this.activeVideo=a,this.active=this.active==="a"?"b":"a",this.currentClipUrl=e}catch(r){if(window.eidolaShrine.log(String(r)),n<1){await this.playWebMClip(e,t,n+1);return}this.idlePayload&&e!==this.idlePayload.clipUrl&&await this.playIdleFallback()}}waitForWebMReady(e,t){return new Promise((n,r)=>{let s=!1;const a=p=>{s||(s=!0,u(),p?n():r(new Error(`webm load failed: ${t}`)))},o=window.setTimeout(()=>a(!1),8e3),l=()=>a(!0),h=()=>a(!1),u=()=>{window.clearTimeout(o),e.removeEventListener("canplay",l),e.removeEventListener("loadeddata",l),e.removeEventListener("error",h)};e.addEventListener("canplay",l),e.addEventListener("loadeddata",l),e.addEventListener("error",h),e.src=t,e.load()})}scheduleOneShotComplete(e,t,n){let r=!1;const s=()=>{r||(r=!0,n())};e.addEventListener("complete",s);const a=t.op??0,o=t.fr??15;a>0&&o>0&&window.setTimeout(s,Math.ceil(a/o*1e3)+250)}waitForLottieReady(e,t){return new Promise((n,r)=>{let s=!1;const a=p=>{s||(s=!0,u(),p?n():r(new Error(`lottie data_failed: ${t}`)))},o=window.setTimeout(()=>a(!1),5e3),l=()=>a(!0),h=()=>a(!1),u=()=>{window.clearTimeout(o),e.removeEventListener("DOMLoaded",l),e.removeEventListener("config_ready",l),e.removeEventListener("data_failed",h)};e.addEventListener("DOMLoaded",l),e.addEventListener("config_ready",l),e.addEventListener("data_failed",h)}).then(()=>{e.resize()})}async ensureLottiePainted(e,t=!1){e.goToAndPlay(0,!0);for(let n=0;n<3;n+=1)e.resize(),await new Promise(r=>requestAnimationFrame(()=>r()));t&&e.play()}crossfade(e,t,n){return t.style.opacity="0",e.style.opacity="1",new Promise(r=>{const s=performance.now(),a=o=>{const l=Math.min(1,(o-s)/n);t.style.opacity=String(l),e.style.opacity=String(1-l),l<1?requestAnimationFrame(a):r()};requestAnimationFrame(a)})}pulseHalo(){this.halo.classList.remove("halo-pulse"),this.halo.offsetWidth,this.halo.classList.add("halo-pulse")}}function isGatedApprovalTool(i){return i?i==="Shell"||i==="CallMcpTool"?!0:i.startsWith("mcp__")||i.startsWith("mcp_"):!1}function isTurnEndState(i,e){return i==="success"?!0:i==="idle"&&e}function shouldArmApprovalIdleTimer(i,e,t){return!i||e==="waiting"?!1:e==="working"&&isGatedApprovalTool(t)}function shouldLoopExpression(i,e){return!0}function buildClipUrl(i,e){return`eidola://vessel/${encodeURIComponent(i)}/${encodeURIComponent(e)}`}class ApprovalIdleController{constructor(e){this.config=null,this.timer=null,this.inTurn=!1,this.engramId="camina-drummer",this.onWaiting=e}setConfig(e){this.config=e}setEngramId(e){this.engramId=e}disarm(){this.clearTimer(),this.inTurn=!1}onState(e){if(e.source==="approval-idle")return;this.clearTimer();const{state:t}=e.broadcast,n=e.broadcast.tool;if(isTurnEndState(t,this.inTurn)){this.inTurn=!1;return}!this.inTurn&&t==="thinking"&&(this.inTurn=!0),!(!this.inTurn||!this.config)&&shouldArmApprovalIdleTimer(this.inTurn,t,n)&&this.armTimer()}armTimer(){const e=this.config;e&&(this.clearTimer(),this.timer=setTimeout(()=>{if(this.timer=null,!this.inTurn)return;const t=buildApprovalIdlePayload(e,this.engramId);this.onWaiting(t)},e.approvalIdleMs))}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}}function buildApprovalIdlePayload(i,e,t=Date.now()){const n="waiting.json";return{broadcast:{protocol_version:"1.0",ts:t,state:"waiting",engram_id:e,expression:n},clipUrl:buildClipUrl(i.pack,n),loop:shouldLoopExpression("waiting",i.idleLoops),returnToIdle:!1,source:"approval-idle"}}const SUCCESS_HOLD_CANCEL_STATES=new Set(["thinking","working","searching","writing","waiting","responding","error","attention"]);class SuccessHoldController{constructor(e){this.config=null,this.timer=null,this.holding=!1,this.onRelease=e}setConfig(e){this.config=e}disarm(){this.holding=!1,this.clearTimer()}filter(e){if(e.source!=="socket")return e;const t=e.broadcast.state;return SUCCESS_HOLD_CANCEL_STATES.has(t)?(this.disarm(),e):t==="success"?(this.holding=!0,this.armTimer(),e):t==="idle"&&this.holding?null:e}armTimer(){this.clearTimer();const e=this.config?.successHoldMs??3e3;this.timer=setTimeout(()=>{this.timer=null,this.holding&&(this.holding=!1,this.onRelease())},e)}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}}const REVISION="176",CullFaceNone=0,CullFaceBack=1,CullFaceFront=2,PCFShadowMap=1,PCFSoftShadowMap=2,VSMShadowMap=3,FrontSide=0,BackSide=1,DoubleSide=2,NoBlending=0,NormalBlending=1,AdditiveBlending=2,SubtractiveBlending=3,MultiplyBlending=4,CustomBlending=5,AddEquation=100,SubtractEquation=101,ReverseSubtractEquation=102,MinEquation=103,MaxEquation=104,ZeroFactor=200,OneFactor=201,SrcColorFactor=202,OneMinusSrcColorFactor=203,SrcAlphaFactor=204,OneMinusSrcAlphaFactor=205,DstAlphaFactor=206,OneMinusDstAlphaFactor=207,DstColorFactor=208,OneMinusDstColorFactor=209,SrcAlphaSaturateFactor=210,ConstantColorFactor=211,OneMinusConstantColorFactor=212,ConstantAlphaFactor=213,OneMinusConstantAlphaFactor=214,NeverDepth=0,AlwaysDepth=1,LessDepth=2,LessEqualDepth=3,EqualDepth=4,GreaterEqualDepth=5,GreaterDepth=6,NotEqualDepth=7,MultiplyOperation=0,MixOperation=1,AddOperation=2,NoToneMapping=0,LinearToneMapping=1,ReinhardToneMapping=2,CineonToneMapping=3,ACESFilmicToneMapping=4,CustomToneMapping=5,AgXToneMapping=6,NeutralToneMapping=7,UVMapping=300,CubeReflectionMapping=301,CubeRefractionMapping=302,EquirectangularReflectionMapping=303,EquirectangularRefractionMapping=304,CubeUVReflectionMapping=306,RepeatWrapping=1e3,ClampToEdgeWrapping=1001,MirroredRepeatWrapping=1002,NearestFilter=1003,NearestMipmapNearestFilter=1004,NearestMipmapLinearFilter=1005,LinearFilter=1006,LinearMipmapNearestFilter=1007,LinearMipmapLinearFilter=1008,UnsignedByteType=1009,ByteType=1010,ShortType=1011,UnsignedShortType=1012,IntType=1013,UnsignedIntType=1014,FloatType=1015,HalfFloatType=1016,UnsignedShort4444Type=1017,UnsignedShort5551Type=1018,UnsignedInt248Type=1020,UnsignedInt5999Type=35902,AlphaFormat=1021,RGBFormat=1022,RGBAFormat=1023,DepthFormat=1026,DepthStencilFormat=1027,RedFormat=1028,RedIntegerFormat=1029,RGFormat=1030,RGIntegerFormat=1031,RGBAIntegerFormat=1033,RGB_S3TC_DXT1_Format=33776,RGBA_S3TC_DXT1_Format=33777,RGBA_S3TC_DXT3_Format=33778,RGBA_S3TC_DXT5_Format=33779,RGB_PVRTC_4BPPV1_Format=35840,RGB_PVRTC_2BPPV1_Format=35841,RGBA_PVRTC_4BPPV1_Format=35842,RGBA_PVRTC_2BPPV1_Format=35843,RGB_ETC1_Format=36196,RGB_ETC2_Format=37492,RGBA_ETC2_EAC_Format=37496,RGBA_ASTC_4x4_Format=37808,RGBA_ASTC_5x4_Format=37809,RGBA_ASTC_5x5_Format=37810,RGBA_ASTC_6x5_Format=37811,RGBA_ASTC_6x6_Format=37812,RGBA_ASTC_8x5_Format=37813,RGBA_ASTC_8x6_Format=37814,RGBA_ASTC_8x8_Format=37815,RGBA_ASTC_10x5_Format=37816,RGBA_ASTC_10x6_Format=37817,RGBA_ASTC_10x8_Format=37818,RGBA_ASTC_10x10_Format=37819,RGBA_ASTC_12x10_Format=37820,RGBA_ASTC_12x12_Format=37821,RGBA_BPTC_Format=36492,RGB_BPTC_SIGNED_Format=36494,RGB_BPTC_UNSIGNED_Format=36495,RED_RGTC1_Format=36283,SIGNED_RED_RGTC1_Format=36284,RED_GREEN_RGTC2_Format=36285,SIGNED_RED_GREEN_RGTC2_Format=36286,BasicDepthPacking=3200,RGBADepthPacking=3201,TangentSpaceNormalMap=0,ObjectSpaceNormalMap=1,NoColorSpace="",SRGBColorSpace="srgb",LinearSRGBColorSpace="srgb-linear",LinearTransfer="linear",SRGBTransfer="srgb",KeepStencilOp=7680,AlwaysStencilFunc=519,NeverCompare=512,LessCompare=513,EqualCompare=514,LessEqualCompare=515,GreaterCompare=516,NotEqualCompare=517,GreaterEqualCompare=518,AlwaysCompare=519,StaticDrawUsage=35044,GLSL3="300 es",WebGLCoordinateSystem=2e3,WebGPUCoordinateSystem=2001;class EventDispatcher{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const _lut=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],DEG2RAD=Math.PI/180,RAD2DEG=180/Math.PI;function generateUUID(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(_lut[i&255]+_lut[i>>8&255]+_lut[i>>16&255]+_lut[i>>24&255]+"-"+_lut[e&255]+_lut[e>>8&255]+"-"+_lut[e>>16&15|64]+_lut[e>>24&255]+"-"+_lut[t&63|128]+_lut[t>>8&255]+"-"+_lut[t>>16&255]+_lut[t>>24&255]+_lut[n&255]+_lut[n>>8&255]+_lut[n>>16&255]+_lut[n>>24&255]).toLowerCase()}function clamp(i,e,t){return Math.max(e,Math.min(t,i))}function euclideanModulo(i,e){return(i%e+e)%e}function lerp(i,e,t){return(1-t)*i+t*e}function denormalize(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function normalize(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}class Vector2{constructor(e=0,t=0){Vector2.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*r+e.x,this.y=s*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(e,t,n,r,s,a,o,l,h){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,h)}set(e,t,n,r,s,a,o,l,h){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],h=n[1],u=n[4],p=n[7],f=n[2],d=n[5],m=n[8],g=r[0],y=r[3],c=r[6],x=r[1],v=r[4],_=r[7],b=r[2],M=r[5],A=r[8];return s[0]=a*g+o*x+l*b,s[3]=a*y+o*v+l*M,s[6]=a*c+o*_+l*A,s[1]=h*g+u*x+p*b,s[4]=h*y+u*v+p*M,s[7]=h*c+u*_+p*A,s[2]=f*g+d*x+m*b,s[5]=f*y+d*v+m*M,s[8]=f*c+d*_+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],h=e[7],u=e[8];return t*a*u-t*o*h-n*s*u+n*o*l+r*s*h-r*a*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],h=e[7],u=e[8],p=u*a-o*h,f=o*l-u*s,d=h*s-a*l,m=t*p+n*f+r*d;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return e[0]=p*g,e[1]=(r*h-u*n)*g,e[2]=(o*n-r*a)*g,e[3]=f*g,e[4]=(u*t-r*l)*g,e[5]=(r*s-o*t)*g,e[6]=d*g,e[7]=(n*l-h*t)*g,e[8]=(a*t-n*s)*g,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,a,o){const l=Math.cos(s),h=Math.sin(s);return this.set(n*l,n*h,-n*(l*a+h*o)+a+e,-r*h,r*l,-r*(-h*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(_m3.makeScale(e,t)),this}rotate(e){return this.premultiply(_m3.makeRotation(-e)),this}translate(e,t){return this.premultiply(_m3.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const _m3=new Matrix3;function arrayNeedsUint32(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}function createElementNS(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function createCanvasElement(){const i=createElementNS("canvas");return i.style.display="block",i}const _cache={};function warnOnce(i){i in _cache||(_cache[i]=!0,console.warn(i))}function probeAsync(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}function toNormalizedProjectionMatrix(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function toReversedProjectionMatrix(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const LINEAR_REC709_TO_XYZ=new Matrix3().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),XYZ_TO_LINEAR_REC709=new Matrix3().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function createColorManagement(){const i={enabled:!0,workingColorSpace:LinearSRGBColorSpace,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===SRGBTransfer&&(r.r=SRGBToLinear(r.r),r.g=SRGBToLinear(r.g),r.b=SRGBToLinear(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===SRGBTransfer&&(r.r=LinearToSRGB(r.r),r.g=LinearToSRGB(r.g),r.b=LinearToSRGB(r.b))),r},fromWorkingColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},toWorkingColorSpace:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===NoColorSpace?LinearTransfer:this.spaces[r].transfer},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[LinearSRGBColorSpace]:{primaries:e,whitePoint:n,transfer:LinearTransfer,toXYZ:LINEAR_REC709_TO_XYZ,fromXYZ:XYZ_TO_LINEAR_REC709,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:SRGBColorSpace},outputColorSpaceConfig:{drawingBufferColorSpace:SRGBColorSpace}},[SRGBColorSpace]:{primaries:e,whitePoint:n,transfer:SRGBTransfer,toXYZ:LINEAR_REC709_TO_XYZ,fromXYZ:XYZ_TO_LINEAR_REC709,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:SRGBColorSpace}}}),i}const ColorManagement=createColorManagement();function SRGBToLinear(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function LinearToSRGB(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let _canvas;class ImageUtils{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{_canvas===void 0&&(_canvas=createElementNS("canvas")),_canvas.width=e.width,_canvas.height=e.height;const r=_canvas.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=_canvas}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=createElementNS("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=SRGBToLinear(s[a]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(SRGBToLinear(t[n]/255)*255):t[n]=SRGBToLinear(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let _sourceId=0;class Source{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:_sourceId++}),this.uuid=generateUUID(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(serializeImage(r[a].image)):s.push(serializeImage(r[a]))}else s=serializeImage(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function serializeImage(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?ImageUtils.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let _textureId=0;class Texture extends EventDispatcher{constructor(e=Texture.DEFAULT_IMAGE,t=Texture.DEFAULT_MAPPING,n=ClampToEdgeWrapping,r=ClampToEdgeWrapping,s=LinearFilter,a=LinearMipmapLinearFilter,o=RGBAFormat,l=UnsignedByteType,h=Texture.DEFAULT_ANISOTROPY,u=NoColorSpace){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:_textureId++}),this.uuid=generateUUID(),this.name="",this.source=new Source(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isTextureArray=e.isTextureArray,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==UVMapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case MirroredRepeatWrapping:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Texture.DEFAULT_IMAGE=null;Texture.DEFAULT_MAPPING=UVMapping;Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(e=0,t=0,n=0,r=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,h=l[0],u=l[4],p=l[8],f=l[1],d=l[5],m=l[9],g=l[2],y=l[6],c=l[10];if(Math.abs(u-f)<.01&&Math.abs(p-g)<.01&&Math.abs(m-y)<.01){if(Math.abs(u+f)<.1&&Math.abs(p+g)<.1&&Math.abs(m+y)<.1&&Math.abs(h+d+c-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(h+1)/2,_=(d+1)/2,b=(c+1)/2,M=(u+f)/4,A=(p+g)/4,R=(m+y)/4;return v>_&&v>b?v<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(v),r=M/n,s=A/n):_>b?_<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(_),n=M/r,s=R/r):b<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),n=A/s,r=R/s),this.set(n,r,s,t),this}let x=Math.sqrt((y-m)*(y-m)+(p-g)*(p-g)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(y-m)/x,this.y=(p-g)/x,this.z=(f-u)/x,this.w=Math.acos((h+d+c-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this.w=clamp(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this.w=clamp(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class RenderTarget extends EventDispatcher{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth?n.depth:1,this.scissor=new Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new Vector4(0,0,e,t);const r={width:e,height:t,depth:this.depth};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:LinearFilter,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},n);const s=new Texture(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new Source(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class WebGLRenderTarget extends RenderTarget{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class DataArrayTexture extends Texture{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Data3DTexture extends Texture{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=NearestFilter,this.minFilter=NearestFilter,this.wrapR=ClampToEdgeWrapping,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Quaternion{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,a,o){let l=n[r+0],h=n[r+1],u=n[r+2],p=n[r+3];const f=s[a+0],d=s[a+1],m=s[a+2],g=s[a+3];if(o===0){e[t+0]=l,e[t+1]=h,e[t+2]=u,e[t+3]=p;return}if(o===1){e[t+0]=f,e[t+1]=d,e[t+2]=m,e[t+3]=g;return}if(p!==g||l!==f||h!==d||u!==m){let y=1-o;const c=l*f+h*d+u*m+p*g,x=c>=0?1:-1,v=1-c*c;if(v>Number.EPSILON){const b=Math.sqrt(v),M=Math.atan2(b,c*x);y=Math.sin(y*M)/b,o=Math.sin(o*M)/b}const _=o*x;if(l=l*y+f*_,h=h*y+d*_,u=u*y+m*_,p=p*y+g*_,y===1-o){const b=1/Math.sqrt(l*l+h*h+u*u+p*p);l*=b,h*=b,u*=b,p*=b}}e[t]=l,e[t+1]=h,e[t+2]=u,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,r,s,a){const o=n[r],l=n[r+1],h=n[r+2],u=n[r+3],p=s[a],f=s[a+1],d=s[a+2],m=s[a+3];return e[t]=o*m+u*p+l*d-h*f,e[t+1]=l*m+u*f+h*p-o*d,e[t+2]=h*m+u*d+o*f-l*p,e[t+3]=u*m-o*p-l*f-h*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,h=o(n/2),u=o(r/2),p=o(s/2),f=l(n/2),d=l(r/2),m=l(s/2);switch(a){case"XYZ":this._x=f*u*p+h*d*m,this._y=h*d*p-f*u*m,this._z=h*u*m+f*d*p,this._w=h*u*p-f*d*m;break;case"YXZ":this._x=f*u*p+h*d*m,this._y=h*d*p-f*u*m,this._z=h*u*m-f*d*p,this._w=h*u*p+f*d*m;break;case"ZXY":this._x=f*u*p-h*d*m,this._y=h*d*p+f*u*m,this._z=h*u*m+f*d*p,this._w=h*u*p-f*d*m;break;case"ZYX":this._x=f*u*p-h*d*m,this._y=h*d*p+f*u*m,this._z=h*u*m-f*d*p,this._w=h*u*p+f*d*m;break;case"YZX":this._x=f*u*p+h*d*m,this._y=h*d*p+f*u*m,this._z=h*u*m-f*d*p,this._w=h*u*p-f*d*m;break;case"XZY":this._x=f*u*p-h*d*m,this._y=h*d*p-f*u*m,this._z=h*u*m+f*d*p,this._w=h*u*p+f*d*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],h=t[2],u=t[6],p=t[10],f=n+o+p;if(f>0){const d=.5/Math.sqrt(f+1);this._w=.25/d,this._x=(u-l)*d,this._y=(s-h)*d,this._z=(a-r)*d}else if(n>o&&n>p){const d=2*Math.sqrt(1+n-o-p);this._w=(u-l)/d,this._x=.25*d,this._y=(r+a)/d,this._z=(s+h)/d}else if(o>p){const d=2*Math.sqrt(1+o-n-p);this._w=(s-h)/d,this._x=(r+a)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+p-n-o);this._w=(a-r)/d,this._x=(s+h)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,h=t._z,u=t._w;return this._x=n*u+a*o+r*h-s*l,this._y=r*u+a*l+s*o-n*h,this._z=s*u+a*h+n*l-r*o,this._w=a*u-n*o-r*l-s*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-t;return this._w=d*a+t*this._w,this._x=d*n+t*this._x,this._y=d*r+t*this._y,this._z=d*s+t*this._z,this.normalize(),this}const h=Math.sqrt(l),u=Math.atan2(h,o),p=Math.sin((1-t)*u)/h,f=Math.sin(t*u)/h;return this._w=a*p+this._w*f,this._x=n*p+this._x*f,this._y=r*p+this._y*f,this._z=s*p+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(e=0,t=0,n=0){Vector3.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(_quaternion$4.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(_quaternion$4.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,h=2*(a*r-o*n),u=2*(o*t-s*r),p=2*(s*n-a*t);return this.x=t+l*h+a*p-o*u,this.y=n+l*u+o*h-s*p,this.z=r+l*p+s*u-a*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-n*l,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return _vector$c.copy(this).projectOnVector(e),this.sub(_vector$c)}reflect(e){return this.sub(_vector$c.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _vector$c=new Vector3,_quaternion$4=new Quaternion;class Box3{constructor(e=new Vector3(1/0,1/0,1/0),t=new Vector3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(_vector$b.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(_vector$b.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=_vector$b.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,_vector$b):_vector$b.fromBufferAttribute(s,a),_vector$b.applyMatrix4(e.matrixWorld),this.expandByPoint(_vector$b);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),_box$4.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_box$4.copy(n.boundingBox)),_box$4.applyMatrix4(e.matrixWorld),this.union(_box$4)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,_vector$b),_vector$b.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(_center),_extents.subVectors(this.max,_center),_v0$2.subVectors(e.a,_center),_v1$7.subVectors(e.b,_center),_v2$4.subVectors(e.c,_center),_f0.subVectors(_v1$7,_v0$2),_f1.subVectors(_v2$4,_v1$7),_f2.subVectors(_v0$2,_v2$4);let t=[0,-_f0.z,_f0.y,0,-_f1.z,_f1.y,0,-_f2.z,_f2.y,_f0.z,0,-_f0.x,_f1.z,0,-_f1.x,_f2.z,0,-_f2.x,-_f0.y,_f0.x,0,-_f1.y,_f1.x,0,-_f2.y,_f2.x,0];return!satForAxes(t,_v0$2,_v1$7,_v2$4,_extents)||(t=[1,0,0,0,1,0,0,0,1],!satForAxes(t,_v0$2,_v1$7,_v2$4,_extents))?!1:(_triangleNormal.crossVectors(_f0,_f1),t=[_triangleNormal.x,_triangleNormal.y,_triangleNormal.z],satForAxes(t,_v0$2,_v1$7,_v2$4,_extents))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_vector$b).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(_vector$b).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(_points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_points),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _points=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],_vector$b=new Vector3,_box$4=new Box3,_v0$2=new Vector3,_v1$7=new Vector3,_v2$4=new Vector3,_f0=new Vector3,_f1=new Vector3,_f2=new Vector3,_center=new Vector3,_extents=new Vector3,_triangleNormal=new Vector3,_testAxis=new Vector3;function satForAxes(i,e,t,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){_testAxis.fromArray(i,s);const o=r.x*Math.abs(_testAxis.x)+r.y*Math.abs(_testAxis.y)+r.z*Math.abs(_testAxis.z),l=e.dot(_testAxis),h=t.dot(_testAxis),u=n.dot(_testAxis);if(Math.max(-Math.max(l,h,u),Math.min(l,h,u))>o)return!1}return!0}const _box$3=new Box3,_v1$6=new Vector3,_v2$3=new Vector3;class Sphere{constructor(e=new Vector3,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):_box$3.setFromPoints(e).getCenter(n);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;_v1$6.subVectors(e,this.center);const t=_v1$6.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(_v1$6,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(_v2$3.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(_v1$6.copy(e.center).add(_v2$3)),this.expandByPoint(_v1$6.copy(e.center).sub(_v2$3))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const _vector$a=new Vector3,_segCenter=new Vector3,_segDir=new Vector3,_diff=new Vector3,_edge1=new Vector3,_edge2=new Vector3,_normal$1=new Vector3;class Ray{constructor(e=new Vector3,t=new Vector3(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,_vector$a)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=_vector$a.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(_vector$a.copy(this.origin).addScaledVector(this.direction,t),_vector$a.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){_segCenter.copy(e).add(t).multiplyScalar(.5),_segDir.copy(t).sub(e).normalize(),_diff.copy(this.origin).sub(_segCenter);const s=e.distanceTo(t)*.5,a=-this.direction.dot(_segDir),o=_diff.dot(this.direction),l=-_diff.dot(_segDir),h=_diff.lengthSq(),u=Math.abs(1-a*a);let p,f,d,m;if(u>0)if(p=a*l-o,f=a*o-l,m=s*u,p>=0)if(f>=-m)if(f<=m){const g=1/u;p*=g,f*=g,d=p*(p+a*f+2*o)+f*(a*p+f+2*l)+h}else f=s,p=Math.max(0,-(a*f+o)),d=-p*p+f*(f+2*l)+h;else f=-s,p=Math.max(0,-(a*f+o)),d=-p*p+f*(f+2*l)+h;else f<=-m?(p=Math.max(0,-(-a*s+o)),f=p>0?-s:Math.min(Math.max(-s,-l),s),d=-p*p+f*(f+2*l)+h):f<=m?(p=0,f=Math.min(Math.max(-s,-l),s),d=f*(f+2*l)+h):(p=Math.max(0,-(a*s+o)),f=p>0?s:Math.min(Math.max(-s,-l),s),d=-p*p+f*(f+2*l)+h);else f=a>0?-s:s,p=Math.max(0,-(a*f+o)),d=-p*p+f*(f+2*l)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(_segCenter).addScaledVector(_segDir,f),d}intersectSphere(e,t){_vector$a.subVectors(e.center,this.origin);const n=_vector$a.dot(this.direction),r=_vector$a.dot(_vector$a)-n*n,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,a,o,l;const h=1/this.direction.x,u=1/this.direction.y,p=1/this.direction.z,f=this.origin;return h>=0?(n=(e.min.x-f.x)*h,r=(e.max.x-f.x)*h):(n=(e.max.x-f.x)*h,r=(e.min.x-f.x)*h),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a<r||isNaN(r))&&(r=a),p>=0?(o=(e.min.z-f.z)*p,l=(e.max.z-f.z)*p):(o=(e.max.z-f.z)*p,l=(e.min.z-f.z)*p),n>l||o>r)||((o>n||n!==n)&&(n=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,_vector$a)!==null}intersectTriangle(e,t,n,r,s){_edge1.subVectors(t,e),_edge2.subVectors(n,e),_normal$1.crossVectors(_edge1,_edge2);let a=this.direction.dot(_normal$1),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_diff.subVectors(this.origin,e);const l=o*this.direction.dot(_edge2.crossVectors(_diff,_edge2));if(l<0)return null;const h=o*this.direction.dot(_edge1.cross(_diff));if(h<0||l+h>a)return null;const u=-o*_diff.dot(_normal$1);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Matrix4{constructor(e,t,n,r,s,a,o,l,h,u,p,f,d,m,g,y){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,h,u,p,f,d,m,g,y)}set(e,t,n,r,s,a,o,l,h,u,p,f,d,m,g,y){const c=this.elements;return c[0]=e,c[4]=t,c[8]=n,c[12]=r,c[1]=s,c[5]=a,c[9]=o,c[13]=l,c[2]=h,c[6]=u,c[10]=p,c[14]=f,c[3]=d,c[7]=m,c[11]=g,c[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Matrix4().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/_v1$5.setFromMatrixColumn(e,0).length(),s=1/_v1$5.setFromMatrixColumn(e,1).length(),a=1/_v1$5.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(r),h=Math.sin(r),u=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const f=a*u,d=a*p,m=o*u,g=o*p;t[0]=l*u,t[4]=-l*p,t[8]=h,t[1]=d+m*h,t[5]=f-g*h,t[9]=-o*l,t[2]=g-f*h,t[6]=m+d*h,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,d=l*p,m=h*u,g=h*p;t[0]=f+g*o,t[4]=m*o-d,t[8]=a*h,t[1]=a*p,t[5]=a*u,t[9]=-o,t[2]=d*o-m,t[6]=g+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,d=l*p,m=h*u,g=h*p;t[0]=f-g*o,t[4]=-a*p,t[8]=m+d*o,t[1]=d+m*o,t[5]=a*u,t[9]=g-f*o,t[2]=-a*h,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,d=a*p,m=o*u,g=o*p;t[0]=l*u,t[4]=m*h-d,t[8]=f*h+g,t[1]=l*p,t[5]=g*h+f,t[9]=d*h-m,t[2]=-h,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,d=a*h,m=o*l,g=o*h;t[0]=l*u,t[4]=g-f*p,t[8]=m*p+d,t[1]=p,t[5]=a*u,t[9]=-o*u,t[2]=-h*u,t[6]=d*p+m,t[10]=f-g*p}else if(e.order==="XZY"){const f=a*l,d=a*h,m=o*l,g=o*h;t[0]=l*u,t[4]=-p,t[8]=h*u,t[1]=f*p+g,t[5]=a*u,t[9]=d*p-m,t[2]=m*p-d,t[6]=o*u,t[10]=g*p+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(_zero,e,_one)}lookAt(e,t,n){const r=this.elements;return _z.subVectors(e,t),_z.lengthSq()===0&&(_z.z=1),_z.normalize(),_x.crossVectors(n,_z),_x.lengthSq()===0&&(Math.abs(n.z)===1?_z.x+=1e-4:_z.z+=1e-4,_z.normalize(),_x.crossVectors(n,_z)),_x.normalize(),_y.crossVectors(_z,_x),r[0]=_x.x,r[4]=_y.x,r[8]=_z.x,r[1]=_x.y,r[5]=_y.y,r[9]=_z.y,r[2]=_x.z,r[6]=_y.z,r[10]=_z.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],h=n[12],u=n[1],p=n[5],f=n[9],d=n[13],m=n[2],g=n[6],y=n[10],c=n[14],x=n[3],v=n[7],_=n[11],b=n[15],M=r[0],A=r[4],R=r[8],w=r[12],P=r[1],N=r[5],V=r[9],G=r[13],H=r[2],O=r[6],C=r[10],L=r[14],E=r[3],T=r[7],k=r[11],B=r[15];return s[0]=a*M+o*P+l*H+h*E,s[4]=a*A+o*N+l*O+h*T,s[8]=a*R+o*V+l*C+h*k,s[12]=a*w+o*G+l*L+h*B,s[1]=u*M+p*P+f*H+d*E,s[5]=u*A+p*N+f*O+d*T,s[9]=u*R+p*V+f*C+d*k,s[13]=u*w+p*G+f*L+d*B,s[2]=m*M+g*P+y*H+c*E,s[6]=m*A+g*N+y*O+c*T,s[10]=m*R+g*V+y*C+c*k,s[14]=m*w+g*G+y*L+c*B,s[3]=x*M+v*P+_*H+b*E,s[7]=x*A+v*N+_*O+b*T,s[11]=x*R+v*V+_*C+b*k,s[15]=x*w+v*G+_*L+b*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],h=e[13],u=e[2],p=e[6],f=e[10],d=e[14],m=e[3],g=e[7],y=e[11],c=e[15];return m*(+s*l*p-r*h*p-s*o*f+n*h*f+r*o*d-n*l*d)+g*(+t*l*d-t*h*f+s*a*f-r*a*d+r*h*u-s*l*u)+y*(+t*h*p-t*o*d-s*a*p+n*a*d+s*o*u-n*h*u)+c*(-r*o*u-t*l*p+t*o*f+r*a*p-n*a*f+n*l*u)}transpose(){const e=this.elements;let t;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(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],h=e[7],u=e[8],p=e[9],f=e[10],d=e[11],m=e[12],g=e[13],y=e[14],c=e[15],x=p*y*h-g*f*h+g*l*d-o*y*d-p*l*c+o*f*c,v=m*f*h-u*y*h-m*l*d+a*y*d+u*l*c-a*f*c,_=u*g*h-m*p*h+m*o*d-a*g*d-u*o*c+a*p*c,b=m*p*l-u*g*l-m*o*f+a*g*f+u*o*y-a*p*y,M=t*x+n*v+r*_+s*b;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/M;return e[0]=x*A,e[1]=(g*f*s-p*y*s-g*r*d+n*y*d+p*r*c-n*f*c)*A,e[2]=(o*y*s-g*l*s+g*r*h-n*y*h-o*r*c+n*l*c)*A,e[3]=(p*l*s-o*f*s-p*r*h+n*f*h+o*r*d-n*l*d)*A,e[4]=v*A,e[5]=(u*y*s-m*f*s+m*r*d-t*y*d-u*r*c+t*f*c)*A,e[6]=(m*l*s-a*y*s-m*r*h+t*y*h+a*r*c-t*l*c)*A,e[7]=(a*f*s-u*l*s+u*r*h-t*f*h-a*r*d+t*l*d)*A,e[8]=_*A,e[9]=(m*p*s-u*g*s-m*n*d+t*g*d+u*n*c-t*p*c)*A,e[10]=(a*g*s-m*o*s+m*n*h-t*g*h-a*n*c+t*o*c)*A,e[11]=(u*o*s-a*p*s-u*n*h+t*p*h+a*n*d-t*o*d)*A,e[12]=b*A,e[13]=(u*g*r-m*p*r+m*n*f-t*g*f-u*n*y+t*p*y)*A,e[14]=(m*o*r-a*g*r-m*n*l+t*g*l+a*n*y-t*o*y)*A,e[15]=(a*p*r-u*o*r+u*n*l-t*p*l-a*n*f+t*o*f)*A,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,h=s*a,u=s*o;return this.set(h*a+n,h*o-r*l,h*l+r*o,0,h*o+r*l,u*o+n,u*l-r*a,0,h*l-r*o,u*l+r*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,a){return this.set(1,n,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,h=s+s,u=a+a,p=o+o,f=s*h,d=s*u,m=s*p,g=a*u,y=a*p,c=o*p,x=l*h,v=l*u,_=l*p,b=n.x,M=n.y,A=n.z;return r[0]=(1-(g+c))*b,r[1]=(d+_)*b,r[2]=(m-v)*b,r[3]=0,r[4]=(d-_)*M,r[5]=(1-(f+c))*M,r[6]=(y+x)*M,r[7]=0,r[8]=(m+v)*A,r[9]=(y-x)*A,r[10]=(1-(f+g))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=_v1$5.set(r[0],r[1],r[2]).length();const a=_v1$5.set(r[4],r[5],r[6]).length(),o=_v1$5.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],_m1$2.copy(this);const h=1/s,u=1/a,p=1/o;return _m1$2.elements[0]*=h,_m1$2.elements[1]*=h,_m1$2.elements[2]*=h,_m1$2.elements[4]*=u,_m1$2.elements[5]*=u,_m1$2.elements[6]*=u,_m1$2.elements[8]*=p,_m1$2.elements[9]*=p,_m1$2.elements[10]*=p,t.setFromRotationMatrix(_m1$2),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,r,s,a,o=WebGLCoordinateSystem){const l=this.elements,h=2*s/(t-e),u=2*s/(n-r),p=(t+e)/(t-e),f=(n+r)/(n-r);let d,m;if(o===WebGLCoordinateSystem)d=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===WebGPUCoordinateSystem)d=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=h,l[4]=0,l[8]=p,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,r,s,a,o=WebGLCoordinateSystem){const l=this.elements,h=1/(t-e),u=1/(n-r),p=1/(a-s),f=(t+e)*h,d=(n+r)*u;let m,g;if(o===WebGLCoordinateSystem)m=(a+s)*p,g=-2*p;else if(o===WebGPUCoordinateSystem)m=s*p,g=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*h,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=g,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const _v1$5=new Vector3,_m1$2=new Matrix4,_zero=new Vector3(0,0,0),_one=new Vector3(1,1,1),_x=new Vector3,_y=new Vector3,_z=new Vector3,_matrix$2=new Matrix4,_quaternion$3=new Quaternion;class Euler{constructor(e=0,t=0,n=0,r=Euler.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],h=r[5],u=r[9],p=r[2],f=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(clamp(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,h),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-p,d),this._z=Math.atan2(-a,h)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-clamp(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,h));break;case"YZX":this._z=Math.asin(clamp(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,h),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-clamp(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,h),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return _matrix$2.makeRotationFromQuaternion(e),this.setFromRotationMatrix(_matrix$2,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return _quaternion$3.setFromEuler(this),this.setFromQuaternion(_quaternion$3,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let _object3DId=0;const _v1$4=new Vector3,_q1=new Quaternion,_m1$1$1=new Matrix4,_target=new Vector3,_position$3=new Vector3,_scale$2=new Vector3,_quaternion$2=new Quaternion,_xAxis=new Vector3(1,0,0),_yAxis=new Vector3(0,1,0),_zAxis=new Vector3(0,0,1),_addedEvent={type:"added"},_removedEvent={type:"removed"},_childaddedEvent={type:"childadded",child:null},_childremovedEvent={type:"childremoved",child:null};class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:_object3DId++}),this.uuid=generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();const e=new Vector3,t=new Euler,n=new Quaternion,r=new Vector3(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return _q1.setFromAxisAngle(e,t),this.quaternion.multiply(_q1),this}rotateOnWorldAxis(e,t){return _q1.setFromAxisAngle(e,t),this.quaternion.premultiply(_q1),this}rotateX(e){return this.rotateOnAxis(_xAxis,e)}rotateY(e){return this.rotateOnAxis(_yAxis,e)}rotateZ(e){return this.rotateOnAxis(_zAxis,e)}translateOnAxis(e,t){return _v1$4.copy(e).applyQuaternion(this.quaternion),this.position.add(_v1$4.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(_xAxis,e)}translateY(e){return this.translateOnAxis(_yAxis,e)}translateZ(e){return this.translateOnAxis(_zAxis,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(_m1$1$1.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_target.copy(e):_target.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),_position$3.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_m1$1$1.lookAt(_position$3,_target,this.up):_m1$1$1.lookAt(_target,_position$3,this.up),this.quaternion.setFromRotationMatrix(_m1$1$1),r&&(_m1$1$1.extractRotation(r.matrixWorld),_q1.setFromRotationMatrix(_m1$1$1),this.quaternion.premultiply(_q1.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(_addedEvent),_childaddedEvent.child=e,this.dispatchEvent(_childaddedEvent),_childaddedEvent.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(_removedEvent),_childremovedEvent.child=e,this.dispatchEvent(_childremovedEvent),_childremovedEvent.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),_m1$1$1.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_m1$1$1.multiply(e.parent.matrixWorld)),e.applyMatrix4(_m1$1$1),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(_addedEvent),_childaddedEvent.child=e,this.dispatchEvent(_childaddedEvent),_childaddedEvent.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_position$3,e,_scale$2),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(_position$3,_quaternion$2,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?{min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}:void 0,boundingSphere:o.boundingSphere?{radius:o.boundingSphere.radius,center:o.boundingSphere.center.toArray()}:void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let h=0,u=l.length;h<u;h++){const p=l[h];s(e.shapes,p)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,h=this.material.length;l<h;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),h=a(e.textures),u=a(e.images),p=a(e.shapes),f=a(e.skeletons),d=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),h.length>0&&(n.textures=h),u.length>0&&(n.images=u),p.length>0&&(n.shapes=p),f.length>0&&(n.skeletons=f),d.length>0&&(n.animations=d),m.length>0&&(n.nodes=m)}return n.object=r,n;function a(o){const l=[];for(const h in o){const u=o[h];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}Object3D.DEFAULT_UP=new Vector3(0,1,0);Object3D.DEFAULT_MATRIX_AUTO_UPDATE=!0;Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const _v0$1=new Vector3,_v1$3=new Vector3,_v2$2=new Vector3,_v3$2=new Vector3,_vab=new Vector3,_vac=new Vector3,_vbc=new Vector3,_vap=new Vector3,_vbp=new Vector3,_vcp=new Vector3,_v40=new Vector4,_v41=new Vector4,_v42=new Vector4;class Triangle{constructor(e=new Vector3,t=new Vector3,n=new Vector3){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),_v0$1.subVectors(e,t),r.cross(_v0$1);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){_v0$1.subVectors(r,t),_v1$3.subVectors(n,t),_v2$2.subVectors(e,t);const a=_v0$1.dot(_v0$1),o=_v0$1.dot(_v1$3),l=_v0$1.dot(_v2$2),h=_v1$3.dot(_v1$3),u=_v1$3.dot(_v2$2),p=a*h-o*o;if(p===0)return s.set(0,0,0),null;const f=1/p,d=(h*l-o*u)*f,m=(a*u-o*l)*f;return s.set(1-d-m,m,d)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,_v3$2)===null?!1:_v3$2.x>=0&&_v3$2.y>=0&&_v3$2.x+_v3$2.y<=1}static getInterpolation(e,t,n,r,s,a,o,l){return this.getBarycoord(e,t,n,r,_v3$2)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,_v3$2.x),l.addScaledVector(a,_v3$2.y),l.addScaledVector(o,_v3$2.z),l)}static getInterpolatedAttribute(e,t,n,r,s,a){return _v40.setScalar(0),_v41.setScalar(0),_v42.setScalar(0),_v40.fromBufferAttribute(e,t),_v41.fromBufferAttribute(e,n),_v42.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(_v40,s.x),a.addScaledVector(_v41,s.y),a.addScaledVector(_v42,s.z),a}static isFrontFacing(e,t,n,r){return _v0$1.subVectors(n,t),_v1$3.subVectors(e,t),_v0$1.cross(_v1$3).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return _v0$1.subVectors(this.c,this.b),_v1$3.subVectors(this.a,this.b),_v0$1.cross(_v1$3).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Triangle.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Triangle.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return Triangle.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return Triangle.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Triangle.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let a,o;_vab.subVectors(r,n),_vac.subVectors(s,n),_vap.subVectors(e,n);const l=_vab.dot(_vap),h=_vac.dot(_vap);if(l<=0&&h<=0)return t.copy(n);_vbp.subVectors(e,r);const u=_vab.dot(_vbp),p=_vac.dot(_vbp);if(u>=0&&p<=u)return t.copy(r);const f=l*p-u*h;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(n).addScaledVector(_vab,a);_vcp.subVectors(e,s);const d=_vab.dot(_vcp),m=_vac.dot(_vcp);if(m>=0&&d<=m)return t.copy(s);const g=d*h-l*m;if(g<=0&&h>=0&&m<=0)return o=h/(h-m),t.copy(n).addScaledVector(_vac,o);const y=u*m-d*p;if(y<=0&&p-u>=0&&d-m>=0)return _vbc.subVectors(s,r),o=(p-u)/(p-u+(d-m)),t.copy(r).addScaledVector(_vbc,o);const c=1/(y+g+f);return a=g*c,o=f*c,t.copy(n).addScaledVector(_vab,a).addScaledVector(_vac,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const _colorKeywords={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},_hslA={h:0,s:0,l:0},_hslB={h:0,s:0,l:0};function hue2rgb(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Color{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=SRGBColorSpace){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ColorManagement.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=ColorManagement.workingColorSpace){return this.r=e,this.g=t,this.b=n,ColorManagement.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=ColorManagement.workingColorSpace){if(e=euclideanModulo(e,1),t=clamp(t,0,1),n=clamp(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=hue2rgb(a,s,e+1/3),this.g=hue2rgb(a,s,e),this.b=hue2rgb(a,s,e-1/3)}return ColorManagement.toWorkingColorSpace(this,r),this}setStyle(e,t=SRGBColorSpace){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=SRGBColorSpace){const n=_colorKeywords[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=SRGBToLinear(e.r),this.g=SRGBToLinear(e.g),this.b=SRGBToLinear(e.b),this}copyLinearToSRGB(e){return this.r=LinearToSRGB(e.r),this.g=LinearToSRGB(e.g),this.b=LinearToSRGB(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=SRGBColorSpace){return ColorManagement.fromWorkingColorSpace(_color.copy(this),e),Math.round(clamp(_color.r*255,0,255))*65536+Math.round(clamp(_color.g*255,0,255))*256+Math.round(clamp(_color.b*255,0,255))}getHexString(e=SRGBColorSpace){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ColorManagement.workingColorSpace){ColorManagement.fromWorkingColorSpace(_color.copy(this),t);const n=_color.r,r=_color.g,s=_color.b,a=Math.max(n,r,s),o=Math.min(n,r,s);let l,h;const u=(o+a)/2;if(o===a)l=0,h=0;else{const p=a-o;switch(h=u<=.5?p/(a+o):p/(2-a-o),a){case n:l=(r-s)/p+(r<s?6:0);break;case r:l=(s-n)/p+2;break;case s:l=(n-r)/p+4;break}l/=6}return e.h=l,e.s=h,e.l=u,e}getRGB(e,t=ColorManagement.workingColorSpace){return ColorManagement.fromWorkingColorSpace(_color.copy(this),t),e.r=_color.r,e.g=_color.g,e.b=_color.b,e}getStyle(e=SRGBColorSpace){ColorManagement.fromWorkingColorSpace(_color.copy(this),e);const t=_color.r,n=_color.g,r=_color.b;return e!==SRGBColorSpace?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(_hslA),this.setHSL(_hslA.h+e,_hslA.s+t,_hslA.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(_hslA),e.getHSL(_hslB);const n=lerp(_hslA.h,_hslB.h,t),r=lerp(_hslA.s,_hslB.s,t),s=lerp(_hslA.l,_hslB.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const _color=new Color;Color.NAMES=_colorKeywords;let _materialId=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:_materialId++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=NormalBlending,this.side=FrontSide,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=SrcAlphaFactor,this.blendDst=OneMinusSrcAlphaFactor,this.blendEquation=AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=AlwaysStencilFunc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=KeepStencilOp,this.stencilZFail=KeepStencilOp,this.stencilZPass=KeepStencilOp,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==NormalBlending&&(n.blending=this.blending),this.side!==FrontSide&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==SrcAlphaFactor&&(n.blendSrc=this.blendSrc),this.blendDst!==OneMinusSrcAlphaFactor&&(n.blendDst=this.blendDst),this.blendEquation!==AddEquation&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==LessEqualDepth&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==AlwaysStencilFunc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==KeepStencilOp&&(n.stencilFail=this.stencilFail),this.stencilZFail!==KeepStencilOp&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==KeepStencilOp&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class MeshBasicMaterial extends Material{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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.envMapRotation=new Euler,this.combine=MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const _vector$9=new Vector3,_vector2$1=new Vector2;let _id$2=0;class BufferAttribute{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:_id$2++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=StaticDrawUsage,this.updateRanges=[],this.gpuType=FloatType,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)_vector2$1.fromBufferAttribute(this,t),_vector2$1.applyMatrix3(e),this.setXY(t,_vector2$1.x,_vector2$1.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.applyMatrix3(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.applyMatrix4(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.applyNormalMatrix(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)_vector$9.fromBufferAttribute(this,t),_vector$9.transformDirection(e),this.setXYZ(t,_vector$9.x,_vector$9.y,_vector$9.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=denormalize(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=normalize(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=denormalize(t,this.array)),t}setX(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=denormalize(t,this.array)),t}setY(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=denormalize(t,this.array)),t}setZ(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=denormalize(t,this.array)),t}setW(e,t){return this.normalized&&(t=normalize(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=normalize(t,this.array),n=normalize(n,this.array),r=normalize(r,this.array),s=normalize(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==StaticDrawUsage&&(e.usage=this.usage),e}}class Uint16BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Uint32BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Float32BufferAttribute extends BufferAttribute{constructor(e,t,n){super(new Float32Array(e),t,n)}}let _id$1=0;const _m1$3=new Matrix4,_obj=new Object3D,_offset=new Vector3,_box$2=new Box3,_boxMorphTargets=new Box3,_vector$8=new Vector3;class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:_id$1++}),this.uuid=generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(arrayNeedsUint32(e)?Uint32BufferAttribute:Uint16BufferAttribute)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Matrix3().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return _m1$3.makeRotationFromQuaternion(e),this.applyMatrix4(_m1$3),this}rotateX(e){return _m1$3.makeRotationX(e),this.applyMatrix4(_m1$3),this}rotateY(e){return _m1$3.makeRotationY(e),this.applyMatrix4(_m1$3),this}rotateZ(e){return _m1$3.makeRotationZ(e),this.applyMatrix4(_m1$3),this}translate(e,t,n){return _m1$3.makeTranslation(e,t,n),this.applyMatrix4(_m1$3),this}scale(e,t,n){return _m1$3.makeScale(e,t,n),this.applyMatrix4(_m1$3),this}lookAt(e){return _obj.lookAt(e),_obj.updateMatrix(),this.applyMatrix4(_obj.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_offset).negate(),this.translate(_offset.x,_offset.y,_offset.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Float32BufferAttribute(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Box3);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Vector3(-1/0,-1/0,-1/0),new Vector3(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];_box$2.setFromBufferAttribute(s),this.morphTargetsRelative?(_vector$8.addVectors(this.boundingBox.min,_box$2.min),this.boundingBox.expandByPoint(_vector$8),_vector$8.addVectors(this.boundingBox.max,_box$2.max),this.boundingBox.expandByPoint(_vector$8)):(this.boundingBox.expandByPoint(_box$2.min),this.boundingBox.expandByPoint(_box$2.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(){this.boundingSphere===null&&(this.boundingSphere=new Sphere);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Vector3,1/0);return}if(e){const n=this.boundingSphere.center;if(_box$2.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];_boxMorphTargets.setFromBufferAttribute(o),this.morphTargetsRelative?(_vector$8.addVectors(_box$2.min,_boxMorphTargets.min),_box$2.expandByPoint(_vector$8),_vector$8.addVectors(_box$2.max,_boxMorphTargets.max),_box$2.expandByPoint(_vector$8)):(_box$2.expandByPoint(_boxMorphTargets.min),_box$2.expandByPoint(_boxMorphTargets.max))}_box$2.getCenter(n);let r=0;for(let s=0,a=e.count;s<a;s++)_vector$8.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(_vector$8));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let h=0,u=o.count;h<u;h++)_vector$8.fromBufferAttribute(o,h),l&&(_offset.fromBufferAttribute(e,h),_vector$8.add(_offset)),r=Math.max(r,n.distanceToSquared(_vector$8))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new BufferAttribute(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let R=0;R<n.count;R++)o[R]=new Vector3,l[R]=new Vector3;const h=new Vector3,u=new Vector3,p=new Vector3,f=new Vector2,d=new Vector2,m=new Vector2,g=new Vector3,y=new Vector3;function c(R,w,P){h.fromBufferAttribute(n,R),u.fromBufferAttribute(n,w),p.fromBufferAttribute(n,P),f.fromBufferAttribute(s,R),d.fromBufferAttribute(s,w),m.fromBufferAttribute(s,P),u.sub(h),p.sub(h),d.sub(f),m.sub(f);const N=1/(d.x*m.y-m.x*d.y);isFinite(N)&&(g.copy(u).multiplyScalar(m.y).addScaledVector(p,-d.y).multiplyScalar(N),y.copy(p).multiplyScalar(d.x).addScaledVector(u,-m.x).multiplyScalar(N),o[R].add(g),o[w].add(g),o[P].add(g),l[R].add(y),l[w].add(y),l[P].add(y))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let R=0,w=x.length;R<w;++R){const P=x[R],N=P.start,V=P.count;for(let G=N,H=N+V;G<H;G+=3)c(e.getX(G+0),e.getX(G+1),e.getX(G+2))}const v=new Vector3,_=new Vector3,b=new Vector3,M=new Vector3;function A(R){b.fromBufferAttribute(r,R),M.copy(b);const w=o[R];v.copy(w),v.sub(b.multiplyScalar(b.dot(w))).normalize(),_.crossVectors(M,w);const N=_.dot(l[R])<0?-1:1;a.setXYZW(R,v.x,v.y,v.z,N)}for(let R=0,w=x.length;R<w;++R){const P=x[R],N=P.start,V=P.count;for(let G=N,H=N+V;G<H;G+=3)A(e.getX(G+0)),A(e.getX(G+1)),A(e.getX(G+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new BufferAttribute(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let f=0,d=n.count;f<d;f++)n.setXYZ(f,0,0,0);const r=new Vector3,s=new Vector3,a=new Vector3,o=new Vector3,l=new Vector3,h=new Vector3,u=new Vector3,p=new Vector3;if(e)for(let f=0,d=e.count;f<d;f+=3){const m=e.getX(f+0),g=e.getX(f+1),y=e.getX(f+2);r.fromBufferAttribute(t,m),s.fromBufferAttribute(t,g),a.fromBufferAttribute(t,y),u.subVectors(a,s),p.subVectors(r,s),u.cross(p),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,g),h.fromBufferAttribute(n,y),o.add(u),l.add(u),h.add(u),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(g,l.x,l.y,l.z),n.setXYZ(y,h.x,h.y,h.z)}else for(let f=0,d=t.count;f<d;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),p.subVectors(r,s),u.cross(p),n.setXYZ(f+0,u.x,u.y,u.z),n.setXYZ(f+1,u.x,u.y,u.z),n.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)_vector$8.fromBufferAttribute(e,t),_vector$8.normalize(),e.setXYZ(t,_vector$8.x,_vector$8.y,_vector$8.z)}toNonIndexed(){function e(o,l){const h=o.array,u=o.itemSize,p=o.normalized,f=new h.constructor(l.length*u);let d=0,m=0;for(let g=0,y=l.length;g<y;g++){o.isInterleavedBufferAttribute?d=l[g]*o.data.stride+o.offset:d=l[g]*u;for(let c=0;c<u;c++)f[m++]=h[d++]}return new BufferAttribute(f,u,p)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new BufferGeometry,n=this.index.array,r=this.attributes;for(const o in r){const l=r[o],h=e(l,n);t.setAttribute(o,h)}const s=this.morphAttributes;for(const o in s){const l=[],h=s[o];for(let u=0,p=h.length;u<p;u++){const f=h[u],d=e(f,n);l.push(d)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const h=a[o];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const h in l)l[h]!==void 0&&(e[h]=l[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const h=n[l];e.data.attributes[l]=h.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const h=this.morphAttributes[l],u=[];for(let p=0,f=h.length;p<f;p++){const d=h[p];u.push(d.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const h in r){const u=r[h];this.setAttribute(h,u.clone(t))}const s=e.morphAttributes;for(const h in s){const u=[],p=s[h];for(let f=0,d=p.length;f<d;f++)u.push(p[f].clone(t));this.morphAttributes[h]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let h=0,u=a.length;h<u;h++){const p=a[h];this.addGroup(p.start,p.count,p.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const _inverseMatrix$3=new Matrix4,_ray$3=new Ray,_sphere$6=new Sphere,_sphereHitAt=new Vector3,_vA$1=new Vector3,_vB$1=new Vector3,_vC$1=new Vector3,_tempA=new Vector3,_morphA=new Vector3,_intersectionPoint=new Vector3,_intersectionPointWorld=new Vector3;class Mesh extends Object3D{constructor(e=new BufferGeometry,t=new MeshBasicMaterial){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){_morphA.set(0,0,0);for(let l=0,h=s.length;l<h;l++){const u=o[l],p=s[l];u!==0&&(_tempA.fromBufferAttribute(p,e),a?_morphA.addScaledVector(_tempA,u):_morphA.addScaledVector(_tempA.sub(t),u))}t.add(_morphA)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),_sphere$6.copy(n.boundingSphere),_sphere$6.applyMatrix4(s),_ray$3.copy(e.ray).recast(e.near),!(_sphere$6.containsPoint(_ray$3.origin)===!1&&(_ray$3.intersectSphere(_sphere$6,_sphereHitAt)===null||_ray$3.origin.distanceToSquared(_sphereHitAt)>(e.far-e.near)**2))&&(_inverseMatrix$3.copy(s).invert(),_ray$3.copy(e.ray).applyMatrix4(_inverseMatrix$3),!(n.boundingBox!==null&&_ray$3.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,_ray$3)))}_computeIntersections(e,t,n){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,h=s.attributes.uv,u=s.attributes.uv1,p=s.attributes.normal,f=s.groups,d=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,g=f.length;m<g;m++){const y=f[m],c=a[y.materialIndex],x=Math.max(y.start,d.start),v=Math.min(o.count,Math.min(y.start+y.count,d.start+d.count));for(let _=x,b=v;_<b;_+=3){const M=o.getX(_),A=o.getX(_+1),R=o.getX(_+2);r=checkGeometryIntersection(this,c,e,n,h,u,p,M,A,R),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const m=Math.max(0,d.start),g=Math.min(o.count,d.start+d.count);for(let y=m,c=g;y<c;y+=3){const x=o.getX(y),v=o.getX(y+1),_=o.getX(y+2);r=checkGeometryIntersection(this,a,e,n,h,u,p,x,v,_),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,g=f.length;m<g;m++){const y=f[m],c=a[y.materialIndex],x=Math.max(y.start,d.start),v=Math.min(l.count,Math.min(y.start+y.count,d.start+d.count));for(let _=x,b=v;_<b;_+=3){const M=_,A=_+1,R=_+2;r=checkGeometryIntersection(this,c,e,n,h,u,p,M,A,R),r&&(r.faceIndex=Math.floor(_/3),r.face.materialIndex=y.materialIndex,t.push(r))}}else{const m=Math.max(0,d.start),g=Math.min(l.count,d.start+d.count);for(let y=m,c=g;y<c;y+=3){const x=y,v=y+1,_=y+2;r=checkGeometryIntersection(this,a,e,n,h,u,p,x,v,_),r&&(r.faceIndex=Math.floor(y/3),t.push(r))}}}}function checkIntersection$1(i,e,t,n,r,s,a,o){let l;if(e.side===BackSide?l=n.intersectTriangle(a,s,r,!0,o):l=n.intersectTriangle(r,s,a,e.side===FrontSide,o),l===null)return null;_intersectionPointWorld.copy(o),_intersectionPointWorld.applyMatrix4(i.matrixWorld);const h=t.ray.origin.distanceTo(_intersectionPointWorld);return h<t.near||h>t.far?null:{distance:h,point:_intersectionPointWorld.clone(),object:i}}function checkGeometryIntersection(i,e,t,n,r,s,a,o,l,h){i.getVertexPosition(o,_vA$1),i.getVertexPosition(l,_vB$1),i.getVertexPosition(h,_vC$1);const u=checkIntersection$1(i,e,t,n,_vA$1,_vB$1,_vC$1,_intersectionPoint);if(u){const p=new Vector3;Triangle.getBarycoord(_intersectionPoint,_vA$1,_vB$1,_vC$1,p),r&&(u.uv=Triangle.getInterpolatedAttribute(r,o,l,h,p,new Vector2)),s&&(u.uv1=Triangle.getInterpolatedAttribute(s,o,l,h,p,new Vector2)),a&&(u.normal=Triangle.getInterpolatedAttribute(a,o,l,h,p,new Vector3),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c:h,normal:new Vector3,materialIndex:0};Triangle.getNormal(_vA$1,_vB$1,_vC$1,f.normal),u.face=f,u.barycoord=p}return u}class BoxGeometry extends BufferGeometry{constructor(e=1,t=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],h=[],u=[],p=[];let f=0,d=0;m("z","y","x",-1,-1,n,t,e,a,s,0),m("z","y","x",1,-1,n,t,-e,a,s,1),m("x","z","y",1,1,e,n,t,r,a,2),m("x","z","y",1,-1,e,n,-t,r,a,3),m("x","y","z",1,-1,e,t,n,r,s,4),m("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Float32BufferAttribute(h,3)),this.setAttribute("normal",new Float32BufferAttribute(u,3)),this.setAttribute("uv",new Float32BufferAttribute(p,2));function m(g,y,c,x,v,_,b,M,A,R,w){const P=_/A,N=b/R,V=_/2,G=b/2,H=M/2,O=A+1,C=R+1;let L=0,E=0;const T=new Vector3;for(let k=0;k<C;k++){const B=k*N-G;for(let ee=0;ee<O;ee++){const oe=ee*P-V;T[g]=oe*x,T[y]=B*v,T[c]=H,h.push(T.x,T.y,T.z),T[g]=0,T[y]=0,T[c]=M>0?1:-1,u.push(T.x,T.y,T.z),p.push(ee/A),p.push(1-k/R),L+=1}}for(let k=0;k<R;k++)for(let B=0;B<A;B++){const ee=f+B+O*k,oe=f+B+O*(k+1),X=f+(B+1)+O*(k+1),Q=f+(B+1)+O*k;l.push(ee,oe,Q),l.push(oe,X,Q),E+=6}o.addGroup(d,E,w),d+=E,f+=L}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function cloneUniforms(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function mergeUniforms(i){const e={};for(let t=0;t<i.length;t++){const n=cloneUniforms(i[t]);for(const r in n)e[r]=n[r]}return e}function cloneUniformsGroups(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function getUnlitUniformColorSpace(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:ColorManagement.workingColorSpace}const UniformsUtils={clone:cloneUniforms,merge:mergeUniforms};var default_vertex=`void main() {
|
|
3
3
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
4
4
|
}`,default_fragment=`void main() {
|
|
5
5
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
6
|
-
}`;class ShaderMaterial extends Material{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=default_vertex,this.fragmentShader=default_fragment,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cloneUniforms(e.uniforms),this.uniformsGroups=cloneUniformsGroups(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?t.uniforms[r]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[r]={type:"m4",value:a.toArray()}:t.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=WebGLCoordinateSystem}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const _v3$1=new Vector3,_minTarget=new Vector2,_maxTarget=new Vector2;class PerspectiveCamera extends Camera{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return RAD2DEG*2*Math.atan(Math.tan(DEG2RAD*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){_v3$1.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(_v3$1.x,_v3$1.y).multiplyScalar(-e/_v3$1.z),_v3$1.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(_v3$1.x,_v3$1.y).multiplyScalar(-e/_v3$1.z)}getViewSize(e,t){return this.getViewBounds(e,_minTarget,_maxTarget),t.subVectors(_maxTarget,_minTarget)}setViewOffset(e,t,n,r,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(DEG2RAD*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,h=a.fullHeight;s+=a.offsetX*r/l,t-=a.offsetY*n/h,r*=a.width/l,n*=a.height/h}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const fov=-90,aspect=1;class CubeCamera extends Object3D{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new PerspectiveCamera(fov,aspect,e,t);r.layers=this.layers,this.add(r);const s=new PerspectiveCamera(fov,aspect,e,t);s.layers=this.layers,this.add(s);const a=new PerspectiveCamera(fov,aspect,e,t);a.layers=this.layers,this.add(a);const o=new PerspectiveCamera(fov,aspect,e,t);o.layers=this.layers,this.add(o);const l=new PerspectiveCamera(fov,aspect,e,t);l.layers=this.layers,this.add(l);const h=new PerspectiveCamera(fov,aspect,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,s,a,o,l]=t;for(const h of t)this.remove(h);if(e===WebGLCoordinateSystem)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===WebGPUCoordinateSystem)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,h,u]=this.children,
|
|
6
|
+
}`;class ShaderMaterial extends Material{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=default_vertex,this.fragmentShader=default_fragment,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=cloneUniforms(e.uniforms),this.uniformsGroups=cloneUniformsGroups(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?t.uniforms[r]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[r]={type:"m4",value:a.toArray()}:t.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=WebGLCoordinateSystem}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const _v3$1=new Vector3,_minTarget=new Vector2,_maxTarget=new Vector2;class PerspectiveCamera extends Camera{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=RAD2DEG*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(DEG2RAD*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return RAD2DEG*2*Math.atan(Math.tan(DEG2RAD*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){_v3$1.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(_v3$1.x,_v3$1.y).multiplyScalar(-e/_v3$1.z),_v3$1.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(_v3$1.x,_v3$1.y).multiplyScalar(-e/_v3$1.z)}getViewSize(e,t){return this.getViewBounds(e,_minTarget,_maxTarget),t.subVectors(_maxTarget,_minTarget)}setViewOffset(e,t,n,r,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(DEG2RAD*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,h=a.fullHeight;s+=a.offsetX*r/l,t-=a.offsetY*n/h,r*=a.width/l,n*=a.height/h}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const fov=-90,aspect=1;class CubeCamera extends Object3D{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new PerspectiveCamera(fov,aspect,e,t);r.layers=this.layers,this.add(r);const s=new PerspectiveCamera(fov,aspect,e,t);s.layers=this.layers,this.add(s);const a=new PerspectiveCamera(fov,aspect,e,t);a.layers=this.layers,this.add(a);const o=new PerspectiveCamera(fov,aspect,e,t);o.layers=this.layers,this.add(o);const l=new PerspectiveCamera(fov,aspect,e,t);l.layers=this.layers,this.add(l);const h=new PerspectiveCamera(fov,aspect,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,s,a,o,l]=t;for(const h of t)this.remove(h);if(e===WebGLCoordinateSystem)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===WebGPUCoordinateSystem)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,h,u]=this.children,p=e.getRenderTarget(),f=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,s),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,l),e.setRenderTarget(n,4,r),e.render(t,h),n.texture.generateMipmaps=g,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(p,f,d),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(e=[],t=CubeReflectionMapping,n,r,s,a,o,l,h,u){super(e,t,n,r,s,a,o,l,h,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new CubeTexture(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:LinearFilter}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
7
7
|
|
|
8
8
|
varying vec3 vWorldDirection;
|
|
9
9
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
39
39
|
|
|
40
40
|
}
|
|
41
|
-
`},r=new BoxGeometry(5,5,5),s=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:BackSide,blending:NoBlending});s.uniforms.tEquirect.value=t;const a=new Mesh(r,s),o=t.minFilter;return t.minFilter===LinearMipmapLinearFilter&&(t.minFilter=LinearFilter),new CubeCamera(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(s)}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _moveEvent={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){a=!0;for(const g of e.hand.values()){const y=t.getJointPose(g,n),c=this._getHandJoint(h,g);y!==null&&(c.matrix.fromArray(y.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,c.jointRadius=y.radius),c.visible=y!==null}const u=h.joints["index-finger-tip"],d=h.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,m=.005;h.inputState.pinching&&f>p+m?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&f<=p-m&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),h!==null&&(h.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Group;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class FogExp2{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color(e),this.density=t}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const _vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=_vector1.subVectors(n,t).cross(_vector2.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(_vector1),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||_normalMatrix.getNormalMatrix(e),r=this.coplanarPoint(_vector1).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const _sphere$3=new Sphere,_vector$6=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,n=new Plane,r=new Plane,s=new Plane,a=new Plane){this.planes=[e,t,n,r,s,a]}set(e,t,n,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=WebGLCoordinateSystem){const n=this.planes,r=e.elements,s=r[0],a=r[1],o=r[2],l=r[3],h=r[4],u=r[5],d=r[6],f=r[7],p=r[8],m=r[9],g=r[10],y=r[11],c=r[12],x=r[13],v=r[14],_=r[15];if(n[0].setComponents(l-s,f-h,y-p,_-c).normalize(),n[1].setComponents(l+s,f+h,y+p,_+c).normalize(),n[2].setComponents(l+a,f+u,y+m,_+x).normalize(),n[3].setComponents(l-a,f-u,y-m,_-x).normalize(),n[4].setComponents(l-o,f-d,y-g,_-v).normalize(),t===WebGLCoordinateSystem)n[5].setComponents(l+o,f+d,y+g,_+v).normalize();else if(t===WebGPUCoordinateSystem)n[5].setComponents(o,d,g,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),_sphere$3.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),_sphere$3.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(_sphere$3)}intersectsSprite(e){return _sphere$3.center.set(0,0,0),_sphere$3.radius=.7071067811865476,_sphere$3.applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere$3)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(_vector$6.x=r.normal.x>0?e.max.x:e.min.x,_vector$6.y=r.normal.y>0?e.max.y:e.min.y,_vector$6.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(_vector$6)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class PointsMaterial extends Material{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Color(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const _inverseMatrix=new Matrix4,_ray=new Ray,_sphere=new Sphere,_position$2=new Vector3;class Points extends Object3D{constructor(e=new BufferGeometry,t=new PointsMaterial){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_sphere.copy(n.boundingSphere),_sphere.applyMatrix4(r),_sphere.radius+=s,e.ray.intersectsSphere(_sphere)===!1)return;_inverseMatrix.copy(r).invert(),_ray.copy(e.ray).applyMatrix4(_inverseMatrix);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,h=n.index,d=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),p=Math.min(h.count,a.start+a.count);for(let m=f,g=p;m<g;m++){const y=h.getX(m);_position$2.fromBufferAttribute(d,y),testPoint(_position$2,y,l,r,e,t,this)}}else{const f=Math.max(0,a.start),p=Math.min(d.count,a.start+a.count);for(let m=f,g=p;m<g;m++)_position$2.fromBufferAttribute(d,m),testPoint(_position$2,m,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function testPoint(i,e,t,n,r,s,a){const o=_ray.distanceSqToPoint(i);if(o<t){const l=new Vector3;_ray.closestPointToPoint(i,l),l.applyMatrix4(n);const h=r.ray.origin.distanceTo(l);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class DepthTexture extends Texture{constructor(e,t,n=UnsignedIntType,r,s,a,o=NearestFilter,l=NearestFilter,h,u=DepthFormat){if(u!==DepthFormat&&u!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,r,s,a,o,l,u,n,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Source(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class PlaneGeometry extends BufferGeometry{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(r),h=o+1,u=l+1,d=e/o,f=t/l,p=[],m=[],g=[],y=[];for(let c=0;c<u;c++){const x=c*f-a;for(let v=0;v<h;v++){const _=v*d-s;m.push(_,-x,0),g.push(0,0,1),y.push(v/o),y.push(1-c/l)}}for(let c=0;c<l;c++)for(let x=0;x<o;x++){const v=x+h*c,_=x+h*(c+1),b=x+1+h*(c+1),M=x+1+h*c;p.push(v,_,M),p.push(_,b,M)}this.setIndex(p),this.setAttribute("position",new Float32BufferAttribute(m,3)),this.setAttribute("normal",new Float32BufferAttribute(g,3)),this.setAttribute("uv",new Float32BufferAttribute(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)}}class MeshDepthMaterial extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class Light extends Object3D{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Color(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const _projScreenMatrix$1=new Matrix4,_lightPositionWorld$1=new Vector3,_lookTarget$1=new Vector3;class LightShadow{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.mapType=UnsignedByteType,this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;_lightPositionWorld$1.setFromMatrixPosition(e.matrixWorld),t.position.copy(_lightPositionWorld$1),_lookTarget$1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_lookTarget$1),t.updateMatrixWorld(),_projScreenMatrix$1.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix$1),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(_projScreenMatrix$1)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const _projScreenMatrix=new Matrix4,_lightPositionWorld=new Vector3,_lookTarget=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),_lightPositionWorld.setFromMatrixPosition(e.matrixWorld),n.position.copy(_lightPositionWorld),_lookTarget.copy(n.position),_lookTarget.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(_lookTarget),n.updateMatrixWorld(),r.makeTranslation(-_lightPositionWorld.x,-_lightPositionWorld.y,-_lightPositionWorld.z),_projScreenMatrix.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix)}}class PointLight extends Light{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new PointLightShadow}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class OrthographicCamera extends Camera{constructor(e=-1,t=1,n=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,a=n+e,o=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,a=s+h*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class AmbientLight extends Light{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ArrayCamera extends PerspectiveCamera{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Clock{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function now(){return performance.now()}function getByteLength(i,e,t,n){const r=getTextureTypeByteLength(n);switch(t){case AlphaFormat:return i*e;case RedFormat:return i*e/r.components*r.byteLength;case RedIntegerFormat:return i*e/r.components*r.byteLength;case RGFormat:return i*e*2/r.components*r.byteLength;case RGIntegerFormat:return i*e*2/r.components*r.byteLength;case RGBFormat:return i*e*3/r.components*r.byteLength;case RGBAFormat:return i*e*4/r.components*r.byteLength;case RGBAIntegerFormat:return i*e*4/r.components*r.byteLength;case RGB_S3TC_DXT1_Format:case RGBA_S3TC_DXT1_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case RGBA_S3TC_DXT3_Format:case RGBA_S3TC_DXT5_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case RGB_PVRTC_2BPPV1_Format:case RGBA_PVRTC_2BPPV1_Format:return Math.max(i,16)*Math.max(e,8)/4;case RGB_PVRTC_4BPPV1_Format:case RGBA_PVRTC_4BPPV1_Format:return Math.max(i,8)*Math.max(e,8)/2;case RGB_ETC1_Format:case RGB_ETC2_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case RGBA_ETC2_EAC_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case RGBA_ASTC_4x4_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case RGBA_ASTC_5x4_Format:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case RGBA_ASTC_5x5_Format:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case RGBA_ASTC_6x5_Format:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case RGBA_ASTC_6x6_Format:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case RGBA_ASTC_8x5_Format:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case RGBA_ASTC_8x6_Format:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case RGBA_ASTC_8x8_Format:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case RGBA_ASTC_10x5_Format:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case RGBA_ASTC_10x6_Format:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case RGBA_ASTC_10x8_Format:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case RGBA_ASTC_10x10_Format:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case RGBA_ASTC_12x10_Format:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case RGBA_ASTC_12x12_Format:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case RGBA_BPTC_Format:case RGB_BPTC_SIGNED_Format:case RGB_BPTC_UNSIGNED_Format:return Math.ceil(i/4)*Math.ceil(e/4)*16;case RED_RGTC1_Format:case SIGNED_RED_RGTC1_Format:return Math.ceil(i/4)*Math.ceil(e/4)*8;case RED_GREEN_RGTC2_Format:case SIGNED_RED_GREEN_RGTC2_Format:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function getTextureTypeByteLength(i){switch(i){case UnsignedByteType:case ByteType:return{byteLength:1,components:1};case UnsignedShortType:case ShortType:case HalfFloatType:return{byteLength:2,components:1};case UnsignedShort4444Type:case UnsignedShort5551Type:return{byteLength:2,components:4};case UnsignedIntType:case IntType:case FloatType:return{byteLength:4,components:1};case UnsignedInt5999Type:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);function WebGLAnimation(){let i=null,e=!1,t=null,n=null;function r(s,a){t(s,a),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function WebGLAttributes(i){const e=new WeakMap;function t(o,l){const h=o.array,u=o.usage,d=h.byteLength,f=i.createBuffer();i.bindBuffer(l,f),i.bufferData(l,h,u),o.onUploadCallback();let p;if(h instanceof Float32Array)p=i.FLOAT;else if(h instanceof Uint16Array)o.isFloat16BufferAttribute?p=i.HALF_FLOAT:p=i.UNSIGNED_SHORT;else if(h instanceof Int16Array)p=i.SHORT;else if(h instanceof Uint32Array)p=i.UNSIGNED_INT;else if(h instanceof Int32Array)p=i.INT;else if(h instanceof Int8Array)p=i.BYTE;else if(h instanceof Uint8Array)p=i.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)p=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:f,type:p,bytesPerElement:h.BYTES_PER_ELEMENT,version:o.version,size:d}}function n(o,l,h){const u=l.array,d=l.updateRanges;if(i.bindBuffer(h,o),d.length===0)i.bufferSubData(h,0,u);else{d.sort((p,m)=>p.start-m.start);let f=0;for(let p=1;p<d.length;p++){const m=d[f],g=d[p];g.start<=m.start+m.count+1?m.count=Math.max(m.count,g.start+g.count-m.start):(++f,d[f]=g)}d.length=f+1;for(let p=0,m=d.length;p<m;p++){const g=d[p];i.bufferSubData(h,g.start*u.BYTES_PER_ELEMENT,u,g.start,g.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(i.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const h=e.get(o);if(h===void 0)e.set(o,t(o,l));else if(h.version<o.version){if(h.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(h.buffer,o,l),h.version=o.version}}return{get:r,remove:s,update:a}}var alphahash_fragment=`#ifdef USE_ALPHAHASH
|
|
41
|
+
`},r=new BoxGeometry(5,5,5),s=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:BackSide,blending:NoBlending});s.uniforms.tEquirect.value=t;const a=new Mesh(r,s),o=t.minFilter;return t.minFilter===LinearMipmapLinearFilter&&(t.minFilter=LinearFilter),new CubeCamera(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(s)}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _moveEvent={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){a=!0;for(const g of e.hand.values()){const y=t.getJointPose(g,n),c=this._getHandJoint(h,g);y!==null&&(c.matrix.fromArray(y.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,c.jointRadius=y.radius),c.visible=y!==null}const u=h.joints["index-finger-tip"],p=h.joints["thumb-tip"],f=u.position.distanceTo(p.position),d=.02,m=.005;h.inputState.pinching&&f>d+m?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&f<=d-m&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(_moveEvent)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),h!==null&&(h.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Group;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class FogExp2{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Color(e),this.density=t}clone(){return new FogExp2(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Scene extends Object3D{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const _vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=_vector1.subVectors(n,t).cross(_vector2.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(_vector1),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||_normalMatrix.getNormalMatrix(e),r=this.coplanarPoint(_vector1).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const _sphere$3=new Sphere,_vector$6=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,n=new Plane,r=new Plane,s=new Plane,a=new Plane){this.planes=[e,t,n,r,s,a]}set(e,t,n,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=WebGLCoordinateSystem){const n=this.planes,r=e.elements,s=r[0],a=r[1],o=r[2],l=r[3],h=r[4],u=r[5],p=r[6],f=r[7],d=r[8],m=r[9],g=r[10],y=r[11],c=r[12],x=r[13],v=r[14],_=r[15];if(n[0].setComponents(l-s,f-h,y-d,_-c).normalize(),n[1].setComponents(l+s,f+h,y+d,_+c).normalize(),n[2].setComponents(l+a,f+u,y+m,_+x).normalize(),n[3].setComponents(l-a,f-u,y-m,_-x).normalize(),n[4].setComponents(l-o,f-p,y-g,_-v).normalize(),t===WebGLCoordinateSystem)n[5].setComponents(l+o,f+p,y+g,_+v).normalize();else if(t===WebGPUCoordinateSystem)n[5].setComponents(o,p,g,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),_sphere$3.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),_sphere$3.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(_sphere$3)}intersectsSprite(e){return _sphere$3.center.set(0,0,0),_sphere$3.radius=.7071067811865476,_sphere$3.applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere$3)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(_vector$6.x=r.normal.x>0?e.max.x:e.min.x,_vector$6.y=r.normal.y>0?e.max.y:e.min.y,_vector$6.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(_vector$6)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class PointsMaterial extends Material{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Color(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const _inverseMatrix=new Matrix4,_ray=new Ray,_sphere=new Sphere,_position$2=new Vector3;class Points extends Object3D{constructor(e=new BufferGeometry,t=new PointsMaterial){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),_sphere.copy(n.boundingSphere),_sphere.applyMatrix4(r),_sphere.radius+=s,e.ray.intersectsSphere(_sphere)===!1)return;_inverseMatrix.copy(r).invert(),_ray.copy(e.ray).applyMatrix4(_inverseMatrix);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,h=n.index,p=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),d=Math.min(h.count,a.start+a.count);for(let m=f,g=d;m<g;m++){const y=h.getX(m);_position$2.fromBufferAttribute(p,y),testPoint(_position$2,y,l,r,e,t,this)}}else{const f=Math.max(0,a.start),d=Math.min(p.count,a.start+a.count);for(let m=f,g=d;m<g;m++)_position$2.fromBufferAttribute(p,m),testPoint(_position$2,m,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function testPoint(i,e,t,n,r,s,a){const o=_ray.distanceSqToPoint(i);if(o<t){const l=new Vector3;_ray.closestPointToPoint(i,l),l.applyMatrix4(n);const h=r.ray.origin.distanceTo(l);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class DepthTexture extends Texture{constructor(e,t,n=UnsignedIntType,r,s,a,o=NearestFilter,l=NearestFilter,h,u=DepthFormat){if(u!==DepthFormat&&u!==DepthStencilFormat)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,r,s,a,o,l,u,n,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Source(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class PlaneGeometry extends BufferGeometry{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(r),h=o+1,u=l+1,p=e/o,f=t/l,d=[],m=[],g=[],y=[];for(let c=0;c<u;c++){const x=c*f-a;for(let v=0;v<h;v++){const _=v*p-s;m.push(_,-x,0),g.push(0,0,1),y.push(v/o),y.push(1-c/l)}}for(let c=0;c<l;c++)for(let x=0;x<o;x++){const v=x+h*c,_=x+h*(c+1),b=x+1+h*(c+1),M=x+1+h*c;d.push(v,_,M),d.push(_,b,M)}this.setIndex(d),this.setAttribute("position",new Float32BufferAttribute(m,3)),this.setAttribute("normal",new Float32BufferAttribute(g,3)),this.setAttribute("uv",new Float32BufferAttribute(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)}}class MeshDepthMaterial extends Material{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=BasicDepthPacking,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class Light extends Object3D{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Color(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}const _projScreenMatrix$1=new Matrix4,_lightPositionWorld$1=new Vector3,_lookTarget$1=new Vector3;class LightShadow{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.mapType=UnsignedByteType,this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;_lightPositionWorld$1.setFromMatrixPosition(e.matrixWorld),t.position.copy(_lightPositionWorld$1),_lookTarget$1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_lookTarget$1),t.updateMatrixWorld(),_projScreenMatrix$1.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix$1),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(_projScreenMatrix$1)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const _projScreenMatrix=new Matrix4,_lightPositionWorld=new Vector3,_lookTarget=new Vector3;class PointLightShadow extends LightShadow{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),_lightPositionWorld.setFromMatrixPosition(e.matrixWorld),n.position.copy(_lightPositionWorld),_lookTarget.copy(n.position),_lookTarget.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(_lookTarget),n.updateMatrixWorld(),r.makeTranslation(-_lightPositionWorld.x,-_lightPositionWorld.y,-_lightPositionWorld.z),_projScreenMatrix.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix)}}class PointLight extends Light{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new PointLightShadow}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class OrthographicCamera extends Camera{constructor(e=-1,t=1,n=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,a=n+e,o=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,a=s+h*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class DirectionalLightShadow extends LightShadow{constructor(){super(new OrthographicCamera(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class DirectionalLight extends Light{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Object3D.DEFAULT_UP),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class AmbientLight extends Light{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ArrayCamera extends PerspectiveCamera{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Clock{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function now(){return performance.now()}function getByteLength(i,e,t,n){const r=getTextureTypeByteLength(n);switch(t){case AlphaFormat:return i*e;case RedFormat:return i*e/r.components*r.byteLength;case RedIntegerFormat:return i*e/r.components*r.byteLength;case RGFormat:return i*e*2/r.components*r.byteLength;case RGIntegerFormat:return i*e*2/r.components*r.byteLength;case RGBFormat:return i*e*3/r.components*r.byteLength;case RGBAFormat:return i*e*4/r.components*r.byteLength;case RGBAIntegerFormat:return i*e*4/r.components*r.byteLength;case RGB_S3TC_DXT1_Format:case RGBA_S3TC_DXT1_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case RGBA_S3TC_DXT3_Format:case RGBA_S3TC_DXT5_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case RGB_PVRTC_2BPPV1_Format:case RGBA_PVRTC_2BPPV1_Format:return Math.max(i,16)*Math.max(e,8)/4;case RGB_PVRTC_4BPPV1_Format:case RGBA_PVRTC_4BPPV1_Format:return Math.max(i,8)*Math.max(e,8)/2;case RGB_ETC1_Format:case RGB_ETC2_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case RGBA_ETC2_EAC_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case RGBA_ASTC_4x4_Format:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case RGBA_ASTC_5x4_Format:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case RGBA_ASTC_5x5_Format:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case RGBA_ASTC_6x5_Format:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case RGBA_ASTC_6x6_Format:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case RGBA_ASTC_8x5_Format:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case RGBA_ASTC_8x6_Format:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case RGBA_ASTC_8x8_Format:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case RGBA_ASTC_10x5_Format:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case RGBA_ASTC_10x6_Format:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case RGBA_ASTC_10x8_Format:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case RGBA_ASTC_10x10_Format:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case RGBA_ASTC_12x10_Format:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case RGBA_ASTC_12x12_Format:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case RGBA_BPTC_Format:case RGB_BPTC_SIGNED_Format:case RGB_BPTC_UNSIGNED_Format:return Math.ceil(i/4)*Math.ceil(e/4)*16;case RED_RGTC1_Format:case SIGNED_RED_RGTC1_Format:return Math.ceil(i/4)*Math.ceil(e/4)*8;case RED_GREEN_RGTC2_Format:case SIGNED_RED_GREEN_RGTC2_Format:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function getTextureTypeByteLength(i){switch(i){case UnsignedByteType:case ByteType:return{byteLength:1,components:1};case UnsignedShortType:case ShortType:case HalfFloatType:return{byteLength:2,components:1};case UnsignedShort4444Type:case UnsignedShort5551Type:return{byteLength:2,components:4};case UnsignedIntType:case IntType:case FloatType:return{byteLength:4,components:1};case UnsignedInt5999Type:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=REVISION);function WebGLAnimation(){let i=null,e=!1,t=null,n=null;function r(s,a){t(s,a),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function WebGLAttributes(i){const e=new WeakMap;function t(o,l){const h=o.array,u=o.usage,p=h.byteLength,f=i.createBuffer();i.bindBuffer(l,f),i.bufferData(l,h,u),o.onUploadCallback();let d;if(h instanceof Float32Array)d=i.FLOAT;else if(h instanceof Uint16Array)o.isFloat16BufferAttribute?d=i.HALF_FLOAT:d=i.UNSIGNED_SHORT;else if(h instanceof Int16Array)d=i.SHORT;else if(h instanceof Uint32Array)d=i.UNSIGNED_INT;else if(h instanceof Int32Array)d=i.INT;else if(h instanceof Int8Array)d=i.BYTE;else if(h instanceof Uint8Array)d=i.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)d=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:f,type:d,bytesPerElement:h.BYTES_PER_ELEMENT,version:o.version,size:p}}function n(o,l,h){const u=l.array,p=l.updateRanges;if(i.bindBuffer(h,o),p.length===0)i.bufferSubData(h,0,u);else{p.sort((d,m)=>d.start-m.start);let f=0;for(let d=1;d<p.length;d++){const m=p[f],g=p[d];g.start<=m.start+m.count+1?m.count=Math.max(m.count,g.start+g.count-m.start):(++f,p[f]=g)}p.length=f+1;for(let d=0,m=p.length;d<m;d++){const g=p[d];i.bufferSubData(h,g.start*u.BYTES_PER_ELEMENT,u,g.start,g.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(i.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const h=e.get(o);if(h===void 0)e.set(o,t(o,l));else if(h.version<o.version){if(h.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(h.buffer,o,l),h.version=o.version}}return{get:r,remove:s,update:a}}var alphahash_fragment=`#ifdef USE_ALPHAHASH
|
|
42
42
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
43
43
|
#endif`,alphahash_pars_fragment=`#ifdef USE_ALPHAHASH
|
|
44
44
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3564,7 +3564,7 @@ void main() {
|
|
|
3564
3564
|
#include <tonemapping_fragment>
|
|
3565
3565
|
#include <colorspace_fragment>
|
|
3566
3566
|
#include <fog_fragment>
|
|
3567
|
-
}`,ShaderChunk={alphahash_fragment,alphahash_pars_fragment,alphamap_fragment,alphamap_pars_fragment,alphatest_fragment,alphatest_pars_fragment,aomap_fragment,aomap_pars_fragment,batching_pars_vertex,batching_vertex,begin_vertex,beginnormal_vertex,bsdfs,iridescence_fragment,bumpmap_pars_fragment,clipping_planes_fragment,clipping_planes_pars_fragment,clipping_planes_pars_vertex,clipping_planes_vertex,color_fragment,color_pars_fragment,color_pars_vertex,color_vertex,common,cube_uv_reflection_fragment,defaultnormal_vertex,displacementmap_pars_vertex,displacementmap_vertex,emissivemap_fragment,emissivemap_pars_fragment,colorspace_fragment,colorspace_pars_fragment,envmap_fragment,envmap_common_pars_fragment,envmap_pars_fragment,envmap_pars_vertex,envmap_physical_pars_fragment,envmap_vertex,fog_vertex,fog_pars_vertex,fog_fragment,fog_pars_fragment,gradientmap_pars_fragment,lightmap_pars_fragment,lights_lambert_fragment,lights_lambert_pars_fragment,lights_pars_begin,lights_toon_fragment,lights_toon_pars_fragment,lights_phong_fragment,lights_phong_pars_fragment,lights_physical_fragment,lights_physical_pars_fragment,lights_fragment_begin,lights_fragment_maps,lights_fragment_end,logdepthbuf_fragment,logdepthbuf_pars_fragment,logdepthbuf_pars_vertex,logdepthbuf_vertex,map_fragment,map_pars_fragment,map_particle_fragment,map_particle_pars_fragment,metalnessmap_fragment,metalnessmap_pars_fragment,morphinstance_vertex,morphcolor_vertex,morphnormal_vertex,morphtarget_pars_vertex,morphtarget_vertex,normal_fragment_begin,normal_fragment_maps,normal_pars_fragment,normal_pars_vertex,normal_vertex,normalmap_pars_fragment,clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps,clearcoat_pars_fragment,iridescence_pars_fragment,opaque_fragment,packing,premultiplied_alpha_fragment,project_vertex,dithering_fragment,dithering_pars_fragment,roughnessmap_fragment,roughnessmap_pars_fragment,shadowmap_pars_fragment,shadowmap_pars_vertex,shadowmap_vertex,shadowmask_pars_fragment,skinbase_vertex,skinning_pars_vertex,skinning_vertex,skinnormal_vertex,specularmap_fragment,specularmap_pars_fragment,tonemapping_fragment,tonemapping_pars_fragment,transmission_fragment,transmission_pars_fragment,uv_pars_fragment,uv_pars_vertex,uv_vertex,worldpos_vertex,background_vert:vertex$h,background_frag:fragment$h,backgroundCube_vert:vertex$g,backgroundCube_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1},UniformsLib={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:ShaderChunk.backgroundCube_vert,fragmentShader:ShaderChunk.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};const _rgb={r:0,b:0,g:0},_e1$1=new Euler,_m1$1=new Matrix4;function WebGLBackground(i,e,t,n,r,s,a){const o=new Color(0);let l=s===!0?0:1,h,u,d=null,f=0,p=null;function m(v){let _=v.isScene===!0?v.background:null;return _&&_.isTexture&&(_=(v.backgroundBlurriness>0?t:e).get(_)),_}function g(v){let _=!1;const b=m(v);b===null?c(o,l):b&&b.isColor&&(c(b,1),_=!0);const M=i.xr.getEnvironmentBlendMode();M==="additive"?n.buffers.color.setClear(0,0,0,1,a):M==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||_)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function y(v,_){const b=m(_);b&&(b.isCubeTexture||b.mapping===CubeUVReflectionMapping)?(u===void 0&&(u=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.backgroundCube.uniforms),vertexShader:ShaderLib.backgroundCube.vertexShader,fragmentShader:ShaderLib.backgroundCube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(M,A,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),_e1$1.copy(_.backgroundRotation),_e1$1.x*=-1,_e1$1.y*=-1,_e1$1.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(_e1$1.y*=-1,_e1$1.z*=-1),u.material.uniforms.envMap.value=b,u.material.uniforms.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$1.makeRotationFromEuler(_e1$1)),u.material.toneMapped=ColorManagement.getTransfer(b.colorSpace)!==SRGBTransfer,(d!==b||f!==b.version||p!==i.toneMapping)&&(u.material.needsUpdate=!0,d=b,f=b.version,p=i.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null)):b&&b.isTexture&&(h===void 0&&(h=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=b,h.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,h.material.toneMapped=ColorManagement.getTransfer(b.colorSpace)!==SRGBTransfer,b.matrixAutoUpdate===!0&&b.updateMatrix(),h.material.uniforms.uvTransform.value.copy(b.matrix),(d!==b||f!==b.version||p!==i.toneMapping)&&(h.material.needsUpdate=!0,d=b,f=b.version,p=i.toneMapping),h.layers.enableAll(),v.unshift(h,h.geometry,h.material,0,0,null))}function c(v,_){v.getRGB(_rgb,getUnlitUniformColorSpace(i)),n.buffers.color.setClear(_rgb.r,_rgb.g,_rgb.b,_,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return o},setClearColor:function(v,_=1){o.set(v),l=_,c(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,c(o,l)},render:g,addToRenderList:y,dispose:x}}function WebGLBindingStates(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=f(null);let s=r,a=!1;function o(P,N,V,G,H){let O=!1;const C=d(G,V,N);s!==C&&(s=C,h(s.object)),O=p(P,G,V,H),O&&m(P,G,V,H),H!==null&&e.update(H,i.ELEMENT_ARRAY_BUFFER),(O||a)&&(a=!1,_(P,N,V,G),H!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(H).buffer))}function l(){return i.createVertexArray()}function h(P){return i.bindVertexArray(P)}function u(P){return i.deleteVertexArray(P)}function d(P,N,V){const G=V.wireframe===!0;let H=n[P.id];H===void 0&&(H={},n[P.id]=H);let O=H[N.id];O===void 0&&(O={},H[N.id]=O);let C=O[G];return C===void 0&&(C=f(l()),O[G]=C),C}function f(P){const N=[],V=[],G=[];for(let H=0;H<t;H++)N[H]=0,V[H]=0,G[H]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:V,attributeDivisors:G,object:P,attributes:{},index:null}}function p(P,N,V,G){const H=s.attributes,O=N.attributes;let C=0;const L=V.getAttributes();for(const E in L)if(L[E].location>=0){const k=H[E];let B=O[E];if(B===void 0&&(E==="instanceMatrix"&&P.instanceMatrix&&(B=P.instanceMatrix),E==="instanceColor"&&P.instanceColor&&(B=P.instanceColor)),k===void 0||k.attribute!==B||B&&k.data!==B.data)return!0;C++}return s.attributesNum!==C||s.index!==G}function m(P,N,V,G){const H={},O=N.attributes;let C=0;const L=V.getAttributes();for(const E in L)if(L[E].location>=0){let k=O[E];k===void 0&&(E==="instanceMatrix"&&P.instanceMatrix&&(k=P.instanceMatrix),E==="instanceColor"&&P.instanceColor&&(k=P.instanceColor));const B={};B.attribute=k,k&&k.data&&(B.data=k.data),H[E]=B,C++}s.attributes=H,s.attributesNum=C,s.index=G}function g(){const P=s.newAttributes;for(let N=0,V=P.length;N<V;N++)P[N]=0}function y(P){c(P,0)}function c(P,N){const V=s.newAttributes,G=s.enabledAttributes,H=s.attributeDivisors;V[P]=1,G[P]===0&&(i.enableVertexAttribArray(P),G[P]=1),H[P]!==N&&(i.vertexAttribDivisor(P,N),H[P]=N)}function x(){const P=s.newAttributes,N=s.enabledAttributes;for(let V=0,G=N.length;V<G;V++)N[V]!==P[V]&&(i.disableVertexAttribArray(V),N[V]=0)}function v(P,N,V,G,H,O,C){C===!0?i.vertexAttribIPointer(P,N,V,H,O):i.vertexAttribPointer(P,N,V,G,H,O)}function _(P,N,V,G){g();const H=G.attributes,O=V.getAttributes(),C=N.defaultAttributeValues;for(const L in O){const E=O[L];if(E.location>=0){let T=H[L];if(T===void 0&&(L==="instanceMatrix"&&P.instanceMatrix&&(T=P.instanceMatrix),L==="instanceColor"&&P.instanceColor&&(T=P.instanceColor)),T!==void 0){const k=T.normalized,B=T.itemSize,ee=e.get(T);if(ee===void 0)continue;const oe=ee.buffer,X=ee.type,Q=ee.bytesPerElement,ne=X===i.INT||X===i.UNSIGNED_INT||T.gpuType===IntType;if(T.isInterleavedBufferAttribute){const re=T.data,me=re.stride,Fe=T.offset;if(re.isInstancedInterleavedBuffer){for(let Ee=0;Ee<E.locationSize;Ee++)c(E.location+Ee,re.meshPerAttribute);P.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let Ee=0;Ee<E.locationSize;Ee++)y(E.location+Ee);i.bindBuffer(i.ARRAY_BUFFER,oe);for(let Ee=0;Ee<E.locationSize;Ee++)v(E.location+Ee,B/E.locationSize,X,k,me*Q,(Fe+B/E.locationSize*Ee)*Q,ne)}else{if(T.isInstancedBufferAttribute){for(let re=0;re<E.locationSize;re++)c(E.location+re,T.meshPerAttribute);P.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=T.meshPerAttribute*T.count)}else for(let re=0;re<E.locationSize;re++)y(E.location+re);i.bindBuffer(i.ARRAY_BUFFER,oe);for(let re=0;re<E.locationSize;re++)v(E.location+re,B/E.locationSize,X,k,B*Q,B/E.locationSize*re*Q,ne)}}else if(C!==void 0){const k=C[L];if(k!==void 0)switch(k.length){case 2:i.vertexAttrib2fv(E.location,k);break;case 3:i.vertexAttrib3fv(E.location,k);break;case 4:i.vertexAttrib4fv(E.location,k);break;default:i.vertexAttrib1fv(E.location,k)}}}}x()}function b(){R();for(const P in n){const N=n[P];for(const V in N){const G=N[V];for(const H in G)u(G[H].object),delete G[H];delete N[V]}delete n[P]}}function M(P){if(n[P.id]===void 0)return;const N=n[P.id];for(const V in N){const G=N[V];for(const H in G)u(G[H].object),delete G[H];delete N[V]}delete n[P.id]}function A(P){for(const N in n){const V=n[N];if(V[P.id]===void 0)continue;const G=V[P.id];for(const H in G)u(G[H].object),delete G[H];delete V[P.id]}}function R(){w(),a=!0,s!==r&&(s=r,h(s.object))}function w(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:o,reset:R,resetDefaultState:w,dispose:b,releaseStatesOfGeometry:M,releaseStatesOfProgram:A,initAttributes:g,enableAttribute:y,disableUnusedAttributes:x}}function WebGLBufferRenderer(i,e,t){let n;function r(h){n=h}function s(h,u){i.drawArrays(n,h,u),t.update(u,n,1)}function a(h,u,d){d!==0&&(i.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function o(h,u,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let m=0;m<d;m++)p+=u[m];t.update(p,n,1)}function l(h,u,d,f){if(d===0)return;const p=e.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<h.length;m++)a(h[m],u[m],f[m]);else{p.multiDrawArraysInstancedWEBGL(n,h,0,u,0,f,0,d);let m=0;for(let g=0;g<d;g++)m+=u[g]*f[g];t.update(m,n,1)}}this.setMode=r,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function WebGLCapabilities(i,e,t,n){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");r=i.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function a(A){return!(A!==RGBAFormat&&n.convert(A)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const R=A===HalfFloatType&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==UnsignedByteType&&n.convert(A)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==FloatType&&!R)}function l(A){if(A==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=t.precision!==void 0?t.precision:"highp";const u=l(h);u!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",u,"instead."),h=u);const d=t.logarithmicDepthBuffer===!0,f=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),p=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),m=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),y=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),c=i.getParameter(i.MAX_VERTEX_ATTRIBS),x=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),v=i.getParameter(i.MAX_VARYING_VECTORS),_=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),b=m>0,M=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:h,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:y,maxAttributes:c,maxVertexUniforms:x,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:b,maxSamples:M}}function WebGLClipping(i){const e=this;let t=null,n=0,r=!1,s=!1;const a=new Plane,o=new Matrix3,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||n!==0||r;return r=f,n=d.length,p},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){t=u(d,f,0)},this.setState=function(d,f,p){const m=d.clippingPlanes,g=d.clipIntersection,y=d.clipShadows,c=i.get(d);if(!r||m===null||m.length===0||s&&!y)s?u(null):h();else{const x=s?0:n,v=x*4;let _=c.clippingState||null;l.value=_,_=u(m,f,v,p);for(let b=0;b!==v;++b)_[b]=t[b];c.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=x}};function h(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(d,f,p,m){const g=d!==null?d.length:0;let y=null;if(g!==0){if(y=l.value,m!==!0||y===null){const c=p+g*4,x=f.matrixWorldInverse;o.getNormalMatrix(x),(y===null||y.length<c)&&(y=new Float32Array(c));for(let v=0,_=p;v!==g;++v,_+=4)a.copy(d[v]).applyMatrix4(x,o),a.normal.toArray(y,_),y[_+3]=a.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,y}}function WebGLCubeMaps(i){let e=new WeakMap;function t(a,o){return o===EquirectangularReflectionMapping?a.mapping=CubeReflectionMapping:o===EquirectangularRefractionMapping&&(a.mapping=CubeRefractionMapping),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===EquirectangularReflectionMapping||o===EquirectangularRefractionMapping)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const h=new WebGLCubeRenderTarget(l.height);return h.fromEquirectangularTexture(i,a),e.set(a,h),a.addEventListener("dispose",r),t(h.texture,a.mapping)}else return null}}return a}function r(a){const o=a.target;o.removeEventListener("dispose",r);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color;let _oldTarget=null,_oldActiveCubeFace=0,_oldActiveMipmapLevel=0,_oldXrEnabled=!1;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(-PHI,INV_PHI,0),new Vector3(PHI,INV_PHI,0),new Vector3(-INV_PHI,0,PHI),new Vector3(INV_PHI,0,PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(0,PHI,INV_PHI),new Vector3(-1,1,-1),new Vector3(1,1,-1),new Vector3(-1,1,1),new Vector3(1,1,1)],_origin=new Vector3;class PMREMGenerator{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100,s={}){const{size:a=256,position:o=_origin}=s;_oldTarget=this._renderer.getRenderTarget(),_oldActiveCubeFace=this._renderer.getActiveCubeFace(),_oldActiveMipmapLevel=this._renderer.getActiveMipmapLevel(),_oldXrEnabled=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,r,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(_oldTarget,_oldActiveCubeFace,_oldActiveMipmapLevel),this._renderer.xr.enabled=_oldXrEnabled,e.scissorTest=!1,_setViewport(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===CubeReflectionMapping||e.mapping===CubeRefractionMapping?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),_oldTarget=this._renderer.getRenderTarget(),_oldActiveCubeFace=this._renderer.getActiveCubeFace(),_oldActiveMipmapLevel=this._renderer.getActiveMipmapLevel(),_oldXrEnabled=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:LinearFilter,minFilter:LinearFilter,generateMipmaps:!1,type:HalfFloatType,format:RGBAFormat,colorSpace:LinearSRGBColorSpace,depthBuffer:!1},r=_createRenderTarget(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=_createPlanes(s)),this._blurMaterial=_getBlurShader(s,e,t)}return r}_compileMaterial(e){const t=new Mesh(this._lodPlanes[0],e);this._renderer.compile(t,_flatCamera)}_sceneToCubeUV(e,t,n,r,s){const l=new PerspectiveCamera(90,1,t,n),h=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],d=this._renderer,f=d.autoClear,p=d.toneMapping;d.getClearColor(_clearColor),d.toneMapping=NoToneMapping,d.autoClear=!1;const m=new MeshBasicMaterial({name:"PMREM.Background",side:BackSide,depthWrite:!1,depthTest:!1}),g=new Mesh(new BoxGeometry,m);let y=!1;const c=e.background;c?c.isColor&&(m.color.copy(c),e.background=null,y=!0):(m.color.copy(_clearColor),y=!0);for(let x=0;x<6;x++){const v=x%3;v===0?(l.up.set(0,h[x],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[x],s.y,s.z)):v===1?(l.up.set(0,0,h[x]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[x],s.z)):(l.up.set(0,h[x],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[x]));const _=this._cubeSize;_setViewport(r,v*_,x>2?_:0,_,_),d.setRenderTarget(r),y&&d.render(g,l),d.render(e,l)}g.geometry.dispose(),g.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=c}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===CubeReflectionMapping||e.mapping===CubeRefractionMapping;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new Mesh(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;_setViewport(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,_flatCamera)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;s<r;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=_axisDirections[(r-s-1)%_axisDirections.length];this._blur(e,s-1,s,a,o)}t.autoClear=n}_blur(e,t,n,r,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",s),this._halfBlur(a,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,n,r,s,a,o){const l=this._renderer,h=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,d=new Mesh(this._lodPlanes[r],h),f=h.uniforms,p=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*p):2*Math.PI/(2*MAX_SAMPLES-1),g=s/m,y=isFinite(s)?1+Math.floor(u*g):MAX_SAMPLES;y>MAX_SAMPLES&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${MAX_SAMPLES}`);const c=[];let x=0;for(let A=0;A<MAX_SAMPLES;++A){const R=A/g,w=Math.exp(-R*R/2);c.push(w),A===0?x+=w:A<y&&(x+=2*w)}for(let A=0;A<c.length;A++)c[A]=c[A]/x;f.envMap.value=e.texture,f.samples.value=y,f.weights.value=c,f.latitudinal.value=a==="latitudinal",o&&(f.poleAxis.value=o);const{_lodMax:v}=this;f.dTheta.value=m,f.mipInt.value=v-n;const _=this._sizeLods[r],b=3*_*(r>v-LOD_MIN?r-v+LOD_MIN:0),M=4*(this._cubeSize-_);_setViewport(t,b,M,3*_,2*_),l.setRenderTarget(t),l.render(d,_flatCamera)}}function _createPlanes(i){const e=[],t=[],n=[];let r=i;const s=i-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let a=0;a<s;a++){const o=Math.pow(2,r);t.push(o);let l=1/o;a>i-LOD_MIN?l=EXTRA_LOD_SIGMA[a-i+LOD_MIN-1]:a===0&&(l=0),n.push(l);const h=1/(o-2),u=-h,d=1+h,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,m=6,g=3,y=2,c=1,x=new Float32Array(g*m*p),v=new Float32Array(y*m*p),_=new Float32Array(c*m*p);for(let M=0;M<p;M++){const A=M%3*2/3-1,R=M>2?0:-1,w=[A,R,0,A+2/3,R,0,A+2/3,R+1,0,A,R,0,A+2/3,R+1,0,A,R+1,0];x.set(w,g*m*M),v.set(f,y*m*M);const P=[M,M,M,M,M,M];_.set(P,c*m*M)}const b=new BufferGeometry;b.setAttribute("position",new BufferAttribute(x,g)),b.setAttribute("uv",new BufferAttribute(v,y)),b.setAttribute("faceIndex",new BufferAttribute(_,c)),e.push(b),r>LOD_MIN&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function _createRenderTarget(i,e,t){const n=new WebGLRenderTarget(i,e,t);return n.texture.mapping=CubeUVReflectionMapping,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function _setViewport(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function _getBlurShader(i,e,t){const n=new Float32Array(MAX_SAMPLES),r=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_getCommonVertexShader(),fragmentShader:`
|
|
3567
|
+
}`,ShaderChunk={alphahash_fragment,alphahash_pars_fragment,alphamap_fragment,alphamap_pars_fragment,alphatest_fragment,alphatest_pars_fragment,aomap_fragment,aomap_pars_fragment,batching_pars_vertex,batching_vertex,begin_vertex,beginnormal_vertex,bsdfs,iridescence_fragment,bumpmap_pars_fragment,clipping_planes_fragment,clipping_planes_pars_fragment,clipping_planes_pars_vertex,clipping_planes_vertex,color_fragment,color_pars_fragment,color_pars_vertex,color_vertex,common,cube_uv_reflection_fragment,defaultnormal_vertex,displacementmap_pars_vertex,displacementmap_vertex,emissivemap_fragment,emissivemap_pars_fragment,colorspace_fragment,colorspace_pars_fragment,envmap_fragment,envmap_common_pars_fragment,envmap_pars_fragment,envmap_pars_vertex,envmap_physical_pars_fragment,envmap_vertex,fog_vertex,fog_pars_vertex,fog_fragment,fog_pars_fragment,gradientmap_pars_fragment,lightmap_pars_fragment,lights_lambert_fragment,lights_lambert_pars_fragment,lights_pars_begin,lights_toon_fragment,lights_toon_pars_fragment,lights_phong_fragment,lights_phong_pars_fragment,lights_physical_fragment,lights_physical_pars_fragment,lights_fragment_begin,lights_fragment_maps,lights_fragment_end,logdepthbuf_fragment,logdepthbuf_pars_fragment,logdepthbuf_pars_vertex,logdepthbuf_vertex,map_fragment,map_pars_fragment,map_particle_fragment,map_particle_pars_fragment,metalnessmap_fragment,metalnessmap_pars_fragment,morphinstance_vertex,morphcolor_vertex,morphnormal_vertex,morphtarget_pars_vertex,morphtarget_vertex,normal_fragment_begin,normal_fragment_maps,normal_pars_fragment,normal_pars_vertex,normal_vertex,normalmap_pars_fragment,clearcoat_normal_fragment_begin,clearcoat_normal_fragment_maps,clearcoat_pars_fragment,iridescence_pars_fragment,opaque_fragment,packing,premultiplied_alpha_fragment,project_vertex,dithering_fragment,dithering_pars_fragment,roughnessmap_fragment,roughnessmap_pars_fragment,shadowmap_pars_fragment,shadowmap_pars_vertex,shadowmap_vertex,shadowmask_pars_fragment,skinbase_vertex,skinning_pars_vertex,skinning_vertex,skinnormal_vertex,specularmap_fragment,specularmap_pars_fragment,tonemapping_fragment,tonemapping_pars_fragment,transmission_fragment,transmission_pars_fragment,uv_pars_fragment,uv_pars_vertex,uv_vertex,worldpos_vertex,background_vert:vertex$h,background_frag:fragment$h,backgroundCube_vert:vertex$g,backgroundCube_frag:fragment$g,cube_vert:vertex$f,cube_frag:fragment$f,depth_vert:vertex$e,depth_frag:fragment$e,distanceRGBA_vert:vertex$d,distanceRGBA_frag:fragment$d,equirect_vert:vertex$c,equirect_frag:fragment$c,linedashed_vert:vertex$b,linedashed_frag:fragment$b,meshbasic_vert:vertex$a,meshbasic_frag:fragment$a,meshlambert_vert:vertex$9,meshlambert_frag:fragment$9,meshmatcap_vert:vertex$8,meshmatcap_frag:fragment$8,meshnormal_vert:vertex$7,meshnormal_frag:fragment$7,meshphong_vert:vertex$6,meshphong_frag:fragment$6,meshphysical_vert:vertex$5,meshphysical_frag:fragment$5,meshtoon_vert:vertex$4,meshtoon_frag:fragment$4,points_vert:vertex$3,points_frag:fragment$3,shadow_vert:vertex$2,shadow_frag:fragment$2,sprite_vert:vertex$1,sprite_frag:fragment$1},UniformsLib={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ShaderLib={basic:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.fog]),vertexShader:ShaderChunk.meshbasic_vert,fragmentShader:ShaderChunk.meshbasic_frag},lambert:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshlambert_vert,fragmentShader:ShaderChunk.meshlambert_frag},phong:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.specularmap,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ShaderChunk.meshphong_vert,fragmentShader:ShaderChunk.meshphong_frag},standard:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.envmap,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.roughnessmap,UniformsLib.metalnessmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag},toon:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.aomap,UniformsLib.lightmap,UniformsLib.emissivemap,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.gradientmap,UniformsLib.fog,UniformsLib.lights,{emissive:{value:new Color(0)}}]),vertexShader:ShaderChunk.meshtoon_vert,fragmentShader:ShaderChunk.meshtoon_frag},matcap:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,UniformsLib.fog,{matcap:{value:null}}]),vertexShader:ShaderChunk.meshmatcap_vert,fragmentShader:ShaderChunk.meshmatcap_frag},points:{uniforms:mergeUniforms([UniformsLib.points,UniformsLib.fog]),vertexShader:ShaderChunk.points_vert,fragmentShader:ShaderChunk.points_frag},dashed:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ShaderChunk.linedashed_vert,fragmentShader:ShaderChunk.linedashed_frag},depth:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap]),vertexShader:ShaderChunk.depth_vert,fragmentShader:ShaderChunk.depth_frag},normal:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.bumpmap,UniformsLib.normalmap,UniformsLib.displacementmap,{opacity:{value:1}}]),vertexShader:ShaderChunk.meshnormal_vert,fragmentShader:ShaderChunk.meshnormal_frag},sprite:{uniforms:mergeUniforms([UniformsLib.sprite,UniformsLib.fog]),vertexShader:ShaderChunk.sprite_vert,fragmentShader:ShaderChunk.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ShaderChunk.background_vert,fragmentShader:ShaderChunk.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:ShaderChunk.backgroundCube_vert,fragmentShader:ShaderChunk.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ShaderChunk.cube_vert,fragmentShader:ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ShaderChunk.equirect_vert,fragmentShader:ShaderChunk.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([UniformsLib.common,UniformsLib.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ShaderChunk.distanceRGBA_vert,fragmentShader:ShaderChunk.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([UniformsLib.lights,UniformsLib.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ShaderChunk.shadow_vert,fragmentShader:ShaderChunk.shadow_frag}};ShaderLib.physical={uniforms:mergeUniforms([ShaderLib.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:ShaderChunk.meshphysical_vert,fragmentShader:ShaderChunk.meshphysical_frag};const _rgb={r:0,b:0,g:0},_e1$1=new Euler,_m1$1=new Matrix4;function WebGLBackground(i,e,t,n,r,s,a){const o=new Color(0);let l=s===!0?0:1,h,u,p=null,f=0,d=null;function m(v){let _=v.isScene===!0?v.background:null;return _&&_.isTexture&&(_=(v.backgroundBlurriness>0?t:e).get(_)),_}function g(v){let _=!1;const b=m(v);b===null?c(o,l):b&&b.isColor&&(c(b,1),_=!0);const M=i.xr.getEnvironmentBlendMode();M==="additive"?n.buffers.color.setClear(0,0,0,1,a):M==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(i.autoClear||_)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function y(v,_){const b=m(_);b&&(b.isCubeTexture||b.mapping===CubeUVReflectionMapping)?(u===void 0&&(u=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ShaderLib.backgroundCube.uniforms),vertexShader:ShaderLib.backgroundCube.vertexShader,fragmentShader:ShaderLib.backgroundCube.fragmentShader,side:BackSide,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(M,A,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),_e1$1.copy(_.backgroundRotation),_e1$1.x*=-1,_e1$1.y*=-1,_e1$1.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(_e1$1.y*=-1,_e1$1.z*=-1),u.material.uniforms.envMap.value=b,u.material.uniforms.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=_.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$1.makeRotationFromEuler(_e1$1)),u.material.toneMapped=ColorManagement.getTransfer(b.colorSpace)!==SRGBTransfer,(p!==b||f!==b.version||d!==i.toneMapping)&&(u.material.needsUpdate=!0,p=b,f=b.version,d=i.toneMapping),u.layers.enableAll(),v.unshift(u,u.geometry,u.material,0,0,null)):b&&b.isTexture&&(h===void 0&&(h=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ShaderLib.background.uniforms),vertexShader:ShaderLib.background.vertexShader,fragmentShader:ShaderLib.background.fragmentShader,side:FrontSide,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(h)),h.material.uniforms.t2D.value=b,h.material.uniforms.backgroundIntensity.value=_.backgroundIntensity,h.material.toneMapped=ColorManagement.getTransfer(b.colorSpace)!==SRGBTransfer,b.matrixAutoUpdate===!0&&b.updateMatrix(),h.material.uniforms.uvTransform.value.copy(b.matrix),(p!==b||f!==b.version||d!==i.toneMapping)&&(h.material.needsUpdate=!0,p=b,f=b.version,d=i.toneMapping),h.layers.enableAll(),v.unshift(h,h.geometry,h.material,0,0,null))}function c(v,_){v.getRGB(_rgb,getUnlitUniformColorSpace(i)),n.buffers.color.setClear(_rgb.r,_rgb.g,_rgb.b,_,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0)}return{getClearColor:function(){return o},setClearColor:function(v,_=1){o.set(v),l=_,c(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(v){l=v,c(o,l)},render:g,addToRenderList:y,dispose:x}}function WebGLBindingStates(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=f(null);let s=r,a=!1;function o(P,N,V,G,H){let O=!1;const C=p(G,V,N);s!==C&&(s=C,h(s.object)),O=d(P,G,V,H),O&&m(P,G,V,H),H!==null&&e.update(H,i.ELEMENT_ARRAY_BUFFER),(O||a)&&(a=!1,_(P,N,V,G),H!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(H).buffer))}function l(){return i.createVertexArray()}function h(P){return i.bindVertexArray(P)}function u(P){return i.deleteVertexArray(P)}function p(P,N,V){const G=V.wireframe===!0;let H=n[P.id];H===void 0&&(H={},n[P.id]=H);let O=H[N.id];O===void 0&&(O={},H[N.id]=O);let C=O[G];return C===void 0&&(C=f(l()),O[G]=C),C}function f(P){const N=[],V=[],G=[];for(let H=0;H<t;H++)N[H]=0,V[H]=0,G[H]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:V,attributeDivisors:G,object:P,attributes:{},index:null}}function d(P,N,V,G){const H=s.attributes,O=N.attributes;let C=0;const L=V.getAttributes();for(const E in L)if(L[E].location>=0){const k=H[E];let B=O[E];if(B===void 0&&(E==="instanceMatrix"&&P.instanceMatrix&&(B=P.instanceMatrix),E==="instanceColor"&&P.instanceColor&&(B=P.instanceColor)),k===void 0||k.attribute!==B||B&&k.data!==B.data)return!0;C++}return s.attributesNum!==C||s.index!==G}function m(P,N,V,G){const H={},O=N.attributes;let C=0;const L=V.getAttributes();for(const E in L)if(L[E].location>=0){let k=O[E];k===void 0&&(E==="instanceMatrix"&&P.instanceMatrix&&(k=P.instanceMatrix),E==="instanceColor"&&P.instanceColor&&(k=P.instanceColor));const B={};B.attribute=k,k&&k.data&&(B.data=k.data),H[E]=B,C++}s.attributes=H,s.attributesNum=C,s.index=G}function g(){const P=s.newAttributes;for(let N=0,V=P.length;N<V;N++)P[N]=0}function y(P){c(P,0)}function c(P,N){const V=s.newAttributes,G=s.enabledAttributes,H=s.attributeDivisors;V[P]=1,G[P]===0&&(i.enableVertexAttribArray(P),G[P]=1),H[P]!==N&&(i.vertexAttribDivisor(P,N),H[P]=N)}function x(){const P=s.newAttributes,N=s.enabledAttributes;for(let V=0,G=N.length;V<G;V++)N[V]!==P[V]&&(i.disableVertexAttribArray(V),N[V]=0)}function v(P,N,V,G,H,O,C){C===!0?i.vertexAttribIPointer(P,N,V,H,O):i.vertexAttribPointer(P,N,V,G,H,O)}function _(P,N,V,G){g();const H=G.attributes,O=V.getAttributes(),C=N.defaultAttributeValues;for(const L in O){const E=O[L];if(E.location>=0){let T=H[L];if(T===void 0&&(L==="instanceMatrix"&&P.instanceMatrix&&(T=P.instanceMatrix),L==="instanceColor"&&P.instanceColor&&(T=P.instanceColor)),T!==void 0){const k=T.normalized,B=T.itemSize,ee=e.get(T);if(ee===void 0)continue;const oe=ee.buffer,X=ee.type,Q=ee.bytesPerElement,ne=X===i.INT||X===i.UNSIGNED_INT||T.gpuType===IntType;if(T.isInterleavedBufferAttribute){const re=T.data,me=re.stride,Fe=T.offset;if(re.isInstancedInterleavedBuffer){for(let Ee=0;Ee<E.locationSize;Ee++)c(E.location+Ee,re.meshPerAttribute);P.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let Ee=0;Ee<E.locationSize;Ee++)y(E.location+Ee);i.bindBuffer(i.ARRAY_BUFFER,oe);for(let Ee=0;Ee<E.locationSize;Ee++)v(E.location+Ee,B/E.locationSize,X,k,me*Q,(Fe+B/E.locationSize*Ee)*Q,ne)}else{if(T.isInstancedBufferAttribute){for(let re=0;re<E.locationSize;re++)c(E.location+re,T.meshPerAttribute);P.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=T.meshPerAttribute*T.count)}else for(let re=0;re<E.locationSize;re++)y(E.location+re);i.bindBuffer(i.ARRAY_BUFFER,oe);for(let re=0;re<E.locationSize;re++)v(E.location+re,B/E.locationSize,X,k,B*Q,B/E.locationSize*re*Q,ne)}}else if(C!==void 0){const k=C[L];if(k!==void 0)switch(k.length){case 2:i.vertexAttrib2fv(E.location,k);break;case 3:i.vertexAttrib3fv(E.location,k);break;case 4:i.vertexAttrib4fv(E.location,k);break;default:i.vertexAttrib1fv(E.location,k)}}}}x()}function b(){R();for(const P in n){const N=n[P];for(const V in N){const G=N[V];for(const H in G)u(G[H].object),delete G[H];delete N[V]}delete n[P]}}function M(P){if(n[P.id]===void 0)return;const N=n[P.id];for(const V in N){const G=N[V];for(const H in G)u(G[H].object),delete G[H];delete N[V]}delete n[P.id]}function A(P){for(const N in n){const V=n[N];if(V[P.id]===void 0)continue;const G=V[P.id];for(const H in G)u(G[H].object),delete G[H];delete V[P.id]}}function R(){w(),a=!0,s!==r&&(s=r,h(s.object))}function w(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:o,reset:R,resetDefaultState:w,dispose:b,releaseStatesOfGeometry:M,releaseStatesOfProgram:A,initAttributes:g,enableAttribute:y,disableUnusedAttributes:x}}function WebGLBufferRenderer(i,e,t){let n;function r(h){n=h}function s(h,u){i.drawArrays(n,h,u),t.update(u,n,1)}function a(h,u,p){p!==0&&(i.drawArraysInstanced(n,h,u,p),t.update(u,n,p))}function o(h,u,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,h,0,u,0,p);let d=0;for(let m=0;m<p;m++)d+=u[m];t.update(d,n,1)}function l(h,u,p,f){if(p===0)return;const d=e.get("WEBGL_multi_draw");if(d===null)for(let m=0;m<h.length;m++)a(h[m],u[m],f[m]);else{d.multiDrawArraysInstancedWEBGL(n,h,0,u,0,f,0,p);let m=0;for(let g=0;g<p;g++)m+=u[g]*f[g];t.update(m,n,1)}}this.setMode=r,this.render=s,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function WebGLCapabilities(i,e,t,n){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");r=i.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function a(A){return!(A!==RGBAFormat&&n.convert(A)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const R=A===HalfFloatType&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==UnsignedByteType&&n.convert(A)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==FloatType&&!R)}function l(A){if(A==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let h=t.precision!==void 0?t.precision:"highp";const u=l(h);u!==h&&(console.warn("THREE.WebGLRenderer:",h,"not supported, using",u,"instead."),h=u);const p=t.logarithmicDepthBuffer===!0,f=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),m=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=i.getParameter(i.MAX_TEXTURE_SIZE),y=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),c=i.getParameter(i.MAX_VERTEX_ATTRIBS),x=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),v=i.getParameter(i.MAX_VARYING_VECTORS),_=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),b=m>0,M=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:h,logarithmicDepthBuffer:p,reverseDepthBuffer:f,maxTextures:d,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:y,maxAttributes:c,maxVertexUniforms:x,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:b,maxSamples:M}}function WebGLClipping(i){const e=this;let t=null,n=0,r=!1,s=!1;const a=new Plane,o=new Matrix3,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,f){const d=p.length!==0||f||n!==0||r;return r=f,n=p.length,d},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,f){t=u(p,f,0)},this.setState=function(p,f,d){const m=p.clippingPlanes,g=p.clipIntersection,y=p.clipShadows,c=i.get(p);if(!r||m===null||m.length===0||s&&!y)s?u(null):h();else{const x=s?0:n,v=x*4;let _=c.clippingState||null;l.value=_,_=u(m,f,v,d);for(let b=0;b!==v;++b)_[b]=t[b];c.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=x}};function h(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(p,f,d,m){const g=p!==null?p.length:0;let y=null;if(g!==0){if(y=l.value,m!==!0||y===null){const c=d+g*4,x=f.matrixWorldInverse;o.getNormalMatrix(x),(y===null||y.length<c)&&(y=new Float32Array(c));for(let v=0,_=d;v!==g;++v,_+=4)a.copy(p[v]).applyMatrix4(x,o),a.normal.toArray(y,_),y[_+3]=a.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=g,e.numIntersection=0,y}}function WebGLCubeMaps(i){let e=new WeakMap;function t(a,o){return o===EquirectangularReflectionMapping?a.mapping=CubeReflectionMapping:o===EquirectangularRefractionMapping&&(a.mapping=CubeRefractionMapping),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===EquirectangularReflectionMapping||o===EquirectangularRefractionMapping)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const h=new WebGLCubeRenderTarget(l.height);return h.fromEquirectangularTexture(i,a),e.set(a,h),a.addEventListener("dispose",r),t(h.texture,a.mapping)}else return null}}return a}function r(a){const o=a.target;o.removeEventListener("dispose",r);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const LOD_MIN=4,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],MAX_SAMPLES=20,_flatCamera=new OrthographicCamera,_clearColor=new Color;let _oldTarget=null,_oldActiveCubeFace=0,_oldActiveMipmapLevel=0,_oldXrEnabled=!1;const PHI=(1+Math.sqrt(5))/2,INV_PHI=1/PHI,_axisDirections=[new Vector3(-PHI,INV_PHI,0),new Vector3(PHI,INV_PHI,0),new Vector3(-INV_PHI,0,PHI),new Vector3(INV_PHI,0,PHI),new Vector3(0,PHI,-INV_PHI),new Vector3(0,PHI,INV_PHI),new Vector3(-1,1,-1),new Vector3(1,1,-1),new Vector3(-1,1,1),new Vector3(1,1,1)],_origin=new Vector3;class PMREMGenerator{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100,s={}){const{size:a=256,position:o=_origin}=s;_oldTarget=this._renderer.getRenderTarget(),_oldActiveCubeFace=this._renderer.getActiveCubeFace(),_oldActiveMipmapLevel=this._renderer.getActiveMipmapLevel(),_oldXrEnabled=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,r,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(_oldTarget,_oldActiveCubeFace,_oldActiveMipmapLevel),this._renderer.xr.enabled=_oldXrEnabled,e.scissorTest=!1,_setViewport(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===CubeReflectionMapping||e.mapping===CubeRefractionMapping?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),_oldTarget=this._renderer.getRenderTarget(),_oldActiveCubeFace=this._renderer.getActiveCubeFace(),_oldActiveMipmapLevel=this._renderer.getActiveMipmapLevel(),_oldXrEnabled=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:LinearFilter,minFilter:LinearFilter,generateMipmaps:!1,type:HalfFloatType,format:RGBAFormat,colorSpace:LinearSRGBColorSpace,depthBuffer:!1},r=_createRenderTarget(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=_createPlanes(s)),this._blurMaterial=_getBlurShader(s,e,t)}return r}_compileMaterial(e){const t=new Mesh(this._lodPlanes[0],e);this._renderer.compile(t,_flatCamera)}_sceneToCubeUV(e,t,n,r,s){const l=new PerspectiveCamera(90,1,t,n),h=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],p=this._renderer,f=p.autoClear,d=p.toneMapping;p.getClearColor(_clearColor),p.toneMapping=NoToneMapping,p.autoClear=!1;const m=new MeshBasicMaterial({name:"PMREM.Background",side:BackSide,depthWrite:!1,depthTest:!1}),g=new Mesh(new BoxGeometry,m);let y=!1;const c=e.background;c?c.isColor&&(m.color.copy(c),e.background=null,y=!0):(m.color.copy(_clearColor),y=!0);for(let x=0;x<6;x++){const v=x%3;v===0?(l.up.set(0,h[x],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[x],s.y,s.z)):v===1?(l.up.set(0,0,h[x]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[x],s.z)):(l.up.set(0,h[x],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[x]));const _=this._cubeSize;_setViewport(r,v*_,x>2?_:0,_,_),p.setRenderTarget(r),y&&p.render(g,l),p.render(e,l)}g.geometry.dispose(),g.material.dispose(),p.toneMapping=d,p.autoClear=f,e.background=c}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===CubeReflectionMapping||e.mapping===CubeRefractionMapping;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_getEquirectMaterial());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new Mesh(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;_setViewport(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,_flatCamera)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;s<r;s++){const a=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=_axisDirections[(r-s-1)%_axisDirections.length];this._blur(e,s-1,s,a,o)}t.autoClear=n}_blur(e,t,n,r,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",s),this._halfBlur(a,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,n,r,s,a,o){const l=this._renderer,h=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,p=new Mesh(this._lodPlanes[r],h),f=h.uniforms,d=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*d):2*Math.PI/(2*MAX_SAMPLES-1),g=s/m,y=isFinite(s)?1+Math.floor(u*g):MAX_SAMPLES;y>MAX_SAMPLES&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${MAX_SAMPLES}`);const c=[];let x=0;for(let A=0;A<MAX_SAMPLES;++A){const R=A/g,w=Math.exp(-R*R/2);c.push(w),A===0?x+=w:A<y&&(x+=2*w)}for(let A=0;A<c.length;A++)c[A]=c[A]/x;f.envMap.value=e.texture,f.samples.value=y,f.weights.value=c,f.latitudinal.value=a==="latitudinal",o&&(f.poleAxis.value=o);const{_lodMax:v}=this;f.dTheta.value=m,f.mipInt.value=v-n;const _=this._sizeLods[r],b=3*_*(r>v-LOD_MIN?r-v+LOD_MIN:0),M=4*(this._cubeSize-_);_setViewport(t,b,M,3*_,2*_),l.setRenderTarget(t),l.render(p,_flatCamera)}}function _createPlanes(i){const e=[],t=[],n=[];let r=i;const s=i-LOD_MIN+1+EXTRA_LOD_SIGMA.length;for(let a=0;a<s;a++){const o=Math.pow(2,r);t.push(o);let l=1/o;a>i-LOD_MIN?l=EXTRA_LOD_SIGMA[a-i+LOD_MIN-1]:a===0&&(l=0),n.push(l);const h=1/(o-2),u=-h,p=1+h,f=[u,u,p,u,p,p,u,u,p,p,u,p],d=6,m=6,g=3,y=2,c=1,x=new Float32Array(g*m*d),v=new Float32Array(y*m*d),_=new Float32Array(c*m*d);for(let M=0;M<d;M++){const A=M%3*2/3-1,R=M>2?0:-1,w=[A,R,0,A+2/3,R,0,A+2/3,R+1,0,A,R,0,A+2/3,R+1,0,A,R+1,0];x.set(w,g*m*M),v.set(f,y*m*M);const P=[M,M,M,M,M,M];_.set(P,c*m*M)}const b=new BufferGeometry;b.setAttribute("position",new BufferAttribute(x,g)),b.setAttribute("uv",new BufferAttribute(v,y)),b.setAttribute("faceIndex",new BufferAttribute(_,c)),e.push(b),r>LOD_MIN&&r--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function _createRenderTarget(i,e,t){const n=new WebGLRenderTarget(i,e,t);return n.texture.mapping=CubeUVReflectionMapping,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function _setViewport(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function _getBlurShader(i,e,t){const n=new Float32Array(MAX_SAMPLES),r=new Vector3(0,1,0);return new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:MAX_SAMPLES,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:_getCommonVertexShader(),fragmentShader:`
|
|
3568
3568
|
|
|
3569
3569
|
precision mediump float;
|
|
3570
3570
|
precision mediump int;
|
|
@@ -3714,7 +3714,7 @@ void main() {
|
|
|
3714
3714
|
gl_Position = vec4( position, 1.0 );
|
|
3715
3715
|
|
|
3716
3716
|
}
|
|
3717
|
-
`}function WebGLCubeUVMaps(i){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,h=l===EquirectangularReflectionMapping||l===EquirectangularRefractionMapping,u=l===CubeReflectionMapping||l===CubeRefractionMapping;if(h||u){let d=e.get(o);const f=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return t===null&&(t=new PMREMGenerator(i)),d=h?t.fromEquirectangular(o,d):t.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const p=o.image;return h&&p&&p.height>0||u&&p&&r(p)?(t===null&&(t=new PMREMGenerator(i)),d=h?t.fromEquirectangular(o):t.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",s),d.texture):null}}}return o}function r(o){let l=0;const h=6;for(let u=0;u<h;u++)o[u]!==void 0&&l++;return l===h}function s(o){const l=o.target;l.removeEventListener("dispose",s);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function WebGLExtensions(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const r=t(n);return r===null&&warnOnce("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function WebGLGeometries(i,e,t,n){const r={},s=new WeakMap;function a(d){const f=d.target;f.index!==null&&e.remove(f.index);for(const m in f.attributes)e.remove(f.attributes[m]);f.removeEventListener("dispose",a),delete r[f.id];const p=s.get(f);p&&(e.remove(p),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function o(d,f){return r[f.id]===!0||(f.addEventListener("dispose",a),r[f.id]=!0,t.memory.geometries++),f}function l(d){const f=d.attributes;for(const p in f)e.update(f[p],i.ARRAY_BUFFER)}function h(d){const f=[],p=d.index,m=d.attributes.position;let g=0;if(p!==null){const x=p.array;g=p.version;for(let v=0,_=x.length;v<_;v+=3){const b=x[v+0],M=x[v+1],A=x[v+2];f.push(b,M,M,A,A,b)}}else if(m!==void 0){const x=m.array;g=m.version;for(let v=0,_=x.length/3-1;v<_;v+=3){const b=v+0,M=v+1,A=v+2;f.push(b,M,M,A,A,b)}}else return;const y=new(arrayNeedsUint32(f)?Uint32BufferAttribute:Uint16BufferAttribute)(f,1);y.version=g;const c=s.get(d);c&&e.remove(c),s.set(d,y)}function u(d){const f=s.get(d);if(f){const p=d.index;p!==null&&f.version<p.version&&h(d)}else h(d);return s.get(d)}return{get:o,update:l,getWireframeAttribute:u}}function WebGLIndexedBufferRenderer(i,e,t){let n;function r(f){n=f}let s,a;function o(f){s=f.type,a=f.bytesPerElement}function l(f,p){i.drawElements(n,p,s,f*a),t.update(p,n,1)}function h(f,p,m){m!==0&&(i.drawElementsInstanced(n,p,s,f*a,m),t.update(p,n,m))}function u(f,p,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,p,0,s,f,0,m);let y=0;for(let c=0;c<m;c++)y+=p[c];t.update(y,n,1)}function d(f,p,m,g){if(m===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let c=0;c<f.length;c++)h(f[c]/a,p[c],g[c]);else{y.multiDrawElementsInstancedWEBGL(n,p,0,s,f,0,g,0,m);let c=0;for(let x=0;x<m;x++)c+=p[x]*g[x];t.update(c,n,1)}}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=h,this.renderMultiDraw=u,this.renderMultiDrawInstances=d}function WebGLInfo(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=o*(s/3);break;case i.LINES:t.lines+=o*(s/2);break;case i.LINE_STRIP:t.lines+=o*(s-1);break;case i.LINE_LOOP:t.lines+=o*s;break;case i.POINTS:t.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function WebGLMorphtargets(i,e,t){const n=new WeakMap,r=new Vector4;function s(a,o,l){const h=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,d=u!==void 0?u.length:0;let f=n.get(o);if(f===void 0||f.count!==d){let w=function(){A.dispose(),n.delete(o),o.removeEventListener("dispose",w)};f!==void 0&&f.texture.dispose();const p=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,y=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],x=o.morphAttributes.color||[];let v=0;p===!0&&(v=1),m===!0&&(v=2),g===!0&&(v=3);let _=o.attributes.position.count*v,b=1;_>e.maxTextureSize&&(b=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const M=new Float32Array(_*b*4*d),A=new DataArrayTexture(M,_,b,d);A.type=FloatType,A.needsUpdate=!0;const R=v*4;for(let P=0;P<d;P++){const N=y[P],V=c[P],G=x[P],H=_*b*4*P;for(let O=0;O<N.count;O++){const C=O*R;p===!0&&(r.fromBufferAttribute(N,O),M[H+C+0]=r.x,M[H+C+1]=r.y,M[H+C+2]=r.z,M[H+C+3]=0),m===!0&&(r.fromBufferAttribute(V,O),M[H+C+4]=r.x,M[H+C+5]=r.y,M[H+C+6]=r.z,M[H+C+7]=0),g===!0&&(r.fromBufferAttribute(G,O),M[H+C+8]=r.x,M[H+C+9]=r.y,M[H+C+10]=r.z,M[H+C+11]=G.itemSize===4?r.w:1)}}f={count:d,texture:A,size:new Vector2(_,b)},n.set(o,f),o.addEventListener("dispose",w)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(i,"morphTexture",a.morphTexture,t);else{let p=0;for(let g=0;g<h.length;g++)p+=h[g];const m=o.morphTargetsRelative?1:1-p;l.getUniforms().setValue(i,"morphTargetBaseInfluence",m),l.getUniforms().setValue(i,"morphTargetInfluences",h)}l.getUniforms().setValue(i,"morphTargetsTexture",f.texture,t),l.getUniforms().setValue(i,"morphTargetsTextureSize",f.size)}return{update:s}}function WebGLObjects(i,e,t,n){let r=new WeakMap;function s(l){const h=n.render.frame,u=l.geometry,d=e.get(l,u);if(r.get(d)!==h&&(e.update(d),r.set(d,h)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),r.get(l)!==h&&(t.update(l.instanceMatrix,i.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,i.ARRAY_BUFFER),r.set(l,h))),l.isSkinnedMesh){const f=l.skeleton;r.get(f)!==h&&(f.update(),r.set(f,h))}return d}function a(){r=new WeakMap}function o(l){const h=l.target;h.removeEventListener("dispose",o),t.remove(h.instanceMatrix),h.instanceColor!==null&&t.remove(h.instanceColor)}return{update:s,dispose:a}}const emptyTexture=new Texture,emptyShadowTexture=new DepthTexture(1,1),emptyArrayTexture=new DataArrayTexture,empty3dTexture=new Data3DTexture,emptyCubeTexture=new CubeTexture,arrayCacheF32=[],arrayCacheI32=[],mat4array=new Float32Array(16),mat3array=new Float32Array(9),mat2array=new Float32Array(4);function flatten(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let s=arrayCacheF32[r];if(s===void 0&&(s=new Float32Array(r),arrayCacheF32[r]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,i[a].toArray(s,o)}return s}function arraysEqual(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function copyArray(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function allocTexUnits(i,e){let t=arrayCacheI32[e];t===void 0&&(t=new Int32Array(e),arrayCacheI32[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function setValueV1f(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function setValueV2f(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(arraysEqual(t,e))return;i.uniform2fv(this.addr,e),copyArray(t,e)}}function setValueV3f(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(arraysEqual(t,e))return;i.uniform3fv(this.addr,e),copyArray(t,e)}}function setValueV4f(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(arraysEqual(t,e))return;i.uniform4fv(this.addr,e),copyArray(t,e)}}function setValueM2(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(arraysEqual(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),copyArray(t,e)}else{if(arraysEqual(t,n))return;mat2array.set(n),i.uniformMatrix2fv(this.addr,!1,mat2array),copyArray(t,n)}}function setValueM3(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(arraysEqual(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),copyArray(t,e)}else{if(arraysEqual(t,n))return;mat3array.set(n),i.uniformMatrix3fv(this.addr,!1,mat3array),copyArray(t,n)}}function setValueM4(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(arraysEqual(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),copyArray(t,e)}else{if(arraysEqual(t,n))return;mat4array.set(n),i.uniformMatrix4fv(this.addr,!1,mat4array),copyArray(t,n)}}function setValueV1i(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function setValueV2i(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(arraysEqual(t,e))return;i.uniform2iv(this.addr,e),copyArray(t,e)}}function setValueV3i(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(arraysEqual(t,e))return;i.uniform3iv(this.addr,e),copyArray(t,e)}}function setValueV4i(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(arraysEqual(t,e))return;i.uniform4iv(this.addr,e),copyArray(t,e)}}function setValueV1ui(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function setValueV2ui(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(arraysEqual(t,e))return;i.uniform2uiv(this.addr,e),copyArray(t,e)}}function setValueV3ui(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(arraysEqual(t,e))return;i.uniform3uiv(this.addr,e),copyArray(t,e)}}function setValueV4ui(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(arraysEqual(t,e))return;i.uniform4uiv(this.addr,e),copyArray(t,e)}}function setValueT1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r);let s;this.type===i.SAMPLER_2D_SHADOW?(emptyShadowTexture.compareFunction=LessEqualCompare,s=emptyShadowTexture):s=emptyTexture,t.setTexture2D(e||s,r)}function setValueT3D1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||empty3dTexture,r)}function setValueT6(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||emptyCubeTexture,r)}function setValueT2DArray1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||emptyArrayTexture,r)}function getSingularSetter(i){switch(i){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}function setValueV1fArray(i,e){i.uniform1fv(this.addr,e)}function setValueV2fArray(i,e){const t=flatten(e,this.size,2);i.uniform2fv(this.addr,t)}function setValueV3fArray(i,e){const t=flatten(e,this.size,3);i.uniform3fv(this.addr,t)}function setValueV4fArray(i,e){const t=flatten(e,this.size,4);i.uniform4fv(this.addr,t)}function setValueM2Array(i,e){const t=flatten(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function setValueM3Array(i,e){const t=flatten(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function setValueM4Array(i,e){const t=flatten(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function setValueV1iArray(i,e){i.uniform1iv(this.addr,e)}function setValueV2iArray(i,e){i.uniform2iv(this.addr,e)}function setValueV3iArray(i,e){i.uniform3iv(this.addr,e)}function setValueV4iArray(i,e){i.uniform4iv(this.addr,e)}function setValueV1uiArray(i,e){i.uniform1uiv(this.addr,e)}function setValueV2uiArray(i,e){i.uniform2uiv(this.addr,e)}function setValueV3uiArray(i,e){i.uniform3uiv(this.addr,e)}function setValueV4uiArray(i,e){i.uniform4uiv(this.addr,e)}function setValueT1Array(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTexture2D(e[a]||emptyTexture,s[a])}function setValueT3DArray(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTexture3D(e[a]||empty3dTexture,s[a])}function setValueT6Array(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTextureCube(e[a]||emptyCubeTexture,s[a])}function setValueT2DArrayArray(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTexture2DArray(e[a]||emptyArrayTexture,s[a])}function getPureArraySetter(i){switch(i){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}class SingleUniform{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=getSingularSetter(t.type)}}class PureArrayUniform{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=getPureArraySetter(t.type)}}class StructuredUniform{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let s=0,a=r.length;s!==a;++s){const o=r[s];o.setValue(e,t[o.id],n)}}}const RePathPart=/(\w+)(\])?(\[|\.)?/g;function addUniform(i,e){i.seq.push(e),i.map[e.id]=e}function parseUniform(i,e,t){const n=i.name,r=n.length;for(RePathPart.lastIndex=0;;){const s=RePathPart.exec(n),a=RePathPart.lastIndex;let o=s[1];const l=s[2]==="]",h=s[3];if(l&&(o=o|0),h===void 0||h==="["&&a+2===r){addUniform(t,h===void 0?new SingleUniform(o,i,e):new PureArrayUniform(o,i,e));break}else{let d=t.map[o];d===void 0&&(d=new StructuredUniform(o),addUniform(t,d)),t=d}}}class WebGLUniforms{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const s=e.getActiveUniform(t,r),a=e.getUniformLocation(t,s.name);parseUniform(s,a,this)}}setValue(e,t,n,r){const s=this.map[t];s!==void 0&&s.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,s=e.length;r!==s;++r){const a=e[r];a.id in t&&n.push(a)}return n}}function WebGLShader(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const COMPLETION_STATUS_KHR=37297;let programIdCount=0;function handleSource(i,e){const t=i.split(`
|
|
3717
|
+
`}function WebGLCubeUVMaps(i){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,h=l===EquirectangularReflectionMapping||l===EquirectangularRefractionMapping,u=l===CubeReflectionMapping||l===CubeRefractionMapping;if(h||u){let p=e.get(o);const f=p!==void 0?p.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==f)return t===null&&(t=new PMREMGenerator(i)),p=h?t.fromEquirectangular(o,p):t.fromCubemap(o,p),p.texture.pmremVersion=o.pmremVersion,e.set(o,p),p.texture;if(p!==void 0)return p.texture;{const d=o.image;return h&&d&&d.height>0||u&&d&&r(d)?(t===null&&(t=new PMREMGenerator(i)),p=h?t.fromEquirectangular(o):t.fromCubemap(o),p.texture.pmremVersion=o.pmremVersion,e.set(o,p),o.addEventListener("dispose",s),p.texture):null}}}return o}function r(o){let l=0;const h=6;for(let u=0;u<h;u++)o[u]!==void 0&&l++;return l===h}function s(o){const l=o.target;l.removeEventListener("dispose",s);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function WebGLExtensions(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let r;switch(n){case"WEBGL_depth_texture":r=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=i.getExtension(n)}return e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const r=t(n);return r===null&&warnOnce("THREE.WebGLRenderer: "+n+" extension not supported."),r}}}function WebGLGeometries(i,e,t,n){const r={},s=new WeakMap;function a(p){const f=p.target;f.index!==null&&e.remove(f.index);for(const m in f.attributes)e.remove(f.attributes[m]);f.removeEventListener("dispose",a),delete r[f.id];const d=s.get(f);d&&(e.remove(d),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,t.memory.geometries--}function o(p,f){return r[f.id]===!0||(f.addEventListener("dispose",a),r[f.id]=!0,t.memory.geometries++),f}function l(p){const f=p.attributes;for(const d in f)e.update(f[d],i.ARRAY_BUFFER)}function h(p){const f=[],d=p.index,m=p.attributes.position;let g=0;if(d!==null){const x=d.array;g=d.version;for(let v=0,_=x.length;v<_;v+=3){const b=x[v+0],M=x[v+1],A=x[v+2];f.push(b,M,M,A,A,b)}}else if(m!==void 0){const x=m.array;g=m.version;for(let v=0,_=x.length/3-1;v<_;v+=3){const b=v+0,M=v+1,A=v+2;f.push(b,M,M,A,A,b)}}else return;const y=new(arrayNeedsUint32(f)?Uint32BufferAttribute:Uint16BufferAttribute)(f,1);y.version=g;const c=s.get(p);c&&e.remove(c),s.set(p,y)}function u(p){const f=s.get(p);if(f){const d=p.index;d!==null&&f.version<d.version&&h(p)}else h(p);return s.get(p)}return{get:o,update:l,getWireframeAttribute:u}}function WebGLIndexedBufferRenderer(i,e,t){let n;function r(f){n=f}let s,a;function o(f){s=f.type,a=f.bytesPerElement}function l(f,d){i.drawElements(n,d,s,f*a),t.update(d,n,1)}function h(f,d,m){m!==0&&(i.drawElementsInstanced(n,d,s,f*a,m),t.update(d,n,m))}function u(f,d,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,d,0,s,f,0,m);let y=0;for(let c=0;c<m;c++)y+=d[c];t.update(y,n,1)}function p(f,d,m,g){if(m===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let c=0;c<f.length;c++)h(f[c]/a,d[c],g[c]);else{y.multiDrawElementsInstancedWEBGL(n,d,0,s,f,0,g,0,m);let c=0;for(let x=0;x<m;x++)c+=d[x]*g[x];t.update(c,n,1)}}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=h,this.renderMultiDraw=u,this.renderMultiDrawInstances=p}function WebGLInfo(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=o*(s/3);break;case i.LINES:t.lines+=o*(s/2);break;case i.LINE_STRIP:t.lines+=o*(s-1);break;case i.LINE_LOOP:t.lines+=o*s;break;case i.POINTS:t.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function WebGLMorphtargets(i,e,t){const n=new WeakMap,r=new Vector4;function s(a,o,l){const h=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,p=u!==void 0?u.length:0;let f=n.get(o);if(f===void 0||f.count!==p){let w=function(){A.dispose(),n.delete(o),o.removeEventListener("dispose",w)};f!==void 0&&f.texture.dispose();const d=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,g=o.morphAttributes.color!==void 0,y=o.morphAttributes.position||[],c=o.morphAttributes.normal||[],x=o.morphAttributes.color||[];let v=0;d===!0&&(v=1),m===!0&&(v=2),g===!0&&(v=3);let _=o.attributes.position.count*v,b=1;_>e.maxTextureSize&&(b=Math.ceil(_/e.maxTextureSize),_=e.maxTextureSize);const M=new Float32Array(_*b*4*p),A=new DataArrayTexture(M,_,b,p);A.type=FloatType,A.needsUpdate=!0;const R=v*4;for(let P=0;P<p;P++){const N=y[P],V=c[P],G=x[P],H=_*b*4*P;for(let O=0;O<N.count;O++){const C=O*R;d===!0&&(r.fromBufferAttribute(N,O),M[H+C+0]=r.x,M[H+C+1]=r.y,M[H+C+2]=r.z,M[H+C+3]=0),m===!0&&(r.fromBufferAttribute(V,O),M[H+C+4]=r.x,M[H+C+5]=r.y,M[H+C+6]=r.z,M[H+C+7]=0),g===!0&&(r.fromBufferAttribute(G,O),M[H+C+8]=r.x,M[H+C+9]=r.y,M[H+C+10]=r.z,M[H+C+11]=G.itemSize===4?r.w:1)}}f={count:p,texture:A,size:new Vector2(_,b)},n.set(o,f),o.addEventListener("dispose",w)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(i,"morphTexture",a.morphTexture,t);else{let d=0;for(let g=0;g<h.length;g++)d+=h[g];const m=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(i,"morphTargetBaseInfluence",m),l.getUniforms().setValue(i,"morphTargetInfluences",h)}l.getUniforms().setValue(i,"morphTargetsTexture",f.texture,t),l.getUniforms().setValue(i,"morphTargetsTextureSize",f.size)}return{update:s}}function WebGLObjects(i,e,t,n){let r=new WeakMap;function s(l){const h=n.render.frame,u=l.geometry,p=e.get(l,u);if(r.get(p)!==h&&(e.update(p),r.set(p,h)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),r.get(l)!==h&&(t.update(l.instanceMatrix,i.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,i.ARRAY_BUFFER),r.set(l,h))),l.isSkinnedMesh){const f=l.skeleton;r.get(f)!==h&&(f.update(),r.set(f,h))}return p}function a(){r=new WeakMap}function o(l){const h=l.target;h.removeEventListener("dispose",o),t.remove(h.instanceMatrix),h.instanceColor!==null&&t.remove(h.instanceColor)}return{update:s,dispose:a}}const emptyTexture=new Texture,emptyShadowTexture=new DepthTexture(1,1),emptyArrayTexture=new DataArrayTexture,empty3dTexture=new Data3DTexture,emptyCubeTexture=new CubeTexture,arrayCacheF32=[],arrayCacheI32=[],mat4array=new Float32Array(16),mat3array=new Float32Array(9),mat2array=new Float32Array(4);function flatten(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let s=arrayCacheF32[r];if(s===void 0&&(s=new Float32Array(r),arrayCacheF32[r]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,i[a].toArray(s,o)}return s}function arraysEqual(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function copyArray(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function allocTexUnits(i,e){let t=arrayCacheI32[e];t===void 0&&(t=new Int32Array(e),arrayCacheI32[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function setValueV1f(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function setValueV2f(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(arraysEqual(t,e))return;i.uniform2fv(this.addr,e),copyArray(t,e)}}function setValueV3f(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(arraysEqual(t,e))return;i.uniform3fv(this.addr,e),copyArray(t,e)}}function setValueV4f(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(arraysEqual(t,e))return;i.uniform4fv(this.addr,e),copyArray(t,e)}}function setValueM2(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(arraysEqual(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),copyArray(t,e)}else{if(arraysEqual(t,n))return;mat2array.set(n),i.uniformMatrix2fv(this.addr,!1,mat2array),copyArray(t,n)}}function setValueM3(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(arraysEqual(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),copyArray(t,e)}else{if(arraysEqual(t,n))return;mat3array.set(n),i.uniformMatrix3fv(this.addr,!1,mat3array),copyArray(t,n)}}function setValueM4(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(arraysEqual(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),copyArray(t,e)}else{if(arraysEqual(t,n))return;mat4array.set(n),i.uniformMatrix4fv(this.addr,!1,mat4array),copyArray(t,n)}}function setValueV1i(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function setValueV2i(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(arraysEqual(t,e))return;i.uniform2iv(this.addr,e),copyArray(t,e)}}function setValueV3i(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(arraysEqual(t,e))return;i.uniform3iv(this.addr,e),copyArray(t,e)}}function setValueV4i(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(arraysEqual(t,e))return;i.uniform4iv(this.addr,e),copyArray(t,e)}}function setValueV1ui(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function setValueV2ui(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(arraysEqual(t,e))return;i.uniform2uiv(this.addr,e),copyArray(t,e)}}function setValueV3ui(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(arraysEqual(t,e))return;i.uniform3uiv(this.addr,e),copyArray(t,e)}}function setValueV4ui(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(arraysEqual(t,e))return;i.uniform4uiv(this.addr,e),copyArray(t,e)}}function setValueT1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r);let s;this.type===i.SAMPLER_2D_SHADOW?(emptyShadowTexture.compareFunction=LessEqualCompare,s=emptyShadowTexture):s=emptyTexture,t.setTexture2D(e||s,r)}function setValueT3D1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||empty3dTexture,r)}function setValueT6(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||emptyCubeTexture,r)}function setValueT2DArray1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||emptyArrayTexture,r)}function getSingularSetter(i){switch(i){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}function setValueV1fArray(i,e){i.uniform1fv(this.addr,e)}function setValueV2fArray(i,e){const t=flatten(e,this.size,2);i.uniform2fv(this.addr,t)}function setValueV3fArray(i,e){const t=flatten(e,this.size,3);i.uniform3fv(this.addr,t)}function setValueV4fArray(i,e){const t=flatten(e,this.size,4);i.uniform4fv(this.addr,t)}function setValueM2Array(i,e){const t=flatten(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function setValueM3Array(i,e){const t=flatten(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function setValueM4Array(i,e){const t=flatten(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function setValueV1iArray(i,e){i.uniform1iv(this.addr,e)}function setValueV2iArray(i,e){i.uniform2iv(this.addr,e)}function setValueV3iArray(i,e){i.uniform3iv(this.addr,e)}function setValueV4iArray(i,e){i.uniform4iv(this.addr,e)}function setValueV1uiArray(i,e){i.uniform1uiv(this.addr,e)}function setValueV2uiArray(i,e){i.uniform2uiv(this.addr,e)}function setValueV3uiArray(i,e){i.uniform3uiv(this.addr,e)}function setValueV4uiArray(i,e){i.uniform4uiv(this.addr,e)}function setValueT1Array(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTexture2D(e[a]||emptyTexture,s[a])}function setValueT3DArray(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTexture3D(e[a]||empty3dTexture,s[a])}function setValueT6Array(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTextureCube(e[a]||emptyCubeTexture,s[a])}function setValueT2DArrayArray(i,e,t){const n=this.cache,r=e.length,s=allocTexUnits(t,r);arraysEqual(n,s)||(i.uniform1iv(this.addr,s),copyArray(n,s));for(let a=0;a!==r;++a)t.setTexture2DArray(e[a]||emptyArrayTexture,s[a])}function getPureArraySetter(i){switch(i){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}class SingleUniform{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=getSingularSetter(t.type)}}class PureArrayUniform{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=getPureArraySetter(t.type)}}class StructuredUniform{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let s=0,a=r.length;s!==a;++s){const o=r[s];o.setValue(e,t[o.id],n)}}}const RePathPart=/(\w+)(\])?(\[|\.)?/g;function addUniform(i,e){i.seq.push(e),i.map[e.id]=e}function parseUniform(i,e,t){const n=i.name,r=n.length;for(RePathPart.lastIndex=0;;){const s=RePathPart.exec(n),a=RePathPart.lastIndex;let o=s[1];const l=s[2]==="]",h=s[3];if(l&&(o=o|0),h===void 0||h==="["&&a+2===r){addUniform(t,h===void 0?new SingleUniform(o,i,e):new PureArrayUniform(o,i,e));break}else{let p=t.map[o];p===void 0&&(p=new StructuredUniform(o),addUniform(t,p)),t=p}}}class WebGLUniforms{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const s=e.getActiveUniform(t,r),a=e.getUniformLocation(t,s.name);parseUniform(s,a,this)}}setValue(e,t,n,r){const s=this.map[t];s!==void 0&&s.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,s=e.length;r!==s;++r){const a=e[r];a.id in t&&n.push(a)}return n}}function WebGLShader(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const COMPLETION_STATUS_KHR=37297;let programIdCount=0;function handleSource(i,e){const t=i.split(`
|
|
3718
3718
|
`),n=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=r;a<s;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`
|
|
3719
3719
|
`)}const _m0=new Matrix3;function getEncodingComponents(i){ColorManagement._getMatrix(_m0,ColorManagement.workingColorSpace,i);const e=`mat3( ${_m0.elements.map(t=>t.toFixed(4))} )`;switch(ColorManagement.getTransfer(i)){case LinearTransfer:return[e,"LinearTransferOETF"];case SRGBTransfer:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function getShaderErrors(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),r=i.getShaderInfoLog(e).trim();if(n&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const a=parseInt(s[1]);return t.toUpperCase()+`
|
|
3720
3720
|
|
|
@@ -3744,17 +3744,17 @@ void main() {
|
|
|
3744
3744
|
`;return i.precision==="highp"?e+=`
|
|
3745
3745
|
#define HIGH_PRECISION`:i.precision==="mediump"?e+=`
|
|
3746
3746
|
#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
|
|
3747
|
-
#define LOW_PRECISION`),e}function generateShadowMapTypeDefine(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===PCFShadowMap?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===PCFSoftShadowMap?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===VSMShadowMap&&(e="SHADOWMAP_TYPE_VSM"),e}function generateEnvMapTypeDefine(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case CubeReflectionMapping:case CubeRefractionMapping:e="ENVMAP_TYPE_CUBE";break;case CubeUVReflectionMapping:e="ENVMAP_TYPE_CUBE_UV";break}return e}function generateEnvMapModeDefine(i){let e="ENVMAP_MODE_REFLECTION";return i.envMap&&i.envMapMode===CubeRefractionMapping&&(e="ENVMAP_MODE_REFRACTION"),e}function generateEnvMapBlendingDefine(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case MultiplyOperation:e="ENVMAP_BLENDING_MULTIPLY";break;case MixOperation:e="ENVMAP_BLENDING_MIX";break;case AddOperation:e="ENVMAP_BLENDING_ADD";break}return e}function generateCubeUVSize(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function WebGLProgram(i,e,t,n){const r=i.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=generateShadowMapTypeDefine(t),h=generateEnvMapTypeDefine(t),u=generateEnvMapModeDefine(t),
|
|
3747
|
+
#define LOW_PRECISION`),e}function generateShadowMapTypeDefine(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===PCFShadowMap?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===PCFSoftShadowMap?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===VSMShadowMap&&(e="SHADOWMAP_TYPE_VSM"),e}function generateEnvMapTypeDefine(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case CubeReflectionMapping:case CubeRefractionMapping:e="ENVMAP_TYPE_CUBE";break;case CubeUVReflectionMapping:e="ENVMAP_TYPE_CUBE_UV";break}return e}function generateEnvMapModeDefine(i){let e="ENVMAP_MODE_REFLECTION";return i.envMap&&i.envMapMode===CubeRefractionMapping&&(e="ENVMAP_MODE_REFRACTION"),e}function generateEnvMapBlendingDefine(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case MultiplyOperation:e="ENVMAP_BLENDING_MULTIPLY";break;case MixOperation:e="ENVMAP_BLENDING_MIX";break;case AddOperation:e="ENVMAP_BLENDING_ADD";break}return e}function generateCubeUVSize(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function WebGLProgram(i,e,t,n){const r=i.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=generateShadowMapTypeDefine(t),h=generateEnvMapTypeDefine(t),u=generateEnvMapModeDefine(t),p=generateEnvMapBlendingDefine(t),f=generateCubeUVSize(t),d=generateVertexExtensions(t),m=generateDefines(s),g=r.createProgram();let y,c,x=t.glslVersion?"#version "+t.glslVersion+`
|
|
3748
3748
|
`:"";t.isRawShaderMaterial?(y=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(filterEmptyLine).join(`
|
|
3749
3749
|
`),y.length>0&&(y+=`
|
|
3750
3750
|
`),c=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(filterEmptyLine).join(`
|
|
3751
3751
|
`),c.length>0&&(c+=`
|
|
3752
3752
|
`)):(y=[generatePrecision(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
3753
3753
|
`].filter(filterEmptyLine).join(`
|
|
3754
|
-
`),c=[generatePrecision(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",t.envMap?"#define "+
|
|
3754
|
+
`),c=[generatePrecision(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+u:"",t.envMap?"#define "+p:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==NoToneMapping?"#define TONE_MAPPING":"",t.toneMapping!==NoToneMapping?ShaderChunk.tonemapping_pars_fragment:"",t.toneMapping!==NoToneMapping?getToneMappingFunction("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ShaderChunk.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",t.outputColorSpace),getLuminanceFunction(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
|
|
3755
3755
|
`].filter(filterEmptyLine).join(`
|
|
3756
3756
|
`)),a=resolveIncludes(a),a=replaceLightNums(a,t),a=replaceClippingPlaneNums(a,t),o=resolveIncludes(o),o=replaceLightNums(o,t),o=replaceClippingPlaneNums(o,t),a=unrollLoops(a),o=unrollLoops(o),t.isRawShaderMaterial!==!0&&(x=`#version 300 es
|
|
3757
|
-
`,y=[
|
|
3757
|
+
`,y=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3758
3758
|
`)+`
|
|
3759
3759
|
`+y,c=["#define varying in",t.glslVersion===GLSL3?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===GLSL3?"":"#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(`
|
|
3760
3760
|
`)+`
|
|
@@ -3765,7 +3765,7 @@ Material Type: `+N.type+`
|
|
|
3765
3765
|
|
|
3766
3766
|
Program Info Log: `+V+`
|
|
3767
3767
|
`+L+`
|
|
3768
|
-
`+E)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(G===""||H==="")&&(C=!1);C&&(N.diagnostics={runnable:O,programLog:V,vertexShader:{log:G,prefix:y},fragmentShader:{log:H,prefix:c}})}r.deleteShader(b),r.deleteShader(M),R=new WebGLUniforms(r,g),w=fetchAttributeLocations(r,g)}let R;this.getUniforms=function(){return R===void 0&&A(this),R};let w;this.getAttributes=function(){return w===void 0&&A(this),w};let P=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=r.getProgramParameter(g,COMPLETION_STATUS_KHR)),P},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=programIdCount++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=b,this.fragmentShader=M,this}let _id=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new WebGLShaderStage(e),t.set(e,n)),n}}class WebGLShaderStage{constructor(e){this.id=_id++,this.code=e,this.usedTimes=0}}function WebGLPrograms(i,e,t,n,r,s,a){const o=new Layers,l=new WebGLShaderCache,h=new Set,u=[],d=r.logarithmicDepthBuffer,f=r.vertexTextures;let p=r.precision;const m={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"};function g(w){return h.add(w),w===0?"uv":`uv${w}`}function y(w,P,N,V,G){const H=V.fog,O=G.geometry,C=w.isMeshStandardMaterial?V.environment:null,L=(w.isMeshStandardMaterial?t:e).get(w.envMap||C),E=L&&L.mapping===CubeUVReflectionMapping?L.image.height:null,T=m[w.type];w.precision!==null&&(p=r.getMaxPrecision(w.precision),p!==w.precision&&console.warn("THREE.WebGLProgram.getParameters:",w.precision,"not supported, using",p,"instead."));const k=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,B=k!==void 0?k.length:0;let ee=0;O.morphAttributes.position!==void 0&&(ee=1),O.morphAttributes.normal!==void 0&&(ee=2),O.morphAttributes.color!==void 0&&(ee=3);let oe,X,Q,ne;if(T){const We=ShaderLib[T];oe=We.vertexShader,X=We.fragmentShader}else oe=w.vertexShader,X=w.fragmentShader,l.update(w),Q=l.getVertexShaderID(w),ne=l.getFragmentShaderID(w);const re=i.getRenderTarget(),me=i.state.buffers.depth.getReversed(),Fe=G.isInstancedMesh===!0,Ee=G.isBatchedMesh===!0,Ne=!!w.map,Be=!!w.matcap,_e=!!L,U=!!w.aoMap,qe=!!w.lightMap,Le=!!w.bumpMap,Ie=!!w.normalMap,ge=!!w.displacementMap,ke=!!w.emissiveMap,ve=!!w.metalnessMap,D=!!w.roughnessMap,I=w.anisotropy>0,q=w.clearcoat>0,J=w.dispersion>0,te=w.iridescence>0,K=w.sheen>0,de=w.transmission>0,le=I&&!!w.anisotropyMap,Me=q&&!!w.clearcoatMap,be=q&&!!w.clearcoatNormalMap,se=q&&!!w.clearcoatRoughnessMap,ye=te&&!!w.iridescenceMap,Ce=te&&!!w.iridescenceThicknessMap,Pe=K&&!!w.sheenColorMap,xe=K&&!!w.sheenRoughnessMap,Ve=!!w.specularMap,Ue=!!w.specularColorMap,$e=!!w.specularIntensityMap,z=de&&!!w.transmissionMap,ce=de&&!!w.thicknessMap,Z=!!w.gradientMap,ie=!!w.alphaMap,ue=w.alphaTest>0,fe=!!w.alphaHash,De=!!w.extensions;let Ye=NoToneMapping;w.toneMapped&&(re===null||re.isXRRenderTarget===!0)&&(Ye=i.toneMapping);const Je={shaderID:T,shaderType:w.type,shaderName:w.name,vertexShader:oe,fragmentShader:X,defines:w.defines,customVertexShaderID:Q,customFragmentShaderID:ne,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:p,batching:Ee,batchingColor:Ee&&G._colorsTexture!==null,instancing:Fe,instancingColor:Fe&&G.instanceColor!==null,instancingMorph:Fe&&G.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:re===null?i.outputColorSpace:re.isXRRenderTarget===!0?re.texture.colorSpace:LinearSRGBColorSpace,alphaToCoverage:!!w.alphaToCoverage,map:Ne,matcap:Be,envMap:_e,envMapMode:_e&&L.mapping,envMapCubeUVHeight:E,aoMap:U,lightMap:qe,bumpMap:Le,normalMap:Ie,displacementMap:f&&ge,emissiveMap:ke,normalMapObjectSpace:Ie&&w.normalMapType===ObjectSpaceNormalMap,normalMapTangentSpace:Ie&&w.normalMapType===TangentSpaceNormalMap,metalnessMap:ve,roughnessMap:D,anisotropy:I,anisotropyMap:le,clearcoat:q,clearcoatMap:Me,clearcoatNormalMap:be,clearcoatRoughnessMap:se,dispersion:J,iridescence:te,iridescenceMap:ye,iridescenceThicknessMap:Ce,sheen:K,sheenColorMap:Pe,sheenRoughnessMap:xe,specularMap:Ve,specularColorMap:Ue,specularIntensityMap:$e,transmission:de,transmissionMap:z,thicknessMap:ce,gradientMap:Z,opaque:w.transparent===!1&&w.blending===NormalBlending&&w.alphaToCoverage===!1,alphaMap:ie,alphaTest:ue,alphaHash:fe,combine:w.combine,mapUv:Ne&&g(w.map.channel),aoMapUv:U&&g(w.aoMap.channel),lightMapUv:qe&&g(w.lightMap.channel),bumpMapUv:Le&&g(w.bumpMap.channel),normalMapUv:Ie&&g(w.normalMap.channel),displacementMapUv:ge&&g(w.displacementMap.channel),emissiveMapUv:ke&&g(w.emissiveMap.channel),metalnessMapUv:ve&&g(w.metalnessMap.channel),roughnessMapUv:D&&g(w.roughnessMap.channel),anisotropyMapUv:le&&g(w.anisotropyMap.channel),clearcoatMapUv:Me&&g(w.clearcoatMap.channel),clearcoatNormalMapUv:be&&g(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:se&&g(w.clearcoatRoughnessMap.channel),iridescenceMapUv:ye&&g(w.iridescenceMap.channel),iridescenceThicknessMapUv:Ce&&g(w.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&g(w.sheenColorMap.channel),sheenRoughnessMapUv:xe&&g(w.sheenRoughnessMap.channel),specularMapUv:Ve&&g(w.specularMap.channel),specularColorMapUv:Ue&&g(w.specularColorMap.channel),specularIntensityMapUv:$e&&g(w.specularIntensityMap.channel),transmissionMapUv:z&&g(w.transmissionMap.channel),thicknessMapUv:ce&&g(w.thicknessMap.channel),alphaMapUv:ie&&g(w.alphaMap.channel),vertexTangents:!!O.attributes.tangent&&(Ie||I),vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!O.attributes.uv&&(Ne||ie),fog:!!H,useFog:w.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:w.flatShading===!0,sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:me,skinning:G.isSkinnedMesh===!0,morphTargets:O.morphAttributes.position!==void 0,morphNormals:O.morphAttributes.normal!==void 0,morphColors:O.morphAttributes.color!==void 0,morphTargetsCount:B,morphTextureStride:ee,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:w.dithering,shadowMapEnabled:i.shadowMap.enabled&&N.length>0,shadowMapType:i.shadowMap.type,toneMapping:Ye,decodeVideoTexture:Ne&&w.map.isVideoTexture===!0&&ColorManagement.getTransfer(w.map.colorSpace)===SRGBTransfer,decodeVideoTextureEmissive:ke&&w.emissiveMap.isVideoTexture===!0&&ColorManagement.getTransfer(w.emissiveMap.colorSpace)===SRGBTransfer,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===DoubleSide,flipSided:w.side===BackSide,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionClipCullDistance:De&&w.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(De&&w.extensions.multiDraw===!0||Ee)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return Je.vertexUv1s=h.has(1),Je.vertexUv2s=h.has(2),Je.vertexUv3s=h.has(3),h.clear(),Je}function c(w){const P=[];if(w.shaderID?P.push(w.shaderID):(P.push(w.customVertexShaderID),P.push(w.customFragmentShaderID)),w.defines!==void 0)for(const N in w.defines)P.push(N),P.push(w.defines[N]);return w.isRawShaderMaterial===!1&&(x(P,w),v(P,w),P.push(i.outputColorSpace)),P.push(w.customProgramCacheKey),P.join()}function x(w,P){w.push(P.precision),w.push(P.outputColorSpace),w.push(P.envMapMode),w.push(P.envMapCubeUVHeight),w.push(P.mapUv),w.push(P.alphaMapUv),w.push(P.lightMapUv),w.push(P.aoMapUv),w.push(P.bumpMapUv),w.push(P.normalMapUv),w.push(P.displacementMapUv),w.push(P.emissiveMapUv),w.push(P.metalnessMapUv),w.push(P.roughnessMapUv),w.push(P.anisotropyMapUv),w.push(P.clearcoatMapUv),w.push(P.clearcoatNormalMapUv),w.push(P.clearcoatRoughnessMapUv),w.push(P.iridescenceMapUv),w.push(P.iridescenceThicknessMapUv),w.push(P.sheenColorMapUv),w.push(P.sheenRoughnessMapUv),w.push(P.specularMapUv),w.push(P.specularColorMapUv),w.push(P.specularIntensityMapUv),w.push(P.transmissionMapUv),w.push(P.thicknessMapUv),w.push(P.combine),w.push(P.fogExp2),w.push(P.sizeAttenuation),w.push(P.morphTargetsCount),w.push(P.morphAttributeCount),w.push(P.numDirLights),w.push(P.numPointLights),w.push(P.numSpotLights),w.push(P.numSpotLightMaps),w.push(P.numHemiLights),w.push(P.numRectAreaLights),w.push(P.numDirLightShadows),w.push(P.numPointLightShadows),w.push(P.numSpotLightShadows),w.push(P.numSpotLightShadowsWithMaps),w.push(P.numLightProbes),w.push(P.shadowMapType),w.push(P.toneMapping),w.push(P.numClippingPlanes),w.push(P.numClipIntersection),w.push(P.depthPacking)}function v(w,P){o.disableAll(),P.supportsVertexTextures&&o.enable(0),P.instancing&&o.enable(1),P.instancingColor&&o.enable(2),P.instancingMorph&&o.enable(3),P.matcap&&o.enable(4),P.envMap&&o.enable(5),P.normalMapObjectSpace&&o.enable(6),P.normalMapTangentSpace&&o.enable(7),P.clearcoat&&o.enable(8),P.iridescence&&o.enable(9),P.alphaTest&&o.enable(10),P.vertexColors&&o.enable(11),P.vertexAlphas&&o.enable(12),P.vertexUv1s&&o.enable(13),P.vertexUv2s&&o.enable(14),P.vertexUv3s&&o.enable(15),P.vertexTangents&&o.enable(16),P.anisotropy&&o.enable(17),P.alphaHash&&o.enable(18),P.batching&&o.enable(19),P.dispersion&&o.enable(20),P.batchingColor&&o.enable(21),w.push(o.mask),o.disableAll(),P.fog&&o.enable(0),P.useFog&&o.enable(1),P.flatShading&&o.enable(2),P.logarithmicDepthBuffer&&o.enable(3),P.reverseDepthBuffer&&o.enable(4),P.skinning&&o.enable(5),P.morphTargets&&o.enable(6),P.morphNormals&&o.enable(7),P.morphColors&&o.enable(8),P.premultipliedAlpha&&o.enable(9),P.shadowMapEnabled&&o.enable(10),P.doubleSided&&o.enable(11),P.flipSided&&o.enable(12),P.useDepthPacking&&o.enable(13),P.dithering&&o.enable(14),P.transmission&&o.enable(15),P.sheen&&o.enable(16),P.opaque&&o.enable(17),P.pointsUvs&&o.enable(18),P.decodeVideoTexture&&o.enable(19),P.decodeVideoTextureEmissive&&o.enable(20),P.alphaToCoverage&&o.enable(21),w.push(o.mask)}function _(w){const P=m[w.type];let N;if(P){const V=ShaderLib[P];N=UniformsUtils.clone(V.uniforms)}else N=w.uniforms;return N}function b(w,P){let N;for(let V=0,G=u.length;V<G;V++){const H=u[V];if(H.cacheKey===P){N=H,++N.usedTimes;break}}return N===void 0&&(N=new WebGLProgram(i,P,w,s),u.push(N)),N}function M(w){if(--w.usedTimes===0){const P=u.indexOf(w);u[P]=u[u.length-1],u.pop(),w.destroy()}}function A(w){l.remove(w)}function R(){l.dispose()}return{getParameters:y,getProgramCacheKey:c,getUniforms:_,acquireProgram:b,releaseProgram:M,releaseShaderCache:A,programs:u,dispose:R}}function WebGLProperties(){let i=new WeakMap;function e(a){return i.has(a)}function t(a){let o=i.get(a);return o===void 0&&(o={},i.set(a,o)),o}function n(a){i.delete(a)}function r(a,o,l){i.get(a)[o]=l}function s(){i=new WeakMap}return{has:e,get:t,remove:n,update:r,dispose:s}}function painterSortStable(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function reversePainterSortStable(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function WebGLRenderList(){const i=[];let e=0;const t=[],n=[],r=[];function s(){e=0,t.length=0,n.length=0,r.length=0}function a(d,f,p,m,g,y){let c=i[e];return c===void 0?(c={id:d.id,object:d,geometry:f,material:p,groupOrder:m,renderOrder:d.renderOrder,z:g,group:y},i[e]=c):(c.id=d.id,c.object=d,c.geometry=f,c.material=p,c.groupOrder=m,c.renderOrder=d.renderOrder,c.z=g,c.group=y),e++,c}function o(d,f,p,m,g,y){const c=a(d,f,p,m,g,y);p.transmission>0?n.push(c):p.transparent===!0?r.push(c):t.push(c)}function l(d,f,p,m,g,y){const c=a(d,f,p,m,g,y);p.transmission>0?n.unshift(c):p.transparent===!0?r.unshift(c):t.unshift(c)}function h(d,f){t.length>1&&t.sort(d||painterSortStable),n.length>1&&n.sort(f||reversePainterSortStable),r.length>1&&r.sort(f||reversePainterSortStable)}function u(){for(let d=e,f=i.length;d<f;d++){const p=i[d];if(p.id===null)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}}return{opaque:t,transmissive:n,transparent:r,init:s,push:o,unshift:l,finish:u,sort:h}}function WebGLRenderLists(){let i=new WeakMap;function e(n,r){const s=i.get(n);let a;return s===void 0?(a=new WebGLRenderList,i.set(n,[a])):r>=s.length?(a=new WebGLRenderList,s.push(a)):a=s[r],a}function t(){i=new WeakMap}return{get:e,dispose:t}}function UniformsCache(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Vector3,color:new Color};break;case"SpotLight":t={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":t={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3};break}return i[e.id]=t,t}}}function ShadowUniformsCache(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let nextVersion=0;function shadowCastingAndTexturingLightsFirst(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function WebGLLights(i){const e=new UniformsCache,t=ShadowUniformsCache(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)n.probe.push(new Vector3);const r=new Vector3,s=new Matrix4,a=new Matrix4;function o(h){let u=0,d=0,f=0;for(let w=0;w<9;w++)n.probe[w].set(0,0,0);let p=0,m=0,g=0,y=0,c=0,x=0,v=0,_=0,b=0,M=0,A=0;h.sort(shadowCastingAndTexturingLightsFirst);for(let w=0,P=h.length;w<P;w++){const N=h[w],V=N.color,G=N.intensity,H=N.distance,O=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)u+=V.r*G,d+=V.g*G,f+=V.b*G;else if(N.isLightProbe){for(let C=0;C<9;C++)n.probe[C].addScaledVector(N.sh.coefficients[C],G);A++}else if(N.isDirectionalLight){const C=e.get(N);if(C.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const L=N.shadow,E=t.get(N);E.shadowIntensity=L.intensity,E.shadowBias=L.bias,E.shadowNormalBias=L.normalBias,E.shadowRadius=L.radius,E.shadowMapSize=L.mapSize,n.directionalShadow[p]=E,n.directionalShadowMap[p]=O,n.directionalShadowMatrix[p]=N.shadow.matrix,x++}n.directional[p]=C,p++}else if(N.isSpotLight){const C=e.get(N);C.position.setFromMatrixPosition(N.matrixWorld),C.color.copy(V).multiplyScalar(G),C.distance=H,C.coneCos=Math.cos(N.angle),C.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),C.decay=N.decay,n.spot[g]=C;const L=N.shadow;if(N.map&&(n.spotLightMap[b]=N.map,b++,L.updateMatrices(N),N.castShadow&&M++),n.spotLightMatrix[g]=L.matrix,N.castShadow){const E=t.get(N);E.shadowIntensity=L.intensity,E.shadowBias=L.bias,E.shadowNormalBias=L.normalBias,E.shadowRadius=L.radius,E.shadowMapSize=L.mapSize,n.spotShadow[g]=E,n.spotShadowMap[g]=O,_++}g++}else if(N.isRectAreaLight){const C=e.get(N);C.color.copy(V).multiplyScalar(G),C.halfWidth.set(N.width*.5,0,0),C.halfHeight.set(0,N.height*.5,0),n.rectArea[y]=C,y++}else if(N.isPointLight){const C=e.get(N);if(C.color.copy(N.color).multiplyScalar(N.intensity),C.distance=N.distance,C.decay=N.decay,N.castShadow){const L=N.shadow,E=t.get(N);E.shadowIntensity=L.intensity,E.shadowBias=L.bias,E.shadowNormalBias=L.normalBias,E.shadowRadius=L.radius,E.shadowMapSize=L.mapSize,E.shadowCameraNear=L.camera.near,E.shadowCameraFar=L.camera.far,n.pointShadow[m]=E,n.pointShadowMap[m]=O,n.pointShadowMatrix[m]=N.shadow.matrix,v++}n.point[m]=C,m++}else if(N.isHemisphereLight){const C=e.get(N);C.skyColor.copy(N.color).multiplyScalar(G),C.groundColor.copy(N.groundColor).multiplyScalar(G),n.hemi[c]=C,c++}}y>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,n.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):(n.rectAreaLTC1=UniformsLib.LTC_HALF_1,n.rectAreaLTC2=UniformsLib.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=d,n.ambient[2]=f;const R=n.hash;(R.directionalLength!==p||R.pointLength!==m||R.spotLength!==g||R.rectAreaLength!==y||R.hemiLength!==c||R.numDirectionalShadows!==x||R.numPointShadows!==v||R.numSpotShadows!==_||R.numSpotMaps!==b||R.numLightProbes!==A)&&(n.directional.length=p,n.spot.length=g,n.rectArea.length=y,n.point.length=m,n.hemi.length=c,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=v,n.pointShadowMap.length=v,n.spotShadow.length=_,n.spotShadowMap.length=_,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=v,n.spotLightMatrix.length=_+b-M,n.spotLightMap.length=b,n.numSpotLightShadowsWithMaps=M,n.numLightProbes=A,R.directionalLength=p,R.pointLength=m,R.spotLength=g,R.rectAreaLength=y,R.hemiLength=c,R.numDirectionalShadows=x,R.numPointShadows=v,R.numSpotShadows=_,R.numSpotMaps=b,R.numLightProbes=A,n.version=nextVersion++)}function l(h,u){let d=0,f=0,p=0,m=0,g=0;const y=u.matrixWorldInverse;for(let c=0,x=h.length;c<x;c++){const v=h[c];if(v.isDirectionalLight){const _=n.directional[d];_.direction.setFromMatrixPosition(v.matrixWorld),r.setFromMatrixPosition(v.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(y),d++}else if(v.isSpotLight){const _=n.spot[p];_.position.setFromMatrixPosition(v.matrixWorld),_.position.applyMatrix4(y),_.direction.setFromMatrixPosition(v.matrixWorld),r.setFromMatrixPosition(v.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(y),p++}else if(v.isRectAreaLight){const _=n.rectArea[m];_.position.setFromMatrixPosition(v.matrixWorld),_.position.applyMatrix4(y),a.identity(),s.copy(v.matrixWorld),s.premultiply(y),a.extractRotation(s),_.halfWidth.set(v.width*.5,0,0),_.halfHeight.set(0,v.height*.5,0),_.halfWidth.applyMatrix4(a),_.halfHeight.applyMatrix4(a),m++}else if(v.isPointLight){const _=n.point[f];_.position.setFromMatrixPosition(v.matrixWorld),_.position.applyMatrix4(y),f++}else if(v.isHemisphereLight){const _=n.hemi[g];_.direction.setFromMatrixPosition(v.matrixWorld),_.direction.transformDirection(y),g++}}}return{setup:o,setupView:l,state:n}}function WebGLRenderState(i){const e=new WebGLLights(i),t=[],n=[];function r(u){h.camera=u,t.length=0,n.length=0}function s(u){t.push(u)}function a(u){n.push(u)}function o(){e.setup(t)}function l(u){e.setupView(t,u)}const h={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:h,setupLights:o,setupLightsView:l,pushLight:s,pushShadow:a}}function WebGLRenderStates(i){let e=new WeakMap;function t(r,s=0){const a=e.get(r);let o;return a===void 0?(o=new WebGLRenderState(i),e.set(r,[o])):s>=a.length?(o=new WebGLRenderState(i),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const vertex=`void main() {
|
|
3768
|
+
`+E)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(G===""||H==="")&&(C=!1);C&&(N.diagnostics={runnable:O,programLog:V,vertexShader:{log:G,prefix:y},fragmentShader:{log:H,prefix:c}})}r.deleteShader(b),r.deleteShader(M),R=new WebGLUniforms(r,g),w=fetchAttributeLocations(r,g)}let R;this.getUniforms=function(){return R===void 0&&A(this),R};let w;this.getAttributes=function(){return w===void 0&&A(this),w};let P=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=r.getProgramParameter(g,COMPLETION_STATUS_KHR)),P},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(g),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=programIdCount++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=b,this.fragmentShader=M,this}let _id=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new WebGLShaderStage(e),t.set(e,n)),n}}class WebGLShaderStage{constructor(e){this.id=_id++,this.code=e,this.usedTimes=0}}function WebGLPrograms(i,e,t,n,r,s,a){const o=new Layers,l=new WebGLShaderCache,h=new Set,u=[],p=r.logarithmicDepthBuffer,f=r.vertexTextures;let d=r.precision;const m={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"};function g(w){return h.add(w),w===0?"uv":`uv${w}`}function y(w,P,N,V,G){const H=V.fog,O=G.geometry,C=w.isMeshStandardMaterial?V.environment:null,L=(w.isMeshStandardMaterial?t:e).get(w.envMap||C),E=L&&L.mapping===CubeUVReflectionMapping?L.image.height:null,T=m[w.type];w.precision!==null&&(d=r.getMaxPrecision(w.precision),d!==w.precision&&console.warn("THREE.WebGLProgram.getParameters:",w.precision,"not supported, using",d,"instead."));const k=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,B=k!==void 0?k.length:0;let ee=0;O.morphAttributes.position!==void 0&&(ee=1),O.morphAttributes.normal!==void 0&&(ee=2),O.morphAttributes.color!==void 0&&(ee=3);let oe,X,Q,ne;if(T){const We=ShaderLib[T];oe=We.vertexShader,X=We.fragmentShader}else oe=w.vertexShader,X=w.fragmentShader,l.update(w),Q=l.getVertexShaderID(w),ne=l.getFragmentShaderID(w);const re=i.getRenderTarget(),me=i.state.buffers.depth.getReversed(),Fe=G.isInstancedMesh===!0,Ee=G.isBatchedMesh===!0,Ne=!!w.map,Be=!!w.matcap,_e=!!L,U=!!w.aoMap,qe=!!w.lightMap,Le=!!w.bumpMap,Ie=!!w.normalMap,ge=!!w.displacementMap,ke=!!w.emissiveMap,ve=!!w.metalnessMap,D=!!w.roughnessMap,I=w.anisotropy>0,q=w.clearcoat>0,J=w.dispersion>0,te=w.iridescence>0,K=w.sheen>0,de=w.transmission>0,le=I&&!!w.anisotropyMap,Me=q&&!!w.clearcoatMap,be=q&&!!w.clearcoatNormalMap,se=q&&!!w.clearcoatRoughnessMap,ye=te&&!!w.iridescenceMap,Ce=te&&!!w.iridescenceThicknessMap,Pe=K&&!!w.sheenColorMap,xe=K&&!!w.sheenRoughnessMap,Ve=!!w.specularMap,Ue=!!w.specularColorMap,$e=!!w.specularIntensityMap,z=de&&!!w.transmissionMap,ce=de&&!!w.thicknessMap,Z=!!w.gradientMap,ie=!!w.alphaMap,ue=w.alphaTest>0,fe=!!w.alphaHash,De=!!w.extensions;let Ye=NoToneMapping;w.toneMapped&&(re===null||re.isXRRenderTarget===!0)&&(Ye=i.toneMapping);const Je={shaderID:T,shaderType:w.type,shaderName:w.name,vertexShader:oe,fragmentShader:X,defines:w.defines,customVertexShaderID:Q,customFragmentShaderID:ne,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:d,batching:Ee,batchingColor:Ee&&G._colorsTexture!==null,instancing:Fe,instancingColor:Fe&&G.instanceColor!==null,instancingMorph:Fe&&G.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:re===null?i.outputColorSpace:re.isXRRenderTarget===!0?re.texture.colorSpace:LinearSRGBColorSpace,alphaToCoverage:!!w.alphaToCoverage,map:Ne,matcap:Be,envMap:_e,envMapMode:_e&&L.mapping,envMapCubeUVHeight:E,aoMap:U,lightMap:qe,bumpMap:Le,normalMap:Ie,displacementMap:f&&ge,emissiveMap:ke,normalMapObjectSpace:Ie&&w.normalMapType===ObjectSpaceNormalMap,normalMapTangentSpace:Ie&&w.normalMapType===TangentSpaceNormalMap,metalnessMap:ve,roughnessMap:D,anisotropy:I,anisotropyMap:le,clearcoat:q,clearcoatMap:Me,clearcoatNormalMap:be,clearcoatRoughnessMap:se,dispersion:J,iridescence:te,iridescenceMap:ye,iridescenceThicknessMap:Ce,sheen:K,sheenColorMap:Pe,sheenRoughnessMap:xe,specularMap:Ve,specularColorMap:Ue,specularIntensityMap:$e,transmission:de,transmissionMap:z,thicknessMap:ce,gradientMap:Z,opaque:w.transparent===!1&&w.blending===NormalBlending&&w.alphaToCoverage===!1,alphaMap:ie,alphaTest:ue,alphaHash:fe,combine:w.combine,mapUv:Ne&&g(w.map.channel),aoMapUv:U&&g(w.aoMap.channel),lightMapUv:qe&&g(w.lightMap.channel),bumpMapUv:Le&&g(w.bumpMap.channel),normalMapUv:Ie&&g(w.normalMap.channel),displacementMapUv:ge&&g(w.displacementMap.channel),emissiveMapUv:ke&&g(w.emissiveMap.channel),metalnessMapUv:ve&&g(w.metalnessMap.channel),roughnessMapUv:D&&g(w.roughnessMap.channel),anisotropyMapUv:le&&g(w.anisotropyMap.channel),clearcoatMapUv:Me&&g(w.clearcoatMap.channel),clearcoatNormalMapUv:be&&g(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:se&&g(w.clearcoatRoughnessMap.channel),iridescenceMapUv:ye&&g(w.iridescenceMap.channel),iridescenceThicknessMapUv:Ce&&g(w.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&g(w.sheenColorMap.channel),sheenRoughnessMapUv:xe&&g(w.sheenRoughnessMap.channel),specularMapUv:Ve&&g(w.specularMap.channel),specularColorMapUv:Ue&&g(w.specularColorMap.channel),specularIntensityMapUv:$e&&g(w.specularIntensityMap.channel),transmissionMapUv:z&&g(w.transmissionMap.channel),thicknessMapUv:ce&&g(w.thicknessMap.channel),alphaMapUv:ie&&g(w.alphaMap.channel),vertexTangents:!!O.attributes.tangent&&(Ie||I),vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!O.attributes.uv&&(Ne||ie),fog:!!H,useFog:w.fog===!0,fogExp2:!!H&&H.isFogExp2,flatShading:w.flatShading===!0,sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:p,reverseDepthBuffer:me,skinning:G.isSkinnedMesh===!0,morphTargets:O.morphAttributes.position!==void 0,morphNormals:O.morphAttributes.normal!==void 0,morphColors:O.morphAttributes.color!==void 0,morphTargetsCount:B,morphTextureStride:ee,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:w.dithering,shadowMapEnabled:i.shadowMap.enabled&&N.length>0,shadowMapType:i.shadowMap.type,toneMapping:Ye,decodeVideoTexture:Ne&&w.map.isVideoTexture===!0&&ColorManagement.getTransfer(w.map.colorSpace)===SRGBTransfer,decodeVideoTextureEmissive:ke&&w.emissiveMap.isVideoTexture===!0&&ColorManagement.getTransfer(w.emissiveMap.colorSpace)===SRGBTransfer,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===DoubleSide,flipSided:w.side===BackSide,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionClipCullDistance:De&&w.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(De&&w.extensions.multiDraw===!0||Ee)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return Je.vertexUv1s=h.has(1),Je.vertexUv2s=h.has(2),Je.vertexUv3s=h.has(3),h.clear(),Je}function c(w){const P=[];if(w.shaderID?P.push(w.shaderID):(P.push(w.customVertexShaderID),P.push(w.customFragmentShaderID)),w.defines!==void 0)for(const N in w.defines)P.push(N),P.push(w.defines[N]);return w.isRawShaderMaterial===!1&&(x(P,w),v(P,w),P.push(i.outputColorSpace)),P.push(w.customProgramCacheKey),P.join()}function x(w,P){w.push(P.precision),w.push(P.outputColorSpace),w.push(P.envMapMode),w.push(P.envMapCubeUVHeight),w.push(P.mapUv),w.push(P.alphaMapUv),w.push(P.lightMapUv),w.push(P.aoMapUv),w.push(P.bumpMapUv),w.push(P.normalMapUv),w.push(P.displacementMapUv),w.push(P.emissiveMapUv),w.push(P.metalnessMapUv),w.push(P.roughnessMapUv),w.push(P.anisotropyMapUv),w.push(P.clearcoatMapUv),w.push(P.clearcoatNormalMapUv),w.push(P.clearcoatRoughnessMapUv),w.push(P.iridescenceMapUv),w.push(P.iridescenceThicknessMapUv),w.push(P.sheenColorMapUv),w.push(P.sheenRoughnessMapUv),w.push(P.specularMapUv),w.push(P.specularColorMapUv),w.push(P.specularIntensityMapUv),w.push(P.transmissionMapUv),w.push(P.thicknessMapUv),w.push(P.combine),w.push(P.fogExp2),w.push(P.sizeAttenuation),w.push(P.morphTargetsCount),w.push(P.morphAttributeCount),w.push(P.numDirLights),w.push(P.numPointLights),w.push(P.numSpotLights),w.push(P.numSpotLightMaps),w.push(P.numHemiLights),w.push(P.numRectAreaLights),w.push(P.numDirLightShadows),w.push(P.numPointLightShadows),w.push(P.numSpotLightShadows),w.push(P.numSpotLightShadowsWithMaps),w.push(P.numLightProbes),w.push(P.shadowMapType),w.push(P.toneMapping),w.push(P.numClippingPlanes),w.push(P.numClipIntersection),w.push(P.depthPacking)}function v(w,P){o.disableAll(),P.supportsVertexTextures&&o.enable(0),P.instancing&&o.enable(1),P.instancingColor&&o.enable(2),P.instancingMorph&&o.enable(3),P.matcap&&o.enable(4),P.envMap&&o.enable(5),P.normalMapObjectSpace&&o.enable(6),P.normalMapTangentSpace&&o.enable(7),P.clearcoat&&o.enable(8),P.iridescence&&o.enable(9),P.alphaTest&&o.enable(10),P.vertexColors&&o.enable(11),P.vertexAlphas&&o.enable(12),P.vertexUv1s&&o.enable(13),P.vertexUv2s&&o.enable(14),P.vertexUv3s&&o.enable(15),P.vertexTangents&&o.enable(16),P.anisotropy&&o.enable(17),P.alphaHash&&o.enable(18),P.batching&&o.enable(19),P.dispersion&&o.enable(20),P.batchingColor&&o.enable(21),w.push(o.mask),o.disableAll(),P.fog&&o.enable(0),P.useFog&&o.enable(1),P.flatShading&&o.enable(2),P.logarithmicDepthBuffer&&o.enable(3),P.reverseDepthBuffer&&o.enable(4),P.skinning&&o.enable(5),P.morphTargets&&o.enable(6),P.morphNormals&&o.enable(7),P.morphColors&&o.enable(8),P.premultipliedAlpha&&o.enable(9),P.shadowMapEnabled&&o.enable(10),P.doubleSided&&o.enable(11),P.flipSided&&o.enable(12),P.useDepthPacking&&o.enable(13),P.dithering&&o.enable(14),P.transmission&&o.enable(15),P.sheen&&o.enable(16),P.opaque&&o.enable(17),P.pointsUvs&&o.enable(18),P.decodeVideoTexture&&o.enable(19),P.decodeVideoTextureEmissive&&o.enable(20),P.alphaToCoverage&&o.enable(21),w.push(o.mask)}function _(w){const P=m[w.type];let N;if(P){const V=ShaderLib[P];N=UniformsUtils.clone(V.uniforms)}else N=w.uniforms;return N}function b(w,P){let N;for(let V=0,G=u.length;V<G;V++){const H=u[V];if(H.cacheKey===P){N=H,++N.usedTimes;break}}return N===void 0&&(N=new WebGLProgram(i,P,w,s),u.push(N)),N}function M(w){if(--w.usedTimes===0){const P=u.indexOf(w);u[P]=u[u.length-1],u.pop(),w.destroy()}}function A(w){l.remove(w)}function R(){l.dispose()}return{getParameters:y,getProgramCacheKey:c,getUniforms:_,acquireProgram:b,releaseProgram:M,releaseShaderCache:A,programs:u,dispose:R}}function WebGLProperties(){let i=new WeakMap;function e(a){return i.has(a)}function t(a){let o=i.get(a);return o===void 0&&(o={},i.set(a,o)),o}function n(a){i.delete(a)}function r(a,o,l){i.get(a)[o]=l}function s(){i=new WeakMap}return{has:e,get:t,remove:n,update:r,dispose:s}}function painterSortStable(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function reversePainterSortStable(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function WebGLRenderList(){const i=[];let e=0;const t=[],n=[],r=[];function s(){e=0,t.length=0,n.length=0,r.length=0}function a(p,f,d,m,g,y){let c=i[e];return c===void 0?(c={id:p.id,object:p,geometry:f,material:d,groupOrder:m,renderOrder:p.renderOrder,z:g,group:y},i[e]=c):(c.id=p.id,c.object=p,c.geometry=f,c.material=d,c.groupOrder=m,c.renderOrder=p.renderOrder,c.z=g,c.group=y),e++,c}function o(p,f,d,m,g,y){const c=a(p,f,d,m,g,y);d.transmission>0?n.push(c):d.transparent===!0?r.push(c):t.push(c)}function l(p,f,d,m,g,y){const c=a(p,f,d,m,g,y);d.transmission>0?n.unshift(c):d.transparent===!0?r.unshift(c):t.unshift(c)}function h(p,f){t.length>1&&t.sort(p||painterSortStable),n.length>1&&n.sort(f||reversePainterSortStable),r.length>1&&r.sort(f||reversePainterSortStable)}function u(){for(let p=e,f=i.length;p<f;p++){const d=i[p];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:t,transmissive:n,transparent:r,init:s,push:o,unshift:l,finish:u,sort:h}}function WebGLRenderLists(){let i=new WeakMap;function e(n,r){const s=i.get(n);let a;return s===void 0?(a=new WebGLRenderList,i.set(n,[a])):r>=s.length?(a=new WebGLRenderList,s.push(a)):a=s[r],a}function t(){i=new WeakMap}return{get:e,dispose:t}}function UniformsCache(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Vector3,color:new Color};break;case"SpotLight":t={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":t={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3};break}return i[e.id]=t,t}}}function ShadowUniformsCache(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let nextVersion=0;function shadowCastingAndTexturingLightsFirst(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function WebGLLights(i){const e=new UniformsCache,t=ShadowUniformsCache(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)n.probe.push(new Vector3);const r=new Vector3,s=new Matrix4,a=new Matrix4;function o(h){let u=0,p=0,f=0;for(let w=0;w<9;w++)n.probe[w].set(0,0,0);let d=0,m=0,g=0,y=0,c=0,x=0,v=0,_=0,b=0,M=0,A=0;h.sort(shadowCastingAndTexturingLightsFirst);for(let w=0,P=h.length;w<P;w++){const N=h[w],V=N.color,G=N.intensity,H=N.distance,O=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)u+=V.r*G,p+=V.g*G,f+=V.b*G;else if(N.isLightProbe){for(let C=0;C<9;C++)n.probe[C].addScaledVector(N.sh.coefficients[C],G);A++}else if(N.isDirectionalLight){const C=e.get(N);if(C.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const L=N.shadow,E=t.get(N);E.shadowIntensity=L.intensity,E.shadowBias=L.bias,E.shadowNormalBias=L.normalBias,E.shadowRadius=L.radius,E.shadowMapSize=L.mapSize,n.directionalShadow[d]=E,n.directionalShadowMap[d]=O,n.directionalShadowMatrix[d]=N.shadow.matrix,x++}n.directional[d]=C,d++}else if(N.isSpotLight){const C=e.get(N);C.position.setFromMatrixPosition(N.matrixWorld),C.color.copy(V).multiplyScalar(G),C.distance=H,C.coneCos=Math.cos(N.angle),C.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),C.decay=N.decay,n.spot[g]=C;const L=N.shadow;if(N.map&&(n.spotLightMap[b]=N.map,b++,L.updateMatrices(N),N.castShadow&&M++),n.spotLightMatrix[g]=L.matrix,N.castShadow){const E=t.get(N);E.shadowIntensity=L.intensity,E.shadowBias=L.bias,E.shadowNormalBias=L.normalBias,E.shadowRadius=L.radius,E.shadowMapSize=L.mapSize,n.spotShadow[g]=E,n.spotShadowMap[g]=O,_++}g++}else if(N.isRectAreaLight){const C=e.get(N);C.color.copy(V).multiplyScalar(G),C.halfWidth.set(N.width*.5,0,0),C.halfHeight.set(0,N.height*.5,0),n.rectArea[y]=C,y++}else if(N.isPointLight){const C=e.get(N);if(C.color.copy(N.color).multiplyScalar(N.intensity),C.distance=N.distance,C.decay=N.decay,N.castShadow){const L=N.shadow,E=t.get(N);E.shadowIntensity=L.intensity,E.shadowBias=L.bias,E.shadowNormalBias=L.normalBias,E.shadowRadius=L.radius,E.shadowMapSize=L.mapSize,E.shadowCameraNear=L.camera.near,E.shadowCameraFar=L.camera.far,n.pointShadow[m]=E,n.pointShadowMap[m]=O,n.pointShadowMatrix[m]=N.shadow.matrix,v++}n.point[m]=C,m++}else if(N.isHemisphereLight){const C=e.get(N);C.skyColor.copy(N.color).multiplyScalar(G),C.groundColor.copy(N.groundColor).multiplyScalar(G),n.hemi[c]=C,c++}}y>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=UniformsLib.LTC_FLOAT_1,n.rectAreaLTC2=UniformsLib.LTC_FLOAT_2):(n.rectAreaLTC1=UniformsLib.LTC_HALF_1,n.rectAreaLTC2=UniformsLib.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=p,n.ambient[2]=f;const R=n.hash;(R.directionalLength!==d||R.pointLength!==m||R.spotLength!==g||R.rectAreaLength!==y||R.hemiLength!==c||R.numDirectionalShadows!==x||R.numPointShadows!==v||R.numSpotShadows!==_||R.numSpotMaps!==b||R.numLightProbes!==A)&&(n.directional.length=d,n.spot.length=g,n.rectArea.length=y,n.point.length=m,n.hemi.length=c,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=v,n.pointShadowMap.length=v,n.spotShadow.length=_,n.spotShadowMap.length=_,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=v,n.spotLightMatrix.length=_+b-M,n.spotLightMap.length=b,n.numSpotLightShadowsWithMaps=M,n.numLightProbes=A,R.directionalLength=d,R.pointLength=m,R.spotLength=g,R.rectAreaLength=y,R.hemiLength=c,R.numDirectionalShadows=x,R.numPointShadows=v,R.numSpotShadows=_,R.numSpotMaps=b,R.numLightProbes=A,n.version=nextVersion++)}function l(h,u){let p=0,f=0,d=0,m=0,g=0;const y=u.matrixWorldInverse;for(let c=0,x=h.length;c<x;c++){const v=h[c];if(v.isDirectionalLight){const _=n.directional[p];_.direction.setFromMatrixPosition(v.matrixWorld),r.setFromMatrixPosition(v.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(y),p++}else if(v.isSpotLight){const _=n.spot[d];_.position.setFromMatrixPosition(v.matrixWorld),_.position.applyMatrix4(y),_.direction.setFromMatrixPosition(v.matrixWorld),r.setFromMatrixPosition(v.target.matrixWorld),_.direction.sub(r),_.direction.transformDirection(y),d++}else if(v.isRectAreaLight){const _=n.rectArea[m];_.position.setFromMatrixPosition(v.matrixWorld),_.position.applyMatrix4(y),a.identity(),s.copy(v.matrixWorld),s.premultiply(y),a.extractRotation(s),_.halfWidth.set(v.width*.5,0,0),_.halfHeight.set(0,v.height*.5,0),_.halfWidth.applyMatrix4(a),_.halfHeight.applyMatrix4(a),m++}else if(v.isPointLight){const _=n.point[f];_.position.setFromMatrixPosition(v.matrixWorld),_.position.applyMatrix4(y),f++}else if(v.isHemisphereLight){const _=n.hemi[g];_.direction.setFromMatrixPosition(v.matrixWorld),_.direction.transformDirection(y),g++}}}return{setup:o,setupView:l,state:n}}function WebGLRenderState(i){const e=new WebGLLights(i),t=[],n=[];function r(u){h.camera=u,t.length=0,n.length=0}function s(u){t.push(u)}function a(u){n.push(u)}function o(){e.setup(t)}function l(u){e.setupView(t,u)}const h={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:h,setupLights:o,setupLightsView:l,pushLight:s,pushShadow:a}}function WebGLRenderStates(i){let e=new WeakMap;function t(r,s=0){const a=e.get(r);let o;return a===void 0?(o=new WebGLRenderState(i),e.set(r,[o])):s>=a.length?(o=new WebGLRenderState(i),a.push(o)):o=a[s],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const vertex=`void main() {
|
|
3769
3769
|
gl_Position = vec4( position, 1.0 );
|
|
3770
3770
|
}`,fragment=`uniform sampler2D shadow_pass;
|
|
3771
3771
|
uniform vec2 resolution;
|
|
@@ -3793,7 +3793,7 @@ void main() {
|
|
|
3793
3793
|
squared_mean = squared_mean / samples;
|
|
3794
3794
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3795
3795
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3796
|
-
}`;function WebGLShadowMap(i,e,t){let n=new Frustum;const r=new Vector2,s=new Vector2,a=new Vector4,o=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),l=new MeshDistanceMaterial,h={},u=t.maxTextureSize,d={[FrontSide]:BackSide,[BackSide]:FrontSide,[DoubleSide]:DoubleSide},f=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const m=new BufferGeometry;m.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Mesh(m,f),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap;let c=this.type;this.render=function(M,A,R){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||M.length===0)return;const w=i.getRenderTarget(),P=i.getActiveCubeFace(),N=i.getActiveMipmapLevel(),V=i.state;V.setBlending(NoBlending),V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const G=c!==VSMShadowMap&&this.type===VSMShadowMap,H=c===VSMShadowMap&&this.type!==VSMShadowMap;for(let O=0,C=M.length;O<C;O++){const L=M[O],E=L.shadow;if(E===void 0){console.warn("THREE.WebGLShadowMap:",L,"has no shadow.");continue}if(E.autoUpdate===!1&&E.needsUpdate===!1)continue;r.copy(E.mapSize);const T=E.getFrameExtents();if(r.multiply(T),s.copy(E.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/T.x),r.x=s.x*T.x,E.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/T.y),r.y=s.y*T.y,E.mapSize.y=s.y)),E.map===null||G===!0||H===!0){const B=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};E.map!==null&&E.map.dispose(),E.map=new WebGLRenderTarget(r.x,r.y,B),E.map.texture.name=L.name+".shadowMap",E.camera.updateProjectionMatrix()}i.setRenderTarget(E.map),i.clear();const k=E.getViewportCount();for(let B=0;B<k;B++){const ee=E.getViewport(B);a.set(s.x*ee.x,s.y*ee.y,s.x*ee.z,s.y*ee.w),V.viewport(a),E.updateMatrices(L,B),n=E.getFrustum(),_(A,R,E.camera,L,this.type)}E.isPointLightShadow!==!0&&this.type===VSMShadowMap&&x(E,R),E.needsUpdate=!1}c=this.type,y.needsUpdate=!1,i.setRenderTarget(w,P,N)};function x(M,A){const R=e.update(g);f.defines.VSM_SAMPLES!==M.blurSamples&&(f.defines.VSM_SAMPLES=M.blurSamples,p.defines.VSM_SAMPLES=M.blurSamples,f.needsUpdate=!0,p.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new WebGLRenderTarget(r.x,r.y)),f.uniforms.shadow_pass.value=M.map.texture,f.uniforms.resolution.value=M.mapSize,f.uniforms.radius.value=M.radius,i.setRenderTarget(M.mapPass),i.clear(),i.renderBufferDirect(A,null,R,f,g,null),p.uniforms.shadow_pass.value=M.mapPass.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,i.setRenderTarget(M.map),i.clear(),i.renderBufferDirect(A,null,R,p,g,null)}function v(M,A,R,w){let P=null;const N=R.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(N!==void 0)P=N;else if(P=R.isPointLight===!0?l:o,i.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const V=P.uuid,G=A.uuid;let H=h[V];H===void 0&&(H={},h[V]=H);let O=H[G];O===void 0&&(O=P.clone(),H[G]=O,A.addEventListener("dispose",b)),P=O}if(P.visible=A.visible,P.wireframe=A.wireframe,w===VSMShadowMap?P.side=A.shadowSide!==null?A.shadowSide:A.side:P.side=A.shadowSide!==null?A.shadowSide:d[A.side],P.alphaMap=A.alphaMap,P.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,P.map=A.map,P.clipShadows=A.clipShadows,P.clippingPlanes=A.clippingPlanes,P.clipIntersection=A.clipIntersection,P.displacementMap=A.displacementMap,P.displacementScale=A.displacementScale,P.displacementBias=A.displacementBias,P.wireframeLinewidth=A.wireframeLinewidth,P.linewidth=A.linewidth,R.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const V=i.properties.get(P);V.light=R}return P}function _(M,A,R,w,P){if(M.visible===!1)return;if(M.layers.test(A.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&P===VSMShadowMap)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,M.matrixWorld);const G=e.update(M),H=M.material;if(Array.isArray(H)){const O=G.groups;for(let C=0,L=O.length;C<L;C++){const E=O[C],T=H[E.materialIndex];if(T&&T.visible){const k=v(M,T,w,P);M.onBeforeShadow(i,M,A,R,G,k,E),i.renderBufferDirect(R,null,G,k,M,E),M.onAfterShadow(i,M,A,R,G,k,E)}}}else if(H.visible){const O=v(M,H,w,P);M.onBeforeShadow(i,M,A,R,G,O,null),i.renderBufferDirect(R,null,G,O,M,null),M.onAfterShadow(i,M,A,R,G,O,null)}}const V=M.children;for(let G=0,H=V.length;G<H;G++)_(V[G],A,R,w,P)}function b(M){M.target.removeEventListener("dispose",b);for(const R in h){const w=h[R],P=M.target.uuid;P in w&&(w[P].dispose(),delete w[P])}}}const reversedFuncs={[NeverDepth]:AlwaysDepth,[LessDepth]:GreaterDepth,[EqualDepth]:NotEqualDepth,[LessEqualDepth]:GreaterEqualDepth,[AlwaysDepth]:NeverDepth,[GreaterDepth]:LessDepth,[NotEqualDepth]:EqualDepth,[GreaterEqualDepth]:LessEqualDepth};function WebGLState(i,e){function t(){let z=!1;const ce=new Vector4;let Z=null;const ie=new Vector4(0,0,0,0);return{setMask:function(ue){Z!==ue&&!z&&(i.colorMask(ue,ue,ue,ue),Z=ue)},setLocked:function(ue){z=ue},setClear:function(ue,fe,De,Ye,Je){Je===!0&&(ue*=Ye,fe*=Ye,De*=Ye),ce.set(ue,fe,De,Ye),ie.equals(ce)===!1&&(i.clearColor(ue,fe,De,Ye),ie.copy(ce))},reset:function(){z=!1,Z=null,ie.set(-1,0,0,0)}}}function n(){let z=!1,ce=!1,Z=null,ie=null,ue=null;return{setReversed:function(fe){if(ce!==fe){const De=e.get("EXT_clip_control");fe?De.clipControlEXT(De.LOWER_LEFT_EXT,De.ZERO_TO_ONE_EXT):De.clipControlEXT(De.LOWER_LEFT_EXT,De.NEGATIVE_ONE_TO_ONE_EXT),ce=fe;const Ye=ue;ue=null,this.setClear(Ye)}},getReversed:function(){return ce},setTest:function(fe){fe?re(i.DEPTH_TEST):me(i.DEPTH_TEST)},setMask:function(fe){Z!==fe&&!z&&(i.depthMask(fe),Z=fe)},setFunc:function(fe){if(ce&&(fe=reversedFuncs[fe]),ie!==fe){switch(fe){case NeverDepth:i.depthFunc(i.NEVER);break;case AlwaysDepth:i.depthFunc(i.ALWAYS);break;case LessDepth:i.depthFunc(i.LESS);break;case LessEqualDepth:i.depthFunc(i.LEQUAL);break;case EqualDepth:i.depthFunc(i.EQUAL);break;case GreaterEqualDepth:i.depthFunc(i.GEQUAL);break;case GreaterDepth:i.depthFunc(i.GREATER);break;case NotEqualDepth:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}ie=fe}},setLocked:function(fe){z=fe},setClear:function(fe){ue!==fe&&(ce&&(fe=1-fe),i.clearDepth(fe),ue=fe)},reset:function(){z=!1,Z=null,ie=null,ue=null,ce=!1}}}function r(){let z=!1,ce=null,Z=null,ie=null,ue=null,fe=null,De=null,Ye=null,Je=null;return{setTest:function(We){z||(We?re(i.STENCIL_TEST):me(i.STENCIL_TEST))},setMask:function(We){ce!==We&&!z&&(i.stencilMask(We),ce=We)},setFunc:function(We,rt,at){(Z!==We||ie!==rt||ue!==at)&&(i.stencilFunc(We,rt,at),Z=We,ie=rt,ue=at)},setOp:function(We,rt,at){(fe!==We||De!==rt||Ye!==at)&&(i.stencilOp(We,rt,at),fe=We,De=rt,Ye=at)},setLocked:function(We){z=We},setClear:function(We){Je!==We&&(i.clearStencil(We),Je=We)},reset:function(){z=!1,ce=null,Z=null,ie=null,ue=null,fe=null,De=null,Ye=null,Je=null}}}const s=new t,a=new n,o=new r,l=new WeakMap,h=new WeakMap;let u={},d={},f=new WeakMap,p=[],m=null,g=!1,y=null,c=null,x=null,v=null,_=null,b=null,M=null,A=new Color(0,0,0),R=0,w=!1,P=null,N=null,V=null,G=null,H=null;const O=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let C=!1,L=0;const E=i.getParameter(i.VERSION);E.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(E)[1]),C=L>=1):E.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(E)[1]),C=L>=2);let T=null,k={};const B=i.getParameter(i.SCISSOR_BOX),ee=i.getParameter(i.VIEWPORT),oe=new Vector4().fromArray(B),X=new Vector4().fromArray(ee);function Q(z,ce,Z,ie){const ue=new Uint8Array(4),fe=i.createTexture();i.bindTexture(z,fe),i.texParameteri(z,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(z,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let De=0;De<Z;De++)z===i.TEXTURE_3D||z===i.TEXTURE_2D_ARRAY?i.texImage3D(ce,0,i.RGBA,1,1,ie,0,i.RGBA,i.UNSIGNED_BYTE,ue):i.texImage2D(ce+De,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,ue);return fe}const ne={};ne[i.TEXTURE_2D]=Q(i.TEXTURE_2D,i.TEXTURE_2D,1),ne[i.TEXTURE_CUBE_MAP]=Q(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),ne[i.TEXTURE_2D_ARRAY]=Q(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),ne[i.TEXTURE_3D]=Q(i.TEXTURE_3D,i.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),re(i.DEPTH_TEST),a.setFunc(LessEqualDepth),Le(!1),Ie(CullFaceBack),re(i.CULL_FACE),U(NoBlending);function re(z){u[z]!==!0&&(i.enable(z),u[z]=!0)}function me(z){u[z]!==!1&&(i.disable(z),u[z]=!1)}function Fe(z,ce){return d[z]!==ce?(i.bindFramebuffer(z,ce),d[z]=ce,z===i.DRAW_FRAMEBUFFER&&(d[i.FRAMEBUFFER]=ce),z===i.FRAMEBUFFER&&(d[i.DRAW_FRAMEBUFFER]=ce),!0):!1}function Ee(z,ce){let Z=p,ie=!1;if(z){Z=f.get(ce),Z===void 0&&(Z=[],f.set(ce,Z));const ue=z.textures;if(Z.length!==ue.length||Z[0]!==i.COLOR_ATTACHMENT0){for(let fe=0,De=ue.length;fe<De;fe++)Z[fe]=i.COLOR_ATTACHMENT0+fe;Z.length=ue.length,ie=!0}}else Z[0]!==i.BACK&&(Z[0]=i.BACK,ie=!0);ie&&i.drawBuffers(Z)}function Ne(z){return m!==z?(i.useProgram(z),m=z,!0):!1}const Be={[AddEquation]:i.FUNC_ADD,[SubtractEquation]:i.FUNC_SUBTRACT,[ReverseSubtractEquation]:i.FUNC_REVERSE_SUBTRACT};Be[MinEquation]=i.MIN,Be[MaxEquation]=i.MAX;const _e={[ZeroFactor]:i.ZERO,[OneFactor]:i.ONE,[SrcColorFactor]:i.SRC_COLOR,[SrcAlphaFactor]:i.SRC_ALPHA,[SrcAlphaSaturateFactor]:i.SRC_ALPHA_SATURATE,[DstColorFactor]:i.DST_COLOR,[DstAlphaFactor]:i.DST_ALPHA,[OneMinusSrcColorFactor]:i.ONE_MINUS_SRC_COLOR,[OneMinusSrcAlphaFactor]:i.ONE_MINUS_SRC_ALPHA,[OneMinusDstColorFactor]:i.ONE_MINUS_DST_COLOR,[OneMinusDstAlphaFactor]:i.ONE_MINUS_DST_ALPHA,[ConstantColorFactor]:i.CONSTANT_COLOR,[OneMinusConstantColorFactor]:i.ONE_MINUS_CONSTANT_COLOR,[ConstantAlphaFactor]:i.CONSTANT_ALPHA,[OneMinusConstantAlphaFactor]:i.ONE_MINUS_CONSTANT_ALPHA};function U(z,ce,Z,ie,ue,fe,De,Ye,Je,We){if(z===NoBlending){g===!0&&(me(i.BLEND),g=!1);return}if(g===!1&&(re(i.BLEND),g=!0),z!==CustomBlending){if(z!==y||We!==w){if((c!==AddEquation||_!==AddEquation)&&(i.blendEquation(i.FUNC_ADD),c=AddEquation,_=AddEquation),We)switch(z){case NormalBlending:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case AdditiveBlending:i.blendFunc(i.ONE,i.ONE);break;case SubtractiveBlending:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case MultiplyBlending:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}else switch(z){case NormalBlending:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case AdditiveBlending:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case SubtractiveBlending:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case MultiplyBlending:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}x=null,v=null,b=null,M=null,A.set(0,0,0),R=0,y=z,w=We}return}ue=ue||ce,fe=fe||Z,De=De||ie,(ce!==c||ue!==_)&&(i.blendEquationSeparate(Be[ce],Be[ue]),c=ce,_=ue),(Z!==x||ie!==v||fe!==b||De!==M)&&(i.blendFuncSeparate(_e[Z],_e[ie],_e[fe],_e[De]),x=Z,v=ie,b=fe,M=De),(Ye.equals(A)===!1||Je!==R)&&(i.blendColor(Ye.r,Ye.g,Ye.b,Je),A.copy(Ye),R=Je),y=z,w=!1}function qe(z,ce){z.side===DoubleSide?me(i.CULL_FACE):re(i.CULL_FACE);let Z=z.side===BackSide;ce&&(Z=!Z),Le(Z),z.blending===NormalBlending&&z.transparent===!1?U(NoBlending):U(z.blending,z.blendEquation,z.blendSrc,z.blendDst,z.blendEquationAlpha,z.blendSrcAlpha,z.blendDstAlpha,z.blendColor,z.blendAlpha,z.premultipliedAlpha),a.setFunc(z.depthFunc),a.setTest(z.depthTest),a.setMask(z.depthWrite),s.setMask(z.colorWrite);const ie=z.stencilWrite;o.setTest(ie),ie&&(o.setMask(z.stencilWriteMask),o.setFunc(z.stencilFunc,z.stencilRef,z.stencilFuncMask),o.setOp(z.stencilFail,z.stencilZFail,z.stencilZPass)),ke(z.polygonOffset,z.polygonOffsetFactor,z.polygonOffsetUnits),z.alphaToCoverage===!0?re(i.SAMPLE_ALPHA_TO_COVERAGE):me(i.SAMPLE_ALPHA_TO_COVERAGE)}function Le(z){P!==z&&(z?i.frontFace(i.CW):i.frontFace(i.CCW),P=z)}function Ie(z){z!==CullFaceNone?(re(i.CULL_FACE),z!==N&&(z===CullFaceBack?i.cullFace(i.BACK):z===CullFaceFront?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):me(i.CULL_FACE),N=z}function ge(z){z!==V&&(C&&i.lineWidth(z),V=z)}function ke(z,ce,Z){z?(re(i.POLYGON_OFFSET_FILL),(G!==ce||H!==Z)&&(i.polygonOffset(ce,Z),G=ce,H=Z)):me(i.POLYGON_OFFSET_FILL)}function ve(z){z?re(i.SCISSOR_TEST):me(i.SCISSOR_TEST)}function D(z){z===void 0&&(z=i.TEXTURE0+O-1),T!==z&&(i.activeTexture(z),T=z)}function I(z,ce,Z){Z===void 0&&(T===null?Z=i.TEXTURE0+O-1:Z=T);let ie=k[Z];ie===void 0&&(ie={type:void 0,texture:void 0},k[Z]=ie),(ie.type!==z||ie.texture!==ce)&&(T!==Z&&(i.activeTexture(Z),T=Z),i.bindTexture(z,ce||ne[z]),ie.type=z,ie.texture=ce)}function q(){const z=k[T];z!==void 0&&z.type!==void 0&&(i.bindTexture(z.type,null),z.type=void 0,z.texture=void 0)}function J(){try{i.compressedTexImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function te(){try{i.compressedTexImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function K(){try{i.texSubImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function de(){try{i.texSubImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function le(){try{i.compressedTexSubImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Me(){try{i.compressedTexSubImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function be(){try{i.texStorage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function se(){try{i.texStorage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function ye(){try{i.texImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Ce(){try{i.texImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Pe(z){oe.equals(z)===!1&&(i.scissor(z.x,z.y,z.z,z.w),oe.copy(z))}function xe(z){X.equals(z)===!1&&(i.viewport(z.x,z.y,z.z,z.w),X.copy(z))}function Ve(z,ce){let Z=h.get(ce);Z===void 0&&(Z=new WeakMap,h.set(ce,Z));let ie=Z.get(z);ie===void 0&&(ie=i.getUniformBlockIndex(ce,z.name),Z.set(z,ie))}function Ue(z,ce){const ie=h.get(ce).get(z);l.get(ce)!==ie&&(i.uniformBlockBinding(ce,ie,z.__bindingPointIndex),l.set(ce,ie))}function $e(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),a.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),u={},T=null,k={},d={},f=new WeakMap,p=[],m=null,g=!1,y=null,c=null,x=null,v=null,_=null,b=null,M=null,A=new Color(0,0,0),R=0,w=!1,P=null,N=null,V=null,G=null,H=null,oe.set(0,0,i.canvas.width,i.canvas.height),X.set(0,0,i.canvas.width,i.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:re,disable:me,bindFramebuffer:Fe,drawBuffers:Ee,useProgram:Ne,setBlending:U,setMaterial:qe,setFlipSided:Le,setCullFace:Ie,setLineWidth:ge,setPolygonOffset:ke,setScissorTest:ve,activeTexture:D,bindTexture:I,unbindTexture:q,compressedTexImage2D:J,compressedTexImage3D:te,texImage2D:ye,texImage3D:Ce,updateUBOMapping:Ve,uniformBlockBinding:Ue,texStorage2D:be,texStorage3D:se,texSubImage2D:K,texSubImage3D:de,compressedTexSubImage2D:le,compressedTexSubImage3D:Me,scissor:Pe,viewport:xe,reset:$e}}function WebGLTextures(i,e,t,n,r,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new Vector2,u=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(D,I){return p?new OffscreenCanvas(D,I):createElementNS("canvas")}function g(D,I,q){let J=1;const te=ve(D);if((te.width>q||te.height>q)&&(J=q/Math.max(te.width,te.height)),J<1)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap||typeof VideoFrame<"u"&&D instanceof VideoFrame){const K=Math.floor(J*te.width),de=Math.floor(J*te.height);d===void 0&&(d=m(K,de));const le=I?m(K,de):d;return le.width=K,le.height=de,le.getContext("2d").drawImage(D,0,0,K,de),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+te.width+"x"+te.height+") to ("+K+"x"+de+")."),le}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+te.width+"x"+te.height+")."),D;return D}function y(D){return D.generateMipmaps}function c(D){i.generateMipmap(D)}function x(D){return D.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:D.isWebGL3DRenderTarget?i.TEXTURE_3D:D.isWebGLArrayRenderTarget||D.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function v(D,I,q,J,te=!1){if(D!==null){if(i[D]!==void 0)return i[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let K=I;if(I===i.RED&&(q===i.FLOAT&&(K=i.R32F),q===i.HALF_FLOAT&&(K=i.R16F),q===i.UNSIGNED_BYTE&&(K=i.R8)),I===i.RED_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.R8UI),q===i.UNSIGNED_SHORT&&(K=i.R16UI),q===i.UNSIGNED_INT&&(K=i.R32UI),q===i.BYTE&&(K=i.R8I),q===i.SHORT&&(K=i.R16I),q===i.INT&&(K=i.R32I)),I===i.RG&&(q===i.FLOAT&&(K=i.RG32F),q===i.HALF_FLOAT&&(K=i.RG16F),q===i.UNSIGNED_BYTE&&(K=i.RG8)),I===i.RG_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.RG8UI),q===i.UNSIGNED_SHORT&&(K=i.RG16UI),q===i.UNSIGNED_INT&&(K=i.RG32UI),q===i.BYTE&&(K=i.RG8I),q===i.SHORT&&(K=i.RG16I),q===i.INT&&(K=i.RG32I)),I===i.RGB_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.RGB8UI),q===i.UNSIGNED_SHORT&&(K=i.RGB16UI),q===i.UNSIGNED_INT&&(K=i.RGB32UI),q===i.BYTE&&(K=i.RGB8I),q===i.SHORT&&(K=i.RGB16I),q===i.INT&&(K=i.RGB32I)),I===i.RGBA_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.RGBA8UI),q===i.UNSIGNED_SHORT&&(K=i.RGBA16UI),q===i.UNSIGNED_INT&&(K=i.RGBA32UI),q===i.BYTE&&(K=i.RGBA8I),q===i.SHORT&&(K=i.RGBA16I),q===i.INT&&(K=i.RGBA32I)),I===i.RGB&&q===i.UNSIGNED_INT_5_9_9_9_REV&&(K=i.RGB9_E5),I===i.RGBA){const de=te?LinearTransfer:ColorManagement.getTransfer(J);q===i.FLOAT&&(K=i.RGBA32F),q===i.HALF_FLOAT&&(K=i.RGBA16F),q===i.UNSIGNED_BYTE&&(K=de===SRGBTransfer?i.SRGB8_ALPHA8:i.RGBA8),q===i.UNSIGNED_SHORT_4_4_4_4&&(K=i.RGBA4),q===i.UNSIGNED_SHORT_5_5_5_1&&(K=i.RGB5_A1)}return(K===i.R16F||K===i.R32F||K===i.RG16F||K===i.RG32F||K===i.RGBA16F||K===i.RGBA32F)&&e.get("EXT_color_buffer_float"),K}function _(D,I){let q;return D?I===null||I===UnsignedIntType||I===UnsignedInt248Type?q=i.DEPTH24_STENCIL8:I===FloatType?q=i.DEPTH32F_STENCIL8:I===UnsignedShortType&&(q=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):I===null||I===UnsignedIntType||I===UnsignedInt248Type?q=i.DEPTH_COMPONENT24:I===FloatType?q=i.DEPTH_COMPONENT32F:I===UnsignedShortType&&(q=i.DEPTH_COMPONENT16),q}function b(D,I){return y(D)===!0||D.isFramebufferTexture&&D.minFilter!==NearestFilter&&D.minFilter!==LinearFilter?Math.log2(Math.max(I.width,I.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?I.mipmaps.length:1}function M(D){const I=D.target;I.removeEventListener("dispose",M),R(I),I.isVideoTexture&&u.delete(I)}function A(D){const I=D.target;I.removeEventListener("dispose",A),P(I)}function R(D){const I=n.get(D);if(I.__webglInit===void 0)return;const q=D.source,J=f.get(q);if(J){const te=J[I.__cacheKey];te.usedTimes--,te.usedTimes===0&&w(D),Object.keys(J).length===0&&f.delete(q)}n.remove(D)}function w(D){const I=n.get(D);i.deleteTexture(I.__webglTexture);const q=D.source,J=f.get(q);delete J[I.__cacheKey],a.memory.textures--}function P(D){const I=n.get(D);if(D.depthTexture&&(D.depthTexture.dispose(),n.remove(D.depthTexture)),D.isWebGLCubeRenderTarget)for(let J=0;J<6;J++){if(Array.isArray(I.__webglFramebuffer[J]))for(let te=0;te<I.__webglFramebuffer[J].length;te++)i.deleteFramebuffer(I.__webglFramebuffer[J][te]);else i.deleteFramebuffer(I.__webglFramebuffer[J]);I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer[J])}else{if(Array.isArray(I.__webglFramebuffer))for(let J=0;J<I.__webglFramebuffer.length;J++)i.deleteFramebuffer(I.__webglFramebuffer[J]);else i.deleteFramebuffer(I.__webglFramebuffer);if(I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer),I.__webglMultisampledFramebuffer&&i.deleteFramebuffer(I.__webglMultisampledFramebuffer),I.__webglColorRenderbuffer)for(let J=0;J<I.__webglColorRenderbuffer.length;J++)I.__webglColorRenderbuffer[J]&&i.deleteRenderbuffer(I.__webglColorRenderbuffer[J]);I.__webglDepthRenderbuffer&&i.deleteRenderbuffer(I.__webglDepthRenderbuffer)}const q=D.textures;for(let J=0,te=q.length;J<te;J++){const K=n.get(q[J]);K.__webglTexture&&(i.deleteTexture(K.__webglTexture),a.memory.textures--),n.remove(q[J])}n.remove(D)}let N=0;function V(){N=0}function G(){const D=N;return D>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+r.maxTextures),N+=1,D}function H(D){const I=[];return I.push(D.wrapS),I.push(D.wrapT),I.push(D.wrapR||0),I.push(D.magFilter),I.push(D.minFilter),I.push(D.anisotropy),I.push(D.internalFormat),I.push(D.format),I.push(D.type),I.push(D.generateMipmaps),I.push(D.premultiplyAlpha),I.push(D.flipY),I.push(D.unpackAlignment),I.push(D.colorSpace),I.join()}function O(D,I){const q=n.get(D);if(D.isVideoTexture&&ge(D),D.isRenderTargetTexture===!1&&D.version>0&&q.__version!==D.version){const J=D.image;if(J===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(J.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{X(q,D,I);return}}t.bindTexture(i.TEXTURE_2D,q.__webglTexture,i.TEXTURE0+I)}function C(D,I){const q=n.get(D);if(D.version>0&&q.__version!==D.version){X(q,D,I);return}t.bindTexture(i.TEXTURE_2D_ARRAY,q.__webglTexture,i.TEXTURE0+I)}function L(D,I){const q=n.get(D);if(D.version>0&&q.__version!==D.version){X(q,D,I);return}t.bindTexture(i.TEXTURE_3D,q.__webglTexture,i.TEXTURE0+I)}function E(D,I){const q=n.get(D);if(D.version>0&&q.__version!==D.version){Q(q,D,I);return}t.bindTexture(i.TEXTURE_CUBE_MAP,q.__webglTexture,i.TEXTURE0+I)}const T={[RepeatWrapping]:i.REPEAT,[ClampToEdgeWrapping]:i.CLAMP_TO_EDGE,[MirroredRepeatWrapping]:i.MIRRORED_REPEAT},k={[NearestFilter]:i.NEAREST,[NearestMipmapNearestFilter]:i.NEAREST_MIPMAP_NEAREST,[NearestMipmapLinearFilter]:i.NEAREST_MIPMAP_LINEAR,[LinearFilter]:i.LINEAR,[LinearMipmapNearestFilter]:i.LINEAR_MIPMAP_NEAREST,[LinearMipmapLinearFilter]:i.LINEAR_MIPMAP_LINEAR},B={[NeverCompare]:i.NEVER,[AlwaysCompare]:i.ALWAYS,[LessCompare]:i.LESS,[LessEqualCompare]:i.LEQUAL,[EqualCompare]:i.EQUAL,[GreaterEqualCompare]:i.GEQUAL,[GreaterCompare]:i.GREATER,[NotEqualCompare]:i.NOTEQUAL};function ee(D,I){if(I.type===FloatType&&e.has("OES_texture_float_linear")===!1&&(I.magFilter===LinearFilter||I.magFilter===LinearMipmapNearestFilter||I.magFilter===NearestMipmapLinearFilter||I.magFilter===LinearMipmapLinearFilter||I.minFilter===LinearFilter||I.minFilter===LinearMipmapNearestFilter||I.minFilter===NearestMipmapLinearFilter||I.minFilter===LinearMipmapLinearFilter)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(D,i.TEXTURE_WRAP_S,T[I.wrapS]),i.texParameteri(D,i.TEXTURE_WRAP_T,T[I.wrapT]),(D===i.TEXTURE_3D||D===i.TEXTURE_2D_ARRAY)&&i.texParameteri(D,i.TEXTURE_WRAP_R,T[I.wrapR]),i.texParameteri(D,i.TEXTURE_MAG_FILTER,k[I.magFilter]),i.texParameteri(D,i.TEXTURE_MIN_FILTER,k[I.minFilter]),I.compareFunction&&(i.texParameteri(D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(D,i.TEXTURE_COMPARE_FUNC,B[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(I.magFilter===NearestFilter||I.minFilter!==NearestMipmapLinearFilter&&I.minFilter!==LinearMipmapLinearFilter||I.type===FloatType&&e.has("OES_texture_float_linear")===!1)return;if(I.anisotropy>1||n.get(I).__currentAnisotropy){const q=e.get("EXT_texture_filter_anisotropic");i.texParameterf(D,q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,r.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy}}}function oe(D,I){let q=!1;D.__webglInit===void 0&&(D.__webglInit=!0,I.addEventListener("dispose",M));const J=I.source;let te=f.get(J);te===void 0&&(te={},f.set(J,te));const K=H(I);if(K!==D.__cacheKey){te[K]===void 0&&(te[K]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,q=!0),te[K].usedTimes++;const de=te[D.__cacheKey];de!==void 0&&(te[D.__cacheKey].usedTimes--,de.usedTimes===0&&w(I)),D.__cacheKey=K,D.__webglTexture=te[K].texture}return q}function X(D,I,q){let J=i.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(J=i.TEXTURE_2D_ARRAY),I.isData3DTexture&&(J=i.TEXTURE_3D);const te=oe(D,I),K=I.source;t.bindTexture(J,D.__webglTexture,i.TEXTURE0+q);const de=n.get(K);if(K.version!==de.__version||te===!0){t.activeTexture(i.TEXTURE0+q);const le=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),Me=I.colorSpace===NoColorSpace?null:ColorManagement.getPrimaries(I.colorSpace),be=I.colorSpace===NoColorSpace||le===Me?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,be);let se=g(I.image,!1,r.maxTextureSize);se=ke(I,se);const ye=s.convert(I.format,I.colorSpace),Ce=s.convert(I.type);let Pe=v(I.internalFormat,ye,Ce,I.colorSpace,I.isVideoTexture);ee(J,I);let xe;const Ve=I.mipmaps,Ue=I.isVideoTexture!==!0,$e=de.__version===void 0||te===!0,z=K.dataReady,ce=b(I,se);if(I.isDepthTexture)Pe=_(I.format===DepthStencilFormat,I.type),$e&&(Ue?t.texStorage2D(i.TEXTURE_2D,1,Pe,se.width,se.height):t.texImage2D(i.TEXTURE_2D,0,Pe,se.width,se.height,0,ye,Ce,null));else if(I.isDataTexture)if(Ve.length>0){Ue&&$e&&t.texStorage2D(i.TEXTURE_2D,ce,Pe,Ve[0].width,Ve[0].height);for(let Z=0,ie=Ve.length;Z<ie;Z++)xe=Ve[Z],Ue?z&&t.texSubImage2D(i.TEXTURE_2D,Z,0,0,xe.width,xe.height,ye,Ce,xe.data):t.texImage2D(i.TEXTURE_2D,Z,Pe,xe.width,xe.height,0,ye,Ce,xe.data);I.generateMipmaps=!1}else Ue?($e&&t.texStorage2D(i.TEXTURE_2D,ce,Pe,se.width,se.height),z&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,se.width,se.height,ye,Ce,se.data)):t.texImage2D(i.TEXTURE_2D,0,Pe,se.width,se.height,0,ye,Ce,se.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){Ue&&$e&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ce,Pe,Ve[0].width,Ve[0].height,se.depth);for(let Z=0,ie=Ve.length;Z<ie;Z++)if(xe=Ve[Z],I.format!==RGBAFormat)if(ye!==null)if(Ue){if(z)if(I.layerUpdates.size>0){const ue=getByteLength(xe.width,xe.height,I.format,I.type);for(const fe of I.layerUpdates){const De=xe.data.subarray(fe*ue/xe.data.BYTES_PER_ELEMENT,(fe+1)*ue/xe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Z,0,0,fe,xe.width,xe.height,1,ye,De)}I.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Z,0,0,0,xe.width,xe.height,se.depth,ye,xe.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,Z,Pe,xe.width,xe.height,se.depth,0,xe.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ue?z&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,Z,0,0,0,xe.width,xe.height,se.depth,ye,Ce,xe.data):t.texImage3D(i.TEXTURE_2D_ARRAY,Z,Pe,xe.width,xe.height,se.depth,0,ye,Ce,xe.data)}else{Ue&&$e&&t.texStorage2D(i.TEXTURE_2D,ce,Pe,Ve[0].width,Ve[0].height);for(let Z=0,ie=Ve.length;Z<ie;Z++)xe=Ve[Z],I.format!==RGBAFormat?ye!==null?Ue?z&&t.compressedTexSubImage2D(i.TEXTURE_2D,Z,0,0,xe.width,xe.height,ye,xe.data):t.compressedTexImage2D(i.TEXTURE_2D,Z,Pe,xe.width,xe.height,0,xe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ue?z&&t.texSubImage2D(i.TEXTURE_2D,Z,0,0,xe.width,xe.height,ye,Ce,xe.data):t.texImage2D(i.TEXTURE_2D,Z,Pe,xe.width,xe.height,0,ye,Ce,xe.data)}else if(I.isDataArrayTexture)if(Ue){if($e&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ce,Pe,se.width,se.height,se.depth),z)if(I.layerUpdates.size>0){const Z=getByteLength(se.width,se.height,I.format,I.type);for(const ie of I.layerUpdates){const ue=se.data.subarray(ie*Z/se.data.BYTES_PER_ELEMENT,(ie+1)*Z/se.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,ie,se.width,se.height,1,ye,Ce,ue)}I.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,se.width,se.height,se.depth,ye,Ce,se.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Pe,se.width,se.height,se.depth,0,ye,Ce,se.data);else if(I.isData3DTexture)Ue?($e&&t.texStorage3D(i.TEXTURE_3D,ce,Pe,se.width,se.height,se.depth),z&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,se.width,se.height,se.depth,ye,Ce,se.data)):t.texImage3D(i.TEXTURE_3D,0,Pe,se.width,se.height,se.depth,0,ye,Ce,se.data);else if(I.isFramebufferTexture){if($e)if(Ue)t.texStorage2D(i.TEXTURE_2D,ce,Pe,se.width,se.height);else{let Z=se.width,ie=se.height;for(let ue=0;ue<ce;ue++)t.texImage2D(i.TEXTURE_2D,ue,Pe,Z,ie,0,ye,Ce,null),Z>>=1,ie>>=1}}else if(Ve.length>0){if(Ue&&$e){const Z=ve(Ve[0]);t.texStorage2D(i.TEXTURE_2D,ce,Pe,Z.width,Z.height)}for(let Z=0,ie=Ve.length;Z<ie;Z++)xe=Ve[Z],Ue?z&&t.texSubImage2D(i.TEXTURE_2D,Z,0,0,ye,Ce,xe):t.texImage2D(i.TEXTURE_2D,Z,Pe,ye,Ce,xe);I.generateMipmaps=!1}else if(Ue){if($e){const Z=ve(se);t.texStorage2D(i.TEXTURE_2D,ce,Pe,Z.width,Z.height)}z&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,ye,Ce,se)}else t.texImage2D(i.TEXTURE_2D,0,Pe,ye,Ce,se);y(I)&&c(J),de.__version=K.version,I.onUpdate&&I.onUpdate(I)}D.__version=I.version}function Q(D,I,q){if(I.image.length!==6)return;const J=oe(D,I),te=I.source;t.bindTexture(i.TEXTURE_CUBE_MAP,D.__webglTexture,i.TEXTURE0+q);const K=n.get(te);if(te.version!==K.__version||J===!0){t.activeTexture(i.TEXTURE0+q);const de=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),le=I.colorSpace===NoColorSpace?null:ColorManagement.getPrimaries(I.colorSpace),Me=I.colorSpace===NoColorSpace||de===le?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Me);const be=I.isCompressedTexture||I.image[0].isCompressedTexture,se=I.image[0]&&I.image[0].isDataTexture,ye=[];for(let ie=0;ie<6;ie++)!be&&!se?ye[ie]=g(I.image[ie],!0,r.maxCubemapSize):ye[ie]=se?I.image[ie].image:I.image[ie],ye[ie]=ke(I,ye[ie]);const Ce=ye[0],Pe=s.convert(I.format,I.colorSpace),xe=s.convert(I.type),Ve=v(I.internalFormat,Pe,xe,I.colorSpace),Ue=I.isVideoTexture!==!0,$e=K.__version===void 0||J===!0,z=te.dataReady;let ce=b(I,Ce);ee(i.TEXTURE_CUBE_MAP,I);let Z;if(be){Ue&&$e&&t.texStorage2D(i.TEXTURE_CUBE_MAP,ce,Ve,Ce.width,Ce.height);for(let ie=0;ie<6;ie++){Z=ye[ie].mipmaps;for(let ue=0;ue<Z.length;ue++){const fe=Z[ue];I.format!==RGBAFormat?Pe!==null?Ue?z&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,0,0,fe.width,fe.height,Pe,fe.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,Ve,fe.width,fe.height,0,fe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,0,0,fe.width,fe.height,Pe,xe,fe.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,Ve,fe.width,fe.height,0,Pe,xe,fe.data)}}}else{if(Z=I.mipmaps,Ue&&$e){Z.length>0&&ce++;const ie=ve(ye[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,ce,Ve,ie.width,ie.height)}for(let ie=0;ie<6;ie++)if(se){Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,ye[ie].width,ye[ie].height,Pe,xe,ye[ie].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ve,ye[ie].width,ye[ie].height,0,Pe,xe,ye[ie].data);for(let ue=0;ue<Z.length;ue++){const De=Z[ue].image[ie].image;Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,0,0,De.width,De.height,Pe,xe,De.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,Ve,De.width,De.height,0,Pe,xe,De.data)}}else{Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,Pe,xe,ye[ie]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ve,Pe,xe,ye[ie]);for(let ue=0;ue<Z.length;ue++){const fe=Z[ue];Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,0,0,Pe,xe,fe.image[ie]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,Ve,Pe,xe,fe.image[ie])}}}y(I)&&c(i.TEXTURE_CUBE_MAP),K.__version=te.version,I.onUpdate&&I.onUpdate(I)}D.__version=I.version}function ne(D,I,q,J,te,K){const de=s.convert(q.format,q.colorSpace),le=s.convert(q.type),Me=v(q.internalFormat,de,le,q.colorSpace),be=n.get(I),se=n.get(q);if(se.__renderTarget=I,!be.__hasExternalTextures){const ye=Math.max(1,I.width>>K),Ce=Math.max(1,I.height>>K);te===i.TEXTURE_3D||te===i.TEXTURE_2D_ARRAY?t.texImage3D(te,K,Me,ye,Ce,I.depth,0,de,le,null):t.texImage2D(te,K,Me,ye,Ce,0,de,le,null)}t.bindFramebuffer(i.FRAMEBUFFER,D),Ie(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,J,te,se.__webglTexture,0,Le(I)):(te===i.TEXTURE_2D||te>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&te<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,J,te,se.__webglTexture,K),t.bindFramebuffer(i.FRAMEBUFFER,null)}function re(D,I,q){if(i.bindRenderbuffer(i.RENDERBUFFER,D),I.depthBuffer){const J=I.depthTexture,te=J&&J.isDepthTexture?J.type:null,K=_(I.stencilBuffer,te),de=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,le=Le(I);Ie(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,le,K,I.width,I.height):q?i.renderbufferStorageMultisample(i.RENDERBUFFER,le,K,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,K,I.width,I.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,de,i.RENDERBUFFER,D)}else{const J=I.textures;for(let te=0;te<J.length;te++){const K=J[te],de=s.convert(K.format,K.colorSpace),le=s.convert(K.type),Me=v(K.internalFormat,de,le,K.colorSpace),be=Le(I);q&&Ie(I)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,be,Me,I.width,I.height):Ie(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,be,Me,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,Me,I.width,I.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function me(D,I){if(I&&I.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,D),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const J=n.get(I.depthTexture);J.__renderTarget=I,(!J.__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),O(I.depthTexture,0);const te=J.__webglTexture,K=Le(I);if(I.depthTexture.format===DepthFormat)Ie(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,te,0,K):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,te,0);else if(I.depthTexture.format===DepthStencilFormat)Ie(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,te,0,K):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,te,0);else throw new Error("Unknown depthTexture format")}function Fe(D){const I=n.get(D),q=D.isWebGLCubeRenderTarget===!0;if(I.__boundDepthTexture!==D.depthTexture){const J=D.depthTexture;if(I.__depthDisposeCallback&&I.__depthDisposeCallback(),J){const te=()=>{delete I.__boundDepthTexture,delete I.__depthDisposeCallback,J.removeEventListener("dispose",te)};J.addEventListener("dispose",te),I.__depthDisposeCallback=te}I.__boundDepthTexture=J}if(D.depthTexture&&!I.__autoAllocateDepthBuffer){if(q)throw new Error("target.depthTexture not supported in Cube render targets");const J=D.texture.mipmaps;J&&J.length>0?me(I.__webglFramebuffer[0],D):me(I.__webglFramebuffer,D)}else if(q){I.__webglDepthbuffer=[];for(let J=0;J<6;J++)if(t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[J]),I.__webglDepthbuffer[J]===void 0)I.__webglDepthbuffer[J]=i.createRenderbuffer(),re(I.__webglDepthbuffer[J],D,!1);else{const te=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=I.__webglDepthbuffer[J];i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,te,i.RENDERBUFFER,K)}}else{const J=D.texture.mipmaps;if(J&&J.length>0?t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer),I.__webglDepthbuffer===void 0)I.__webglDepthbuffer=i.createRenderbuffer(),re(I.__webglDepthbuffer,D,!1);else{const te=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=I.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,te,i.RENDERBUFFER,K)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ee(D,I,q){const J=n.get(D);I!==void 0&&ne(J.__webglFramebuffer,D,D.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),q!==void 0&&Fe(D)}function Ne(D){const I=D.texture,q=n.get(D),J=n.get(I);D.addEventListener("dispose",A);const te=D.textures,K=D.isWebGLCubeRenderTarget===!0,de=te.length>1;if(de||(J.__webglTexture===void 0&&(J.__webglTexture=i.createTexture()),J.__version=I.version,a.memory.textures++),K){q.__webglFramebuffer=[];for(let le=0;le<6;le++)if(I.mipmaps&&I.mipmaps.length>0){q.__webglFramebuffer[le]=[];for(let Me=0;Me<I.mipmaps.length;Me++)q.__webglFramebuffer[le][Me]=i.createFramebuffer()}else q.__webglFramebuffer[le]=i.createFramebuffer()}else{if(I.mipmaps&&I.mipmaps.length>0){q.__webglFramebuffer=[];for(let le=0;le<I.mipmaps.length;le++)q.__webglFramebuffer[le]=i.createFramebuffer()}else q.__webglFramebuffer=i.createFramebuffer();if(de)for(let le=0,Me=te.length;le<Me;le++){const be=n.get(te[le]);be.__webglTexture===void 0&&(be.__webglTexture=i.createTexture(),a.memory.textures++)}if(D.samples>0&&Ie(D)===!1){q.__webglMultisampledFramebuffer=i.createFramebuffer(),q.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,q.__webglMultisampledFramebuffer);for(let le=0;le<te.length;le++){const Me=te[le];q.__webglColorRenderbuffer[le]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,q.__webglColorRenderbuffer[le]);const be=s.convert(Me.format,Me.colorSpace),se=s.convert(Me.type),ye=v(Me.internalFormat,be,se,Me.colorSpace,D.isXRRenderTarget===!0),Ce=Le(D);i.renderbufferStorageMultisample(i.RENDERBUFFER,Ce,ye,D.width,D.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+le,i.RENDERBUFFER,q.__webglColorRenderbuffer[le])}i.bindRenderbuffer(i.RENDERBUFFER,null),D.depthBuffer&&(q.__webglDepthRenderbuffer=i.createRenderbuffer(),re(q.__webglDepthRenderbuffer,D,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(K){t.bindTexture(i.TEXTURE_CUBE_MAP,J.__webglTexture),ee(i.TEXTURE_CUBE_MAP,I);for(let le=0;le<6;le++)if(I.mipmaps&&I.mipmaps.length>0)for(let Me=0;Me<I.mipmaps.length;Me++)ne(q.__webglFramebuffer[le][Me],D,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+le,Me);else ne(q.__webglFramebuffer[le],D,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+le,0);y(I)&&c(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(de){for(let le=0,Me=te.length;le<Me;le++){const be=te[le],se=n.get(be);t.bindTexture(i.TEXTURE_2D,se.__webglTexture),ee(i.TEXTURE_2D,be),ne(q.__webglFramebuffer,D,be,i.COLOR_ATTACHMENT0+le,i.TEXTURE_2D,0),y(be)&&c(i.TEXTURE_2D)}t.unbindTexture()}else{let le=i.TEXTURE_2D;if((D.isWebGL3DRenderTarget||D.isWebGLArrayRenderTarget)&&(le=D.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(le,J.__webglTexture),ee(le,I),I.mipmaps&&I.mipmaps.length>0)for(let Me=0;Me<I.mipmaps.length;Me++)ne(q.__webglFramebuffer[Me],D,I,i.COLOR_ATTACHMENT0,le,Me);else ne(q.__webglFramebuffer,D,I,i.COLOR_ATTACHMENT0,le,0);y(I)&&c(le),t.unbindTexture()}D.depthBuffer&&Fe(D)}function Be(D){const I=D.textures;for(let q=0,J=I.length;q<J;q++){const te=I[q];if(y(te)){const K=x(D),de=n.get(te).__webglTexture;t.bindTexture(K,de),c(K),t.unbindTexture()}}}const _e=[],U=[];function qe(D){if(D.samples>0){if(Ie(D)===!1){const I=D.textures,q=D.width,J=D.height;let te=i.COLOR_BUFFER_BIT;const K=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,de=n.get(D),le=I.length>1;if(le)for(let be=0;be<I.length;be++)t.bindFramebuffer(i.FRAMEBUFFER,de.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,de.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,de.__webglMultisampledFramebuffer);const Me=D.texture.mipmaps;Me&&Me.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,de.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,de.__webglFramebuffer);for(let be=0;be<I.length;be++){if(D.resolveDepthBuffer&&(D.depthBuffer&&(te|=i.DEPTH_BUFFER_BIT),D.stencilBuffer&&D.resolveStencilBuffer&&(te|=i.STENCIL_BUFFER_BIT)),le){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,de.__webglColorRenderbuffer[be]);const se=n.get(I[be]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,se,0)}i.blitFramebuffer(0,0,q,J,0,0,q,J,te,i.NEAREST),l===!0&&(_e.length=0,U.length=0,_e.push(i.COLOR_ATTACHMENT0+be),D.depthBuffer&&D.resolveDepthBuffer===!1&&(_e.push(K),U.push(K),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,U)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,_e))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),le)for(let be=0;be<I.length;be++){t.bindFramebuffer(i.FRAMEBUFFER,de.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.RENDERBUFFER,de.__webglColorRenderbuffer[be]);const se=n.get(I[be]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,de.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.TEXTURE_2D,se,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,de.__webglMultisampledFramebuffer)}else if(D.depthBuffer&&D.resolveDepthBuffer===!1&&l){const I=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[I])}}}function Le(D){return Math.min(r.maxSamples,D.samples)}function Ie(D){const I=n.get(D);return D.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ge(D){const I=a.render.frame;u.get(D)!==I&&(u.set(D,I),D.update())}function ke(D,I){const q=D.colorSpace,J=D.format,te=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||q!==LinearSRGBColorSpace&&q!==NoColorSpace&&(ColorManagement.getTransfer(q)===SRGBTransfer?(J!==RGBAFormat||te!==UnsignedByteType)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",q)),I}function ve(D){return typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement?(h.width=D.naturalWidth||D.width,h.height=D.naturalHeight||D.height):typeof VideoFrame<"u"&&D instanceof VideoFrame?(h.width=D.displayWidth,h.height=D.displayHeight):(h.width=D.width,h.height=D.height),h}this.allocateTextureUnit=G,this.resetTextureUnits=V,this.setTexture2D=O,this.setTexture2DArray=C,this.setTexture3D=L,this.setTextureCube=E,this.rebindTextures=Ee,this.setupRenderTarget=Ne,this.updateRenderTargetMipmap=Be,this.updateMultisampleRenderTarget=qe,this.setupDepthRenderbuffer=Fe,this.setupFrameBufferTexture=ne,this.useMultisampledRTT=Ie}function WebGLUtils(i,e){function t(n,r=NoColorSpace){let s;const a=ColorManagement.getTransfer(r);if(n===UnsignedByteType)return i.UNSIGNED_BYTE;if(n===UnsignedShort4444Type)return i.UNSIGNED_SHORT_4_4_4_4;if(n===UnsignedShort5551Type)return i.UNSIGNED_SHORT_5_5_5_1;if(n===UnsignedInt5999Type)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===ByteType)return i.BYTE;if(n===ShortType)return i.SHORT;if(n===UnsignedShortType)return i.UNSIGNED_SHORT;if(n===IntType)return i.INT;if(n===UnsignedIntType)return i.UNSIGNED_INT;if(n===FloatType)return i.FLOAT;if(n===HalfFloatType)return i.HALF_FLOAT;if(n===AlphaFormat)return i.ALPHA;if(n===RGBFormat)return i.RGB;if(n===RGBAFormat)return i.RGBA;if(n===DepthFormat)return i.DEPTH_COMPONENT;if(n===DepthStencilFormat)return i.DEPTH_STENCIL;if(n===RedFormat)return i.RED;if(n===RedIntegerFormat)return i.RED_INTEGER;if(n===RGFormat)return i.RG;if(n===RGIntegerFormat)return i.RG_INTEGER;if(n===RGBAIntegerFormat)return i.RGBA_INTEGER;if(n===RGB_S3TC_DXT1_Format||n===RGBA_S3TC_DXT1_Format||n===RGBA_S3TC_DXT3_Format||n===RGBA_S3TC_DXT5_Format)if(a===SRGBTransfer)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===RGB_S3TC_DXT1_Format)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT1_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT3_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===RGBA_S3TC_DXT5_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===RGB_S3TC_DXT1_Format)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT1_Format)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT3_Format)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===RGBA_S3TC_DXT5_Format)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===RGB_PVRTC_4BPPV1_Format||n===RGB_PVRTC_2BPPV1_Format||n===RGBA_PVRTC_4BPPV1_Format||n===RGBA_PVRTC_2BPPV1_Format)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===RGB_PVRTC_4BPPV1_Format)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===RGB_PVRTC_2BPPV1_Format)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===RGBA_PVRTC_4BPPV1_Format)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===RGBA_PVRTC_2BPPV1_Format)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===RGB_ETC1_Format||n===RGB_ETC2_Format||n===RGBA_ETC2_EAC_Format)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===RGB_ETC1_Format||n===RGB_ETC2_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===RGBA_ETC2_EAC_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===RGBA_ASTC_4x4_Format||n===RGBA_ASTC_5x4_Format||n===RGBA_ASTC_5x5_Format||n===RGBA_ASTC_6x5_Format||n===RGBA_ASTC_6x6_Format||n===RGBA_ASTC_8x5_Format||n===RGBA_ASTC_8x6_Format||n===RGBA_ASTC_8x8_Format||n===RGBA_ASTC_10x5_Format||n===RGBA_ASTC_10x6_Format||n===RGBA_ASTC_10x8_Format||n===RGBA_ASTC_10x10_Format||n===RGBA_ASTC_12x10_Format||n===RGBA_ASTC_12x12_Format)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===RGBA_ASTC_4x4_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===RGBA_ASTC_5x4_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===RGBA_ASTC_5x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===RGBA_ASTC_6x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===RGBA_ASTC_6x6_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===RGBA_ASTC_8x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===RGBA_ASTC_8x6_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===RGBA_ASTC_8x8_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===RGBA_ASTC_10x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===RGBA_ASTC_10x6_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===RGBA_ASTC_10x8_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===RGBA_ASTC_10x10_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===RGBA_ASTC_12x10_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===RGBA_ASTC_12x12_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===RGBA_BPTC_Format||n===RGB_BPTC_SIGNED_Format||n===RGB_BPTC_UNSIGNED_Format)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===RGBA_BPTC_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===RGB_BPTC_SIGNED_Format)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===RGB_BPTC_UNSIGNED_Format)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===RED_RGTC1_Format||n===SIGNED_RED_RGTC1_Format||n===RED_GREEN_RGTC2_Format||n===SIGNED_RED_GREEN_RGTC2_Format)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===RGBA_BPTC_Format)return s.COMPRESSED_RED_RGTC1_EXT;if(n===SIGNED_RED_RGTC1_Format)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===RED_GREEN_RGTC2_Format)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===SIGNED_RED_GREEN_RGTC2_Format)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===UnsignedInt248Type?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const _occlusion_vertex=`
|
|
3796
|
+
}`;function WebGLShadowMap(i,e,t){let n=new Frustum;const r=new Vector2,s=new Vector2,a=new Vector4,o=new MeshDepthMaterial({depthPacking:RGBADepthPacking}),l=new MeshDistanceMaterial,h={},u=t.maxTextureSize,p={[FrontSide]:BackSide,[BackSide]:FrontSide,[DoubleSide]:DoubleSide},f=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:vertex,fragmentShader:fragment}),d=f.clone();d.defines.HORIZONTAL_PASS=1;const m=new BufferGeometry;m.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Mesh(m,f),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=PCFShadowMap;let c=this.type;this.render=function(M,A,R){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||M.length===0)return;const w=i.getRenderTarget(),P=i.getActiveCubeFace(),N=i.getActiveMipmapLevel(),V=i.state;V.setBlending(NoBlending),V.buffers.color.setClear(1,1,1,1),V.buffers.depth.setTest(!0),V.setScissorTest(!1);const G=c!==VSMShadowMap&&this.type===VSMShadowMap,H=c===VSMShadowMap&&this.type!==VSMShadowMap;for(let O=0,C=M.length;O<C;O++){const L=M[O],E=L.shadow;if(E===void 0){console.warn("THREE.WebGLShadowMap:",L,"has no shadow.");continue}if(E.autoUpdate===!1&&E.needsUpdate===!1)continue;r.copy(E.mapSize);const T=E.getFrameExtents();if(r.multiply(T),s.copy(E.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/T.x),r.x=s.x*T.x,E.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/T.y),r.y=s.y*T.y,E.mapSize.y=s.y)),E.map===null||G===!0||H===!0){const B=this.type!==VSMShadowMap?{minFilter:NearestFilter,magFilter:NearestFilter}:{};E.map!==null&&E.map.dispose(),E.map=new WebGLRenderTarget(r.x,r.y,B),E.map.texture.name=L.name+".shadowMap",E.camera.updateProjectionMatrix()}i.setRenderTarget(E.map),i.clear();const k=E.getViewportCount();for(let B=0;B<k;B++){const ee=E.getViewport(B);a.set(s.x*ee.x,s.y*ee.y,s.x*ee.z,s.y*ee.w),V.viewport(a),E.updateMatrices(L,B),n=E.getFrustum(),_(A,R,E.camera,L,this.type)}E.isPointLightShadow!==!0&&this.type===VSMShadowMap&&x(E,R),E.needsUpdate=!1}c=this.type,y.needsUpdate=!1,i.setRenderTarget(w,P,N)};function x(M,A){const R=e.update(g);f.defines.VSM_SAMPLES!==M.blurSamples&&(f.defines.VSM_SAMPLES=M.blurSamples,d.defines.VSM_SAMPLES=M.blurSamples,f.needsUpdate=!0,d.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new WebGLRenderTarget(r.x,r.y)),f.uniforms.shadow_pass.value=M.map.texture,f.uniforms.resolution.value=M.mapSize,f.uniforms.radius.value=M.radius,i.setRenderTarget(M.mapPass),i.clear(),i.renderBufferDirect(A,null,R,f,g,null),d.uniforms.shadow_pass.value=M.mapPass.texture,d.uniforms.resolution.value=M.mapSize,d.uniforms.radius.value=M.radius,i.setRenderTarget(M.map),i.clear(),i.renderBufferDirect(A,null,R,d,g,null)}function v(M,A,R,w){let P=null;const N=R.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(N!==void 0)P=N;else if(P=R.isPointLight===!0?l:o,i.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const V=P.uuid,G=A.uuid;let H=h[V];H===void 0&&(H={},h[V]=H);let O=H[G];O===void 0&&(O=P.clone(),H[G]=O,A.addEventListener("dispose",b)),P=O}if(P.visible=A.visible,P.wireframe=A.wireframe,w===VSMShadowMap?P.side=A.shadowSide!==null?A.shadowSide:A.side:P.side=A.shadowSide!==null?A.shadowSide:p[A.side],P.alphaMap=A.alphaMap,P.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,P.map=A.map,P.clipShadows=A.clipShadows,P.clippingPlanes=A.clippingPlanes,P.clipIntersection=A.clipIntersection,P.displacementMap=A.displacementMap,P.displacementScale=A.displacementScale,P.displacementBias=A.displacementBias,P.wireframeLinewidth=A.wireframeLinewidth,P.linewidth=A.linewidth,R.isPointLight===!0&&P.isMeshDistanceMaterial===!0){const V=i.properties.get(P);V.light=R}return P}function _(M,A,R,w,P){if(M.visible===!1)return;if(M.layers.test(A.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&P===VSMShadowMap)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,M.matrixWorld);const G=e.update(M),H=M.material;if(Array.isArray(H)){const O=G.groups;for(let C=0,L=O.length;C<L;C++){const E=O[C],T=H[E.materialIndex];if(T&&T.visible){const k=v(M,T,w,P);M.onBeforeShadow(i,M,A,R,G,k,E),i.renderBufferDirect(R,null,G,k,M,E),M.onAfterShadow(i,M,A,R,G,k,E)}}}else if(H.visible){const O=v(M,H,w,P);M.onBeforeShadow(i,M,A,R,G,O,null),i.renderBufferDirect(R,null,G,O,M,null),M.onAfterShadow(i,M,A,R,G,O,null)}}const V=M.children;for(let G=0,H=V.length;G<H;G++)_(V[G],A,R,w,P)}function b(M){M.target.removeEventListener("dispose",b);for(const R in h){const w=h[R],P=M.target.uuid;P in w&&(w[P].dispose(),delete w[P])}}}const reversedFuncs={[NeverDepth]:AlwaysDepth,[LessDepth]:GreaterDepth,[EqualDepth]:NotEqualDepth,[LessEqualDepth]:GreaterEqualDepth,[AlwaysDepth]:NeverDepth,[GreaterDepth]:LessDepth,[NotEqualDepth]:EqualDepth,[GreaterEqualDepth]:LessEqualDepth};function WebGLState(i,e){function t(){let z=!1;const ce=new Vector4;let Z=null;const ie=new Vector4(0,0,0,0);return{setMask:function(ue){Z!==ue&&!z&&(i.colorMask(ue,ue,ue,ue),Z=ue)},setLocked:function(ue){z=ue},setClear:function(ue,fe,De,Ye,Je){Je===!0&&(ue*=Ye,fe*=Ye,De*=Ye),ce.set(ue,fe,De,Ye),ie.equals(ce)===!1&&(i.clearColor(ue,fe,De,Ye),ie.copy(ce))},reset:function(){z=!1,Z=null,ie.set(-1,0,0,0)}}}function n(){let z=!1,ce=!1,Z=null,ie=null,ue=null;return{setReversed:function(fe){if(ce!==fe){const De=e.get("EXT_clip_control");fe?De.clipControlEXT(De.LOWER_LEFT_EXT,De.ZERO_TO_ONE_EXT):De.clipControlEXT(De.LOWER_LEFT_EXT,De.NEGATIVE_ONE_TO_ONE_EXT),ce=fe;const Ye=ue;ue=null,this.setClear(Ye)}},getReversed:function(){return ce},setTest:function(fe){fe?re(i.DEPTH_TEST):me(i.DEPTH_TEST)},setMask:function(fe){Z!==fe&&!z&&(i.depthMask(fe),Z=fe)},setFunc:function(fe){if(ce&&(fe=reversedFuncs[fe]),ie!==fe){switch(fe){case NeverDepth:i.depthFunc(i.NEVER);break;case AlwaysDepth:i.depthFunc(i.ALWAYS);break;case LessDepth:i.depthFunc(i.LESS);break;case LessEqualDepth:i.depthFunc(i.LEQUAL);break;case EqualDepth:i.depthFunc(i.EQUAL);break;case GreaterEqualDepth:i.depthFunc(i.GEQUAL);break;case GreaterDepth:i.depthFunc(i.GREATER);break;case NotEqualDepth:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}ie=fe}},setLocked:function(fe){z=fe},setClear:function(fe){ue!==fe&&(ce&&(fe=1-fe),i.clearDepth(fe),ue=fe)},reset:function(){z=!1,Z=null,ie=null,ue=null,ce=!1}}}function r(){let z=!1,ce=null,Z=null,ie=null,ue=null,fe=null,De=null,Ye=null,Je=null;return{setTest:function(We){z||(We?re(i.STENCIL_TEST):me(i.STENCIL_TEST))},setMask:function(We){ce!==We&&!z&&(i.stencilMask(We),ce=We)},setFunc:function(We,rt,at){(Z!==We||ie!==rt||ue!==at)&&(i.stencilFunc(We,rt,at),Z=We,ie=rt,ue=at)},setOp:function(We,rt,at){(fe!==We||De!==rt||Ye!==at)&&(i.stencilOp(We,rt,at),fe=We,De=rt,Ye=at)},setLocked:function(We){z=We},setClear:function(We){Je!==We&&(i.clearStencil(We),Je=We)},reset:function(){z=!1,ce=null,Z=null,ie=null,ue=null,fe=null,De=null,Ye=null,Je=null}}}const s=new t,a=new n,o=new r,l=new WeakMap,h=new WeakMap;let u={},p={},f=new WeakMap,d=[],m=null,g=!1,y=null,c=null,x=null,v=null,_=null,b=null,M=null,A=new Color(0,0,0),R=0,w=!1,P=null,N=null,V=null,G=null,H=null;const O=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let C=!1,L=0;const E=i.getParameter(i.VERSION);E.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(E)[1]),C=L>=1):E.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(E)[1]),C=L>=2);let T=null,k={};const B=i.getParameter(i.SCISSOR_BOX),ee=i.getParameter(i.VIEWPORT),oe=new Vector4().fromArray(B),X=new Vector4().fromArray(ee);function Q(z,ce,Z,ie){const ue=new Uint8Array(4),fe=i.createTexture();i.bindTexture(z,fe),i.texParameteri(z,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(z,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let De=0;De<Z;De++)z===i.TEXTURE_3D||z===i.TEXTURE_2D_ARRAY?i.texImage3D(ce,0,i.RGBA,1,1,ie,0,i.RGBA,i.UNSIGNED_BYTE,ue):i.texImage2D(ce+De,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,ue);return fe}const ne={};ne[i.TEXTURE_2D]=Q(i.TEXTURE_2D,i.TEXTURE_2D,1),ne[i.TEXTURE_CUBE_MAP]=Q(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),ne[i.TEXTURE_2D_ARRAY]=Q(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),ne[i.TEXTURE_3D]=Q(i.TEXTURE_3D,i.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),re(i.DEPTH_TEST),a.setFunc(LessEqualDepth),Le(!1),Ie(CullFaceBack),re(i.CULL_FACE),U(NoBlending);function re(z){u[z]!==!0&&(i.enable(z),u[z]=!0)}function me(z){u[z]!==!1&&(i.disable(z),u[z]=!1)}function Fe(z,ce){return p[z]!==ce?(i.bindFramebuffer(z,ce),p[z]=ce,z===i.DRAW_FRAMEBUFFER&&(p[i.FRAMEBUFFER]=ce),z===i.FRAMEBUFFER&&(p[i.DRAW_FRAMEBUFFER]=ce),!0):!1}function Ee(z,ce){let Z=d,ie=!1;if(z){Z=f.get(ce),Z===void 0&&(Z=[],f.set(ce,Z));const ue=z.textures;if(Z.length!==ue.length||Z[0]!==i.COLOR_ATTACHMENT0){for(let fe=0,De=ue.length;fe<De;fe++)Z[fe]=i.COLOR_ATTACHMENT0+fe;Z.length=ue.length,ie=!0}}else Z[0]!==i.BACK&&(Z[0]=i.BACK,ie=!0);ie&&i.drawBuffers(Z)}function Ne(z){return m!==z?(i.useProgram(z),m=z,!0):!1}const Be={[AddEquation]:i.FUNC_ADD,[SubtractEquation]:i.FUNC_SUBTRACT,[ReverseSubtractEquation]:i.FUNC_REVERSE_SUBTRACT};Be[MinEquation]=i.MIN,Be[MaxEquation]=i.MAX;const _e={[ZeroFactor]:i.ZERO,[OneFactor]:i.ONE,[SrcColorFactor]:i.SRC_COLOR,[SrcAlphaFactor]:i.SRC_ALPHA,[SrcAlphaSaturateFactor]:i.SRC_ALPHA_SATURATE,[DstColorFactor]:i.DST_COLOR,[DstAlphaFactor]:i.DST_ALPHA,[OneMinusSrcColorFactor]:i.ONE_MINUS_SRC_COLOR,[OneMinusSrcAlphaFactor]:i.ONE_MINUS_SRC_ALPHA,[OneMinusDstColorFactor]:i.ONE_MINUS_DST_COLOR,[OneMinusDstAlphaFactor]:i.ONE_MINUS_DST_ALPHA,[ConstantColorFactor]:i.CONSTANT_COLOR,[OneMinusConstantColorFactor]:i.ONE_MINUS_CONSTANT_COLOR,[ConstantAlphaFactor]:i.CONSTANT_ALPHA,[OneMinusConstantAlphaFactor]:i.ONE_MINUS_CONSTANT_ALPHA};function U(z,ce,Z,ie,ue,fe,De,Ye,Je,We){if(z===NoBlending){g===!0&&(me(i.BLEND),g=!1);return}if(g===!1&&(re(i.BLEND),g=!0),z!==CustomBlending){if(z!==y||We!==w){if((c!==AddEquation||_!==AddEquation)&&(i.blendEquation(i.FUNC_ADD),c=AddEquation,_=AddEquation),We)switch(z){case NormalBlending:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case AdditiveBlending:i.blendFunc(i.ONE,i.ONE);break;case SubtractiveBlending:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case MultiplyBlending:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}else switch(z){case NormalBlending:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case AdditiveBlending:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case SubtractiveBlending:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case MultiplyBlending:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",z);break}x=null,v=null,b=null,M=null,A.set(0,0,0),R=0,y=z,w=We}return}ue=ue||ce,fe=fe||Z,De=De||ie,(ce!==c||ue!==_)&&(i.blendEquationSeparate(Be[ce],Be[ue]),c=ce,_=ue),(Z!==x||ie!==v||fe!==b||De!==M)&&(i.blendFuncSeparate(_e[Z],_e[ie],_e[fe],_e[De]),x=Z,v=ie,b=fe,M=De),(Ye.equals(A)===!1||Je!==R)&&(i.blendColor(Ye.r,Ye.g,Ye.b,Je),A.copy(Ye),R=Je),y=z,w=!1}function qe(z,ce){z.side===DoubleSide?me(i.CULL_FACE):re(i.CULL_FACE);let Z=z.side===BackSide;ce&&(Z=!Z),Le(Z),z.blending===NormalBlending&&z.transparent===!1?U(NoBlending):U(z.blending,z.blendEquation,z.blendSrc,z.blendDst,z.blendEquationAlpha,z.blendSrcAlpha,z.blendDstAlpha,z.blendColor,z.blendAlpha,z.premultipliedAlpha),a.setFunc(z.depthFunc),a.setTest(z.depthTest),a.setMask(z.depthWrite),s.setMask(z.colorWrite);const ie=z.stencilWrite;o.setTest(ie),ie&&(o.setMask(z.stencilWriteMask),o.setFunc(z.stencilFunc,z.stencilRef,z.stencilFuncMask),o.setOp(z.stencilFail,z.stencilZFail,z.stencilZPass)),ke(z.polygonOffset,z.polygonOffsetFactor,z.polygonOffsetUnits),z.alphaToCoverage===!0?re(i.SAMPLE_ALPHA_TO_COVERAGE):me(i.SAMPLE_ALPHA_TO_COVERAGE)}function Le(z){P!==z&&(z?i.frontFace(i.CW):i.frontFace(i.CCW),P=z)}function Ie(z){z!==CullFaceNone?(re(i.CULL_FACE),z!==N&&(z===CullFaceBack?i.cullFace(i.BACK):z===CullFaceFront?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):me(i.CULL_FACE),N=z}function ge(z){z!==V&&(C&&i.lineWidth(z),V=z)}function ke(z,ce,Z){z?(re(i.POLYGON_OFFSET_FILL),(G!==ce||H!==Z)&&(i.polygonOffset(ce,Z),G=ce,H=Z)):me(i.POLYGON_OFFSET_FILL)}function ve(z){z?re(i.SCISSOR_TEST):me(i.SCISSOR_TEST)}function D(z){z===void 0&&(z=i.TEXTURE0+O-1),T!==z&&(i.activeTexture(z),T=z)}function I(z,ce,Z){Z===void 0&&(T===null?Z=i.TEXTURE0+O-1:Z=T);let ie=k[Z];ie===void 0&&(ie={type:void 0,texture:void 0},k[Z]=ie),(ie.type!==z||ie.texture!==ce)&&(T!==Z&&(i.activeTexture(Z),T=Z),i.bindTexture(z,ce||ne[z]),ie.type=z,ie.texture=ce)}function q(){const z=k[T];z!==void 0&&z.type!==void 0&&(i.bindTexture(z.type,null),z.type=void 0,z.texture=void 0)}function J(){try{i.compressedTexImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function te(){try{i.compressedTexImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function K(){try{i.texSubImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function de(){try{i.texSubImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function le(){try{i.compressedTexSubImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Me(){try{i.compressedTexSubImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function be(){try{i.texStorage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function se(){try{i.texStorage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function ye(){try{i.texImage2D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Ce(){try{i.texImage3D(...arguments)}catch(z){console.error("THREE.WebGLState:",z)}}function Pe(z){oe.equals(z)===!1&&(i.scissor(z.x,z.y,z.z,z.w),oe.copy(z))}function xe(z){X.equals(z)===!1&&(i.viewport(z.x,z.y,z.z,z.w),X.copy(z))}function Ve(z,ce){let Z=h.get(ce);Z===void 0&&(Z=new WeakMap,h.set(ce,Z));let ie=Z.get(z);ie===void 0&&(ie=i.getUniformBlockIndex(ce,z.name),Z.set(z,ie))}function Ue(z,ce){const ie=h.get(ce).get(z);l.get(ce)!==ie&&(i.uniformBlockBinding(ce,ie,z.__bindingPointIndex),l.set(ce,ie))}function $e(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),a.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),u={},T=null,k={},p={},f=new WeakMap,d=[],m=null,g=!1,y=null,c=null,x=null,v=null,_=null,b=null,M=null,A=new Color(0,0,0),R=0,w=!1,P=null,N=null,V=null,G=null,H=null,oe.set(0,0,i.canvas.width,i.canvas.height),X.set(0,0,i.canvas.width,i.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:re,disable:me,bindFramebuffer:Fe,drawBuffers:Ee,useProgram:Ne,setBlending:U,setMaterial:qe,setFlipSided:Le,setCullFace:Ie,setLineWidth:ge,setPolygonOffset:ke,setScissorTest:ve,activeTexture:D,bindTexture:I,unbindTexture:q,compressedTexImage2D:J,compressedTexImage3D:te,texImage2D:ye,texImage3D:Ce,updateUBOMapping:Ve,uniformBlockBinding:Ue,texStorage2D:be,texStorage3D:se,texSubImage2D:K,texSubImage3D:de,compressedTexSubImage2D:le,compressedTexSubImage3D:Me,scissor:Pe,viewport:xe,reset:$e}}function WebGLTextures(i,e,t,n,r,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new Vector2,u=new WeakMap;let p;const f=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(D,I){return d?new OffscreenCanvas(D,I):createElementNS("canvas")}function g(D,I,q){let J=1;const te=ve(D);if((te.width>q||te.height>q)&&(J=q/Math.max(te.width,te.height)),J<1)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap||typeof VideoFrame<"u"&&D instanceof VideoFrame){const K=Math.floor(J*te.width),de=Math.floor(J*te.height);p===void 0&&(p=m(K,de));const le=I?m(K,de):p;return le.width=K,le.height=de,le.getContext("2d").drawImage(D,0,0,K,de),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+te.width+"x"+te.height+") to ("+K+"x"+de+")."),le}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+te.width+"x"+te.height+")."),D;return D}function y(D){return D.generateMipmaps}function c(D){i.generateMipmap(D)}function x(D){return D.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:D.isWebGL3DRenderTarget?i.TEXTURE_3D:D.isWebGLArrayRenderTarget||D.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function v(D,I,q,J,te=!1){if(D!==null){if(i[D]!==void 0)return i[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let K=I;if(I===i.RED&&(q===i.FLOAT&&(K=i.R32F),q===i.HALF_FLOAT&&(K=i.R16F),q===i.UNSIGNED_BYTE&&(K=i.R8)),I===i.RED_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.R8UI),q===i.UNSIGNED_SHORT&&(K=i.R16UI),q===i.UNSIGNED_INT&&(K=i.R32UI),q===i.BYTE&&(K=i.R8I),q===i.SHORT&&(K=i.R16I),q===i.INT&&(K=i.R32I)),I===i.RG&&(q===i.FLOAT&&(K=i.RG32F),q===i.HALF_FLOAT&&(K=i.RG16F),q===i.UNSIGNED_BYTE&&(K=i.RG8)),I===i.RG_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.RG8UI),q===i.UNSIGNED_SHORT&&(K=i.RG16UI),q===i.UNSIGNED_INT&&(K=i.RG32UI),q===i.BYTE&&(K=i.RG8I),q===i.SHORT&&(K=i.RG16I),q===i.INT&&(K=i.RG32I)),I===i.RGB_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.RGB8UI),q===i.UNSIGNED_SHORT&&(K=i.RGB16UI),q===i.UNSIGNED_INT&&(K=i.RGB32UI),q===i.BYTE&&(K=i.RGB8I),q===i.SHORT&&(K=i.RGB16I),q===i.INT&&(K=i.RGB32I)),I===i.RGBA_INTEGER&&(q===i.UNSIGNED_BYTE&&(K=i.RGBA8UI),q===i.UNSIGNED_SHORT&&(K=i.RGBA16UI),q===i.UNSIGNED_INT&&(K=i.RGBA32UI),q===i.BYTE&&(K=i.RGBA8I),q===i.SHORT&&(K=i.RGBA16I),q===i.INT&&(K=i.RGBA32I)),I===i.RGB&&q===i.UNSIGNED_INT_5_9_9_9_REV&&(K=i.RGB9_E5),I===i.RGBA){const de=te?LinearTransfer:ColorManagement.getTransfer(J);q===i.FLOAT&&(K=i.RGBA32F),q===i.HALF_FLOAT&&(K=i.RGBA16F),q===i.UNSIGNED_BYTE&&(K=de===SRGBTransfer?i.SRGB8_ALPHA8:i.RGBA8),q===i.UNSIGNED_SHORT_4_4_4_4&&(K=i.RGBA4),q===i.UNSIGNED_SHORT_5_5_5_1&&(K=i.RGB5_A1)}return(K===i.R16F||K===i.R32F||K===i.RG16F||K===i.RG32F||K===i.RGBA16F||K===i.RGBA32F)&&e.get("EXT_color_buffer_float"),K}function _(D,I){let q;return D?I===null||I===UnsignedIntType||I===UnsignedInt248Type?q=i.DEPTH24_STENCIL8:I===FloatType?q=i.DEPTH32F_STENCIL8:I===UnsignedShortType&&(q=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):I===null||I===UnsignedIntType||I===UnsignedInt248Type?q=i.DEPTH_COMPONENT24:I===FloatType?q=i.DEPTH_COMPONENT32F:I===UnsignedShortType&&(q=i.DEPTH_COMPONENT16),q}function b(D,I){return y(D)===!0||D.isFramebufferTexture&&D.minFilter!==NearestFilter&&D.minFilter!==LinearFilter?Math.log2(Math.max(I.width,I.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?I.mipmaps.length:1}function M(D){const I=D.target;I.removeEventListener("dispose",M),R(I),I.isVideoTexture&&u.delete(I)}function A(D){const I=D.target;I.removeEventListener("dispose",A),P(I)}function R(D){const I=n.get(D);if(I.__webglInit===void 0)return;const q=D.source,J=f.get(q);if(J){const te=J[I.__cacheKey];te.usedTimes--,te.usedTimes===0&&w(D),Object.keys(J).length===0&&f.delete(q)}n.remove(D)}function w(D){const I=n.get(D);i.deleteTexture(I.__webglTexture);const q=D.source,J=f.get(q);delete J[I.__cacheKey],a.memory.textures--}function P(D){const I=n.get(D);if(D.depthTexture&&(D.depthTexture.dispose(),n.remove(D.depthTexture)),D.isWebGLCubeRenderTarget)for(let J=0;J<6;J++){if(Array.isArray(I.__webglFramebuffer[J]))for(let te=0;te<I.__webglFramebuffer[J].length;te++)i.deleteFramebuffer(I.__webglFramebuffer[J][te]);else i.deleteFramebuffer(I.__webglFramebuffer[J]);I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer[J])}else{if(Array.isArray(I.__webglFramebuffer))for(let J=0;J<I.__webglFramebuffer.length;J++)i.deleteFramebuffer(I.__webglFramebuffer[J]);else i.deleteFramebuffer(I.__webglFramebuffer);if(I.__webglDepthbuffer&&i.deleteRenderbuffer(I.__webglDepthbuffer),I.__webglMultisampledFramebuffer&&i.deleteFramebuffer(I.__webglMultisampledFramebuffer),I.__webglColorRenderbuffer)for(let J=0;J<I.__webglColorRenderbuffer.length;J++)I.__webglColorRenderbuffer[J]&&i.deleteRenderbuffer(I.__webglColorRenderbuffer[J]);I.__webglDepthRenderbuffer&&i.deleteRenderbuffer(I.__webglDepthRenderbuffer)}const q=D.textures;for(let J=0,te=q.length;J<te;J++){const K=n.get(q[J]);K.__webglTexture&&(i.deleteTexture(K.__webglTexture),a.memory.textures--),n.remove(q[J])}n.remove(D)}let N=0;function V(){N=0}function G(){const D=N;return D>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+r.maxTextures),N+=1,D}function H(D){const I=[];return I.push(D.wrapS),I.push(D.wrapT),I.push(D.wrapR||0),I.push(D.magFilter),I.push(D.minFilter),I.push(D.anisotropy),I.push(D.internalFormat),I.push(D.format),I.push(D.type),I.push(D.generateMipmaps),I.push(D.premultiplyAlpha),I.push(D.flipY),I.push(D.unpackAlignment),I.push(D.colorSpace),I.join()}function O(D,I){const q=n.get(D);if(D.isVideoTexture&&ge(D),D.isRenderTargetTexture===!1&&D.version>0&&q.__version!==D.version){const J=D.image;if(J===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(J.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{X(q,D,I);return}}t.bindTexture(i.TEXTURE_2D,q.__webglTexture,i.TEXTURE0+I)}function C(D,I){const q=n.get(D);if(D.version>0&&q.__version!==D.version){X(q,D,I);return}t.bindTexture(i.TEXTURE_2D_ARRAY,q.__webglTexture,i.TEXTURE0+I)}function L(D,I){const q=n.get(D);if(D.version>0&&q.__version!==D.version){X(q,D,I);return}t.bindTexture(i.TEXTURE_3D,q.__webglTexture,i.TEXTURE0+I)}function E(D,I){const q=n.get(D);if(D.version>0&&q.__version!==D.version){Q(q,D,I);return}t.bindTexture(i.TEXTURE_CUBE_MAP,q.__webglTexture,i.TEXTURE0+I)}const T={[RepeatWrapping]:i.REPEAT,[ClampToEdgeWrapping]:i.CLAMP_TO_EDGE,[MirroredRepeatWrapping]:i.MIRRORED_REPEAT},k={[NearestFilter]:i.NEAREST,[NearestMipmapNearestFilter]:i.NEAREST_MIPMAP_NEAREST,[NearestMipmapLinearFilter]:i.NEAREST_MIPMAP_LINEAR,[LinearFilter]:i.LINEAR,[LinearMipmapNearestFilter]:i.LINEAR_MIPMAP_NEAREST,[LinearMipmapLinearFilter]:i.LINEAR_MIPMAP_LINEAR},B={[NeverCompare]:i.NEVER,[AlwaysCompare]:i.ALWAYS,[LessCompare]:i.LESS,[LessEqualCompare]:i.LEQUAL,[EqualCompare]:i.EQUAL,[GreaterEqualCompare]:i.GEQUAL,[GreaterCompare]:i.GREATER,[NotEqualCompare]:i.NOTEQUAL};function ee(D,I){if(I.type===FloatType&&e.has("OES_texture_float_linear")===!1&&(I.magFilter===LinearFilter||I.magFilter===LinearMipmapNearestFilter||I.magFilter===NearestMipmapLinearFilter||I.magFilter===LinearMipmapLinearFilter||I.minFilter===LinearFilter||I.minFilter===LinearMipmapNearestFilter||I.minFilter===NearestMipmapLinearFilter||I.minFilter===LinearMipmapLinearFilter)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(D,i.TEXTURE_WRAP_S,T[I.wrapS]),i.texParameteri(D,i.TEXTURE_WRAP_T,T[I.wrapT]),(D===i.TEXTURE_3D||D===i.TEXTURE_2D_ARRAY)&&i.texParameteri(D,i.TEXTURE_WRAP_R,T[I.wrapR]),i.texParameteri(D,i.TEXTURE_MAG_FILTER,k[I.magFilter]),i.texParameteri(D,i.TEXTURE_MIN_FILTER,k[I.minFilter]),I.compareFunction&&(i.texParameteri(D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(D,i.TEXTURE_COMPARE_FUNC,B[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(I.magFilter===NearestFilter||I.minFilter!==NearestMipmapLinearFilter&&I.minFilter!==LinearMipmapLinearFilter||I.type===FloatType&&e.has("OES_texture_float_linear")===!1)return;if(I.anisotropy>1||n.get(I).__currentAnisotropy){const q=e.get("EXT_texture_filter_anisotropic");i.texParameterf(D,q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,r.getMaxAnisotropy())),n.get(I).__currentAnisotropy=I.anisotropy}}}function oe(D,I){let q=!1;D.__webglInit===void 0&&(D.__webglInit=!0,I.addEventListener("dispose",M));const J=I.source;let te=f.get(J);te===void 0&&(te={},f.set(J,te));const K=H(I);if(K!==D.__cacheKey){te[K]===void 0&&(te[K]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,q=!0),te[K].usedTimes++;const de=te[D.__cacheKey];de!==void 0&&(te[D.__cacheKey].usedTimes--,de.usedTimes===0&&w(I)),D.__cacheKey=K,D.__webglTexture=te[K].texture}return q}function X(D,I,q){let J=i.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(J=i.TEXTURE_2D_ARRAY),I.isData3DTexture&&(J=i.TEXTURE_3D);const te=oe(D,I),K=I.source;t.bindTexture(J,D.__webglTexture,i.TEXTURE0+q);const de=n.get(K);if(K.version!==de.__version||te===!0){t.activeTexture(i.TEXTURE0+q);const le=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),Me=I.colorSpace===NoColorSpace?null:ColorManagement.getPrimaries(I.colorSpace),be=I.colorSpace===NoColorSpace||le===Me?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,be);let se=g(I.image,!1,r.maxTextureSize);se=ke(I,se);const ye=s.convert(I.format,I.colorSpace),Ce=s.convert(I.type);let Pe=v(I.internalFormat,ye,Ce,I.colorSpace,I.isVideoTexture);ee(J,I);let xe;const Ve=I.mipmaps,Ue=I.isVideoTexture!==!0,$e=de.__version===void 0||te===!0,z=K.dataReady,ce=b(I,se);if(I.isDepthTexture)Pe=_(I.format===DepthStencilFormat,I.type),$e&&(Ue?t.texStorage2D(i.TEXTURE_2D,1,Pe,se.width,se.height):t.texImage2D(i.TEXTURE_2D,0,Pe,se.width,se.height,0,ye,Ce,null));else if(I.isDataTexture)if(Ve.length>0){Ue&&$e&&t.texStorage2D(i.TEXTURE_2D,ce,Pe,Ve[0].width,Ve[0].height);for(let Z=0,ie=Ve.length;Z<ie;Z++)xe=Ve[Z],Ue?z&&t.texSubImage2D(i.TEXTURE_2D,Z,0,0,xe.width,xe.height,ye,Ce,xe.data):t.texImage2D(i.TEXTURE_2D,Z,Pe,xe.width,xe.height,0,ye,Ce,xe.data);I.generateMipmaps=!1}else Ue?($e&&t.texStorage2D(i.TEXTURE_2D,ce,Pe,se.width,se.height),z&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,se.width,se.height,ye,Ce,se.data)):t.texImage2D(i.TEXTURE_2D,0,Pe,se.width,se.height,0,ye,Ce,se.data);else if(I.isCompressedTexture)if(I.isCompressedArrayTexture){Ue&&$e&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ce,Pe,Ve[0].width,Ve[0].height,se.depth);for(let Z=0,ie=Ve.length;Z<ie;Z++)if(xe=Ve[Z],I.format!==RGBAFormat)if(ye!==null)if(Ue){if(z)if(I.layerUpdates.size>0){const ue=getByteLength(xe.width,xe.height,I.format,I.type);for(const fe of I.layerUpdates){const De=xe.data.subarray(fe*ue/xe.data.BYTES_PER_ELEMENT,(fe+1)*ue/xe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Z,0,0,fe,xe.width,xe.height,1,ye,De)}I.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Z,0,0,0,xe.width,xe.height,se.depth,ye,xe.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,Z,Pe,xe.width,xe.height,se.depth,0,xe.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ue?z&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,Z,0,0,0,xe.width,xe.height,se.depth,ye,Ce,xe.data):t.texImage3D(i.TEXTURE_2D_ARRAY,Z,Pe,xe.width,xe.height,se.depth,0,ye,Ce,xe.data)}else{Ue&&$e&&t.texStorage2D(i.TEXTURE_2D,ce,Pe,Ve[0].width,Ve[0].height);for(let Z=0,ie=Ve.length;Z<ie;Z++)xe=Ve[Z],I.format!==RGBAFormat?ye!==null?Ue?z&&t.compressedTexSubImage2D(i.TEXTURE_2D,Z,0,0,xe.width,xe.height,ye,xe.data):t.compressedTexImage2D(i.TEXTURE_2D,Z,Pe,xe.width,xe.height,0,xe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ue?z&&t.texSubImage2D(i.TEXTURE_2D,Z,0,0,xe.width,xe.height,ye,Ce,xe.data):t.texImage2D(i.TEXTURE_2D,Z,Pe,xe.width,xe.height,0,ye,Ce,xe.data)}else if(I.isDataArrayTexture)if(Ue){if($e&&t.texStorage3D(i.TEXTURE_2D_ARRAY,ce,Pe,se.width,se.height,se.depth),z)if(I.layerUpdates.size>0){const Z=getByteLength(se.width,se.height,I.format,I.type);for(const ie of I.layerUpdates){const ue=se.data.subarray(ie*Z/se.data.BYTES_PER_ELEMENT,(ie+1)*Z/se.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,ie,se.width,se.height,1,ye,Ce,ue)}I.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,se.width,se.height,se.depth,ye,Ce,se.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Pe,se.width,se.height,se.depth,0,ye,Ce,se.data);else if(I.isData3DTexture)Ue?($e&&t.texStorage3D(i.TEXTURE_3D,ce,Pe,se.width,se.height,se.depth),z&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,se.width,se.height,se.depth,ye,Ce,se.data)):t.texImage3D(i.TEXTURE_3D,0,Pe,se.width,se.height,se.depth,0,ye,Ce,se.data);else if(I.isFramebufferTexture){if($e)if(Ue)t.texStorage2D(i.TEXTURE_2D,ce,Pe,se.width,se.height);else{let Z=se.width,ie=se.height;for(let ue=0;ue<ce;ue++)t.texImage2D(i.TEXTURE_2D,ue,Pe,Z,ie,0,ye,Ce,null),Z>>=1,ie>>=1}}else if(Ve.length>0){if(Ue&&$e){const Z=ve(Ve[0]);t.texStorage2D(i.TEXTURE_2D,ce,Pe,Z.width,Z.height)}for(let Z=0,ie=Ve.length;Z<ie;Z++)xe=Ve[Z],Ue?z&&t.texSubImage2D(i.TEXTURE_2D,Z,0,0,ye,Ce,xe):t.texImage2D(i.TEXTURE_2D,Z,Pe,ye,Ce,xe);I.generateMipmaps=!1}else if(Ue){if($e){const Z=ve(se);t.texStorage2D(i.TEXTURE_2D,ce,Pe,Z.width,Z.height)}z&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,ye,Ce,se)}else t.texImage2D(i.TEXTURE_2D,0,Pe,ye,Ce,se);y(I)&&c(J),de.__version=K.version,I.onUpdate&&I.onUpdate(I)}D.__version=I.version}function Q(D,I,q){if(I.image.length!==6)return;const J=oe(D,I),te=I.source;t.bindTexture(i.TEXTURE_CUBE_MAP,D.__webglTexture,i.TEXTURE0+q);const K=n.get(te);if(te.version!==K.__version||J===!0){t.activeTexture(i.TEXTURE0+q);const de=ColorManagement.getPrimaries(ColorManagement.workingColorSpace),le=I.colorSpace===NoColorSpace?null:ColorManagement.getPrimaries(I.colorSpace),Me=I.colorSpace===NoColorSpace||de===le?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,I.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,I.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,Me);const be=I.isCompressedTexture||I.image[0].isCompressedTexture,se=I.image[0]&&I.image[0].isDataTexture,ye=[];for(let ie=0;ie<6;ie++)!be&&!se?ye[ie]=g(I.image[ie],!0,r.maxCubemapSize):ye[ie]=se?I.image[ie].image:I.image[ie],ye[ie]=ke(I,ye[ie]);const Ce=ye[0],Pe=s.convert(I.format,I.colorSpace),xe=s.convert(I.type),Ve=v(I.internalFormat,Pe,xe,I.colorSpace),Ue=I.isVideoTexture!==!0,$e=K.__version===void 0||J===!0,z=te.dataReady;let ce=b(I,Ce);ee(i.TEXTURE_CUBE_MAP,I);let Z;if(be){Ue&&$e&&t.texStorage2D(i.TEXTURE_CUBE_MAP,ce,Ve,Ce.width,Ce.height);for(let ie=0;ie<6;ie++){Z=ye[ie].mipmaps;for(let ue=0;ue<Z.length;ue++){const fe=Z[ue];I.format!==RGBAFormat?Pe!==null?Ue?z&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,0,0,fe.width,fe.height,Pe,fe.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,Ve,fe.width,fe.height,0,fe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,0,0,fe.width,fe.height,Pe,xe,fe.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue,Ve,fe.width,fe.height,0,Pe,xe,fe.data)}}}else{if(Z=I.mipmaps,Ue&&$e){Z.length>0&&ce++;const ie=ve(ye[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,ce,Ve,ie.width,ie.height)}for(let ie=0;ie<6;ie++)if(se){Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,ye[ie].width,ye[ie].height,Pe,xe,ye[ie].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ve,ye[ie].width,ye[ie].height,0,Pe,xe,ye[ie].data);for(let ue=0;ue<Z.length;ue++){const De=Z[ue].image[ie].image;Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,0,0,De.width,De.height,Pe,xe,De.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,Ve,De.width,De.height,0,Pe,xe,De.data)}}else{Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,Pe,xe,ye[ie]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,Ve,Pe,xe,ye[ie]);for(let ue=0;ue<Z.length;ue++){const fe=Z[ue];Ue?z&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,0,0,Pe,xe,fe.image[ie]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ue+1,Ve,Pe,xe,fe.image[ie])}}}y(I)&&c(i.TEXTURE_CUBE_MAP),K.__version=te.version,I.onUpdate&&I.onUpdate(I)}D.__version=I.version}function ne(D,I,q,J,te,K){const de=s.convert(q.format,q.colorSpace),le=s.convert(q.type),Me=v(q.internalFormat,de,le,q.colorSpace),be=n.get(I),se=n.get(q);if(se.__renderTarget=I,!be.__hasExternalTextures){const ye=Math.max(1,I.width>>K),Ce=Math.max(1,I.height>>K);te===i.TEXTURE_3D||te===i.TEXTURE_2D_ARRAY?t.texImage3D(te,K,Me,ye,Ce,I.depth,0,de,le,null):t.texImage2D(te,K,Me,ye,Ce,0,de,le,null)}t.bindFramebuffer(i.FRAMEBUFFER,D),Ie(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,J,te,se.__webglTexture,0,Le(I)):(te===i.TEXTURE_2D||te>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&te<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,J,te,se.__webglTexture,K),t.bindFramebuffer(i.FRAMEBUFFER,null)}function re(D,I,q){if(i.bindRenderbuffer(i.RENDERBUFFER,D),I.depthBuffer){const J=I.depthTexture,te=J&&J.isDepthTexture?J.type:null,K=_(I.stencilBuffer,te),de=I.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,le=Le(I);Ie(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,le,K,I.width,I.height):q?i.renderbufferStorageMultisample(i.RENDERBUFFER,le,K,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,K,I.width,I.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,de,i.RENDERBUFFER,D)}else{const J=I.textures;for(let te=0;te<J.length;te++){const K=J[te],de=s.convert(K.format,K.colorSpace),le=s.convert(K.type),Me=v(K.internalFormat,de,le,K.colorSpace),be=Le(I);q&&Ie(I)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,be,Me,I.width,I.height):Ie(I)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,be,Me,I.width,I.height):i.renderbufferStorage(i.RENDERBUFFER,Me,I.width,I.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function me(D,I){if(I&&I.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,D),!(I.depthTexture&&I.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const J=n.get(I.depthTexture);J.__renderTarget=I,(!J.__webglTexture||I.depthTexture.image.width!==I.width||I.depthTexture.image.height!==I.height)&&(I.depthTexture.image.width=I.width,I.depthTexture.image.height=I.height,I.depthTexture.needsUpdate=!0),O(I.depthTexture,0);const te=J.__webglTexture,K=Le(I);if(I.depthTexture.format===DepthFormat)Ie(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,te,0,K):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,te,0);else if(I.depthTexture.format===DepthStencilFormat)Ie(I)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,te,0,K):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,te,0);else throw new Error("Unknown depthTexture format")}function Fe(D){const I=n.get(D),q=D.isWebGLCubeRenderTarget===!0;if(I.__boundDepthTexture!==D.depthTexture){const J=D.depthTexture;if(I.__depthDisposeCallback&&I.__depthDisposeCallback(),J){const te=()=>{delete I.__boundDepthTexture,delete I.__depthDisposeCallback,J.removeEventListener("dispose",te)};J.addEventListener("dispose",te),I.__depthDisposeCallback=te}I.__boundDepthTexture=J}if(D.depthTexture&&!I.__autoAllocateDepthBuffer){if(q)throw new Error("target.depthTexture not supported in Cube render targets");const J=D.texture.mipmaps;J&&J.length>0?me(I.__webglFramebuffer[0],D):me(I.__webglFramebuffer,D)}else if(q){I.__webglDepthbuffer=[];for(let J=0;J<6;J++)if(t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[J]),I.__webglDepthbuffer[J]===void 0)I.__webglDepthbuffer[J]=i.createRenderbuffer(),re(I.__webglDepthbuffer[J],D,!1);else{const te=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=I.__webglDepthbuffer[J];i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,te,i.RENDERBUFFER,K)}}else{const J=D.texture.mipmaps;if(J&&J.length>0?t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,I.__webglFramebuffer),I.__webglDepthbuffer===void 0)I.__webglDepthbuffer=i.createRenderbuffer(),re(I.__webglDepthbuffer,D,!1);else{const te=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,K=I.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,K),i.framebufferRenderbuffer(i.FRAMEBUFFER,te,i.RENDERBUFFER,K)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function Ee(D,I,q){const J=n.get(D);I!==void 0&&ne(J.__webglFramebuffer,D,D.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),q!==void 0&&Fe(D)}function Ne(D){const I=D.texture,q=n.get(D),J=n.get(I);D.addEventListener("dispose",A);const te=D.textures,K=D.isWebGLCubeRenderTarget===!0,de=te.length>1;if(de||(J.__webglTexture===void 0&&(J.__webglTexture=i.createTexture()),J.__version=I.version,a.memory.textures++),K){q.__webglFramebuffer=[];for(let le=0;le<6;le++)if(I.mipmaps&&I.mipmaps.length>0){q.__webglFramebuffer[le]=[];for(let Me=0;Me<I.mipmaps.length;Me++)q.__webglFramebuffer[le][Me]=i.createFramebuffer()}else q.__webglFramebuffer[le]=i.createFramebuffer()}else{if(I.mipmaps&&I.mipmaps.length>0){q.__webglFramebuffer=[];for(let le=0;le<I.mipmaps.length;le++)q.__webglFramebuffer[le]=i.createFramebuffer()}else q.__webglFramebuffer=i.createFramebuffer();if(de)for(let le=0,Me=te.length;le<Me;le++){const be=n.get(te[le]);be.__webglTexture===void 0&&(be.__webglTexture=i.createTexture(),a.memory.textures++)}if(D.samples>0&&Ie(D)===!1){q.__webglMultisampledFramebuffer=i.createFramebuffer(),q.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,q.__webglMultisampledFramebuffer);for(let le=0;le<te.length;le++){const Me=te[le];q.__webglColorRenderbuffer[le]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,q.__webglColorRenderbuffer[le]);const be=s.convert(Me.format,Me.colorSpace),se=s.convert(Me.type),ye=v(Me.internalFormat,be,se,Me.colorSpace,D.isXRRenderTarget===!0),Ce=Le(D);i.renderbufferStorageMultisample(i.RENDERBUFFER,Ce,ye,D.width,D.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+le,i.RENDERBUFFER,q.__webglColorRenderbuffer[le])}i.bindRenderbuffer(i.RENDERBUFFER,null),D.depthBuffer&&(q.__webglDepthRenderbuffer=i.createRenderbuffer(),re(q.__webglDepthRenderbuffer,D,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(K){t.bindTexture(i.TEXTURE_CUBE_MAP,J.__webglTexture),ee(i.TEXTURE_CUBE_MAP,I);for(let le=0;le<6;le++)if(I.mipmaps&&I.mipmaps.length>0)for(let Me=0;Me<I.mipmaps.length;Me++)ne(q.__webglFramebuffer[le][Me],D,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+le,Me);else ne(q.__webglFramebuffer[le],D,I,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+le,0);y(I)&&c(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(de){for(let le=0,Me=te.length;le<Me;le++){const be=te[le],se=n.get(be);t.bindTexture(i.TEXTURE_2D,se.__webglTexture),ee(i.TEXTURE_2D,be),ne(q.__webglFramebuffer,D,be,i.COLOR_ATTACHMENT0+le,i.TEXTURE_2D,0),y(be)&&c(i.TEXTURE_2D)}t.unbindTexture()}else{let le=i.TEXTURE_2D;if((D.isWebGL3DRenderTarget||D.isWebGLArrayRenderTarget)&&(le=D.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(le,J.__webglTexture),ee(le,I),I.mipmaps&&I.mipmaps.length>0)for(let Me=0;Me<I.mipmaps.length;Me++)ne(q.__webglFramebuffer[Me],D,I,i.COLOR_ATTACHMENT0,le,Me);else ne(q.__webglFramebuffer,D,I,i.COLOR_ATTACHMENT0,le,0);y(I)&&c(le),t.unbindTexture()}D.depthBuffer&&Fe(D)}function Be(D){const I=D.textures;for(let q=0,J=I.length;q<J;q++){const te=I[q];if(y(te)){const K=x(D),de=n.get(te).__webglTexture;t.bindTexture(K,de),c(K),t.unbindTexture()}}}const _e=[],U=[];function qe(D){if(D.samples>0){if(Ie(D)===!1){const I=D.textures,q=D.width,J=D.height;let te=i.COLOR_BUFFER_BIT;const K=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,de=n.get(D),le=I.length>1;if(le)for(let be=0;be<I.length;be++)t.bindFramebuffer(i.FRAMEBUFFER,de.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,de.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,de.__webglMultisampledFramebuffer);const Me=D.texture.mipmaps;Me&&Me.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,de.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,de.__webglFramebuffer);for(let be=0;be<I.length;be++){if(D.resolveDepthBuffer&&(D.depthBuffer&&(te|=i.DEPTH_BUFFER_BIT),D.stencilBuffer&&D.resolveStencilBuffer&&(te|=i.STENCIL_BUFFER_BIT)),le){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,de.__webglColorRenderbuffer[be]);const se=n.get(I[be]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,se,0)}i.blitFramebuffer(0,0,q,J,0,0,q,J,te,i.NEAREST),l===!0&&(_e.length=0,U.length=0,_e.push(i.COLOR_ATTACHMENT0+be),D.depthBuffer&&D.resolveDepthBuffer===!1&&(_e.push(K),U.push(K),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,U)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,_e))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),le)for(let be=0;be<I.length;be++){t.bindFramebuffer(i.FRAMEBUFFER,de.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.RENDERBUFFER,de.__webglColorRenderbuffer[be]);const se=n.get(I[be]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,de.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+be,i.TEXTURE_2D,se,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,de.__webglMultisampledFramebuffer)}else if(D.depthBuffer&&D.resolveDepthBuffer===!1&&l){const I=D.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[I])}}}function Le(D){return Math.min(r.maxSamples,D.samples)}function Ie(D){const I=n.get(D);return D.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ge(D){const I=a.render.frame;u.get(D)!==I&&(u.set(D,I),D.update())}function ke(D,I){const q=D.colorSpace,J=D.format,te=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||q!==LinearSRGBColorSpace&&q!==NoColorSpace&&(ColorManagement.getTransfer(q)===SRGBTransfer?(J!==RGBAFormat||te!==UnsignedByteType)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",q)),I}function ve(D){return typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement?(h.width=D.naturalWidth||D.width,h.height=D.naturalHeight||D.height):typeof VideoFrame<"u"&&D instanceof VideoFrame?(h.width=D.displayWidth,h.height=D.displayHeight):(h.width=D.width,h.height=D.height),h}this.allocateTextureUnit=G,this.resetTextureUnits=V,this.setTexture2D=O,this.setTexture2DArray=C,this.setTexture3D=L,this.setTextureCube=E,this.rebindTextures=Ee,this.setupRenderTarget=Ne,this.updateRenderTargetMipmap=Be,this.updateMultisampleRenderTarget=qe,this.setupDepthRenderbuffer=Fe,this.setupFrameBufferTexture=ne,this.useMultisampledRTT=Ie}function WebGLUtils(i,e){function t(n,r=NoColorSpace){let s;const a=ColorManagement.getTransfer(r);if(n===UnsignedByteType)return i.UNSIGNED_BYTE;if(n===UnsignedShort4444Type)return i.UNSIGNED_SHORT_4_4_4_4;if(n===UnsignedShort5551Type)return i.UNSIGNED_SHORT_5_5_5_1;if(n===UnsignedInt5999Type)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===ByteType)return i.BYTE;if(n===ShortType)return i.SHORT;if(n===UnsignedShortType)return i.UNSIGNED_SHORT;if(n===IntType)return i.INT;if(n===UnsignedIntType)return i.UNSIGNED_INT;if(n===FloatType)return i.FLOAT;if(n===HalfFloatType)return i.HALF_FLOAT;if(n===AlphaFormat)return i.ALPHA;if(n===RGBFormat)return i.RGB;if(n===RGBAFormat)return i.RGBA;if(n===DepthFormat)return i.DEPTH_COMPONENT;if(n===DepthStencilFormat)return i.DEPTH_STENCIL;if(n===RedFormat)return i.RED;if(n===RedIntegerFormat)return i.RED_INTEGER;if(n===RGFormat)return i.RG;if(n===RGIntegerFormat)return i.RG_INTEGER;if(n===RGBAIntegerFormat)return i.RGBA_INTEGER;if(n===RGB_S3TC_DXT1_Format||n===RGBA_S3TC_DXT1_Format||n===RGBA_S3TC_DXT3_Format||n===RGBA_S3TC_DXT5_Format)if(a===SRGBTransfer)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===RGB_S3TC_DXT1_Format)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT1_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT3_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===RGBA_S3TC_DXT5_Format)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===RGB_S3TC_DXT1_Format)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT1_Format)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===RGBA_S3TC_DXT3_Format)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===RGBA_S3TC_DXT5_Format)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===RGB_PVRTC_4BPPV1_Format||n===RGB_PVRTC_2BPPV1_Format||n===RGBA_PVRTC_4BPPV1_Format||n===RGBA_PVRTC_2BPPV1_Format)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===RGB_PVRTC_4BPPV1_Format)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===RGB_PVRTC_2BPPV1_Format)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===RGBA_PVRTC_4BPPV1_Format)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===RGBA_PVRTC_2BPPV1_Format)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===RGB_ETC1_Format||n===RGB_ETC2_Format||n===RGBA_ETC2_EAC_Format)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===RGB_ETC1_Format||n===RGB_ETC2_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===RGBA_ETC2_EAC_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===RGBA_ASTC_4x4_Format||n===RGBA_ASTC_5x4_Format||n===RGBA_ASTC_5x5_Format||n===RGBA_ASTC_6x5_Format||n===RGBA_ASTC_6x6_Format||n===RGBA_ASTC_8x5_Format||n===RGBA_ASTC_8x6_Format||n===RGBA_ASTC_8x8_Format||n===RGBA_ASTC_10x5_Format||n===RGBA_ASTC_10x6_Format||n===RGBA_ASTC_10x8_Format||n===RGBA_ASTC_10x10_Format||n===RGBA_ASTC_12x10_Format||n===RGBA_ASTC_12x12_Format)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===RGBA_ASTC_4x4_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===RGBA_ASTC_5x4_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===RGBA_ASTC_5x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===RGBA_ASTC_6x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===RGBA_ASTC_6x6_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===RGBA_ASTC_8x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===RGBA_ASTC_8x6_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===RGBA_ASTC_8x8_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===RGBA_ASTC_10x5_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===RGBA_ASTC_10x6_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===RGBA_ASTC_10x8_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===RGBA_ASTC_10x10_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===RGBA_ASTC_12x10_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===RGBA_ASTC_12x12_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===RGBA_BPTC_Format||n===RGB_BPTC_SIGNED_Format||n===RGB_BPTC_UNSIGNED_Format)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===RGBA_BPTC_Format)return a===SRGBTransfer?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===RGB_BPTC_SIGNED_Format)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===RGB_BPTC_UNSIGNED_Format)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===RED_RGTC1_Format||n===SIGNED_RED_RGTC1_Format||n===RED_GREEN_RGTC2_Format||n===SIGNED_RED_GREEN_RGTC2_Format)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===RGBA_BPTC_Format)return s.COMPRESSED_RED_RGTC1_EXT;if(n===SIGNED_RED_RGTC1_Format)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===RED_GREEN_RGTC2_Format)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===SIGNED_RED_GREEN_RGTC2_Format)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===UnsignedInt248Type?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const _occlusion_vertex=`
|
|
3797
3797
|
void main() {
|
|
3798
3798
|
|
|
3799
3799
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -3817,7 +3817,7 @@ void main() {
|
|
|
3817
3817
|
|
|
3818
3818
|
}
|
|
3819
3819
|
|
|
3820
|
-
}`;class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const r=new Texture,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new ShaderMaterial({vertexShader:_occlusion_vertex,fragmentShader:_occlusion_fragment,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class WebXRManager extends EventDispatcher{constructor(e,t){super();const n=this;let r=null,s=1,a=null,o="local-floor",l=1,h=null,u=null,d=null,f=null,p=null,m=null;const g=new WebXRDepthSensing,y=t.getContextAttributes();let c=null,x=null;const v=[],_=[],b=new Vector2;let M=null;const A=new PerspectiveCamera;A.viewport=new Vector4;const R=new PerspectiveCamera;R.viewport=new Vector4;const w=[A,R],P=new ArrayCamera;let N=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let Q=v[X];return Q===void 0&&(Q=new WebXRController,v[X]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(X){let Q=v[X];return Q===void 0&&(Q=new WebXRController,v[X]=Q),Q.getGripSpace()},this.getHand=function(X){let Q=v[X];return Q===void 0&&(Q=new WebXRController,v[X]=Q),Q.getHandSpace()};function G(X){const Q=_.indexOf(X.inputSource);if(Q===-1)return;const ne=v[Q];ne!==void 0&&(ne.update(X.inputSource,X.frame,h||a),ne.dispatchEvent({type:X.type,data:X.inputSource}))}function H(){r.removeEventListener("select",G),r.removeEventListener("selectstart",G),r.removeEventListener("selectend",G),r.removeEventListener("squeeze",G),r.removeEventListener("squeezestart",G),r.removeEventListener("squeezeend",G),r.removeEventListener("end",H),r.removeEventListener("inputsourceschange",O);for(let X=0;X<v.length;X++){const Q=_[X];Q!==null&&(_[X]=null,v[X].disconnect(Q))}N=null,V=null,g.reset(),e.setRenderTarget(c),p=null,f=null,d=null,r=null,x=null,oe.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(b.width,b.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){s=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){o=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||a},this.setReferenceSpace=function(X){h=X},this.getBaseLayer=function(){return f!==null?f:p},this.getBinding=function(){return d},this.getFrame=function(){return m},this.getSession=function(){return r},this.setSession=async function(X){if(r=X,r!==null){if(c=e.getRenderTarget(),r.addEventListener("select",G),r.addEventListener("selectstart",G),r.addEventListener("selectend",G),r.addEventListener("squeeze",G),r.addEventListener("squeezestart",G),r.addEventListener("squeezeend",G),r.addEventListener("end",H),r.addEventListener("inputsourceschange",O),y.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(b),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ne=null,re=null,me=null;y.depth&&(me=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ne=y.stencil?DepthStencilFormat:DepthFormat,re=y.stencil?UnsignedInt248Type:UnsignedIntType);const Fe={colorFormat:t.RGBA8,depthFormat:me,scaleFactor:s};d=new XRWebGLBinding(r,t),f=d.createProjectionLayer(Fe),r.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),x=new WebGLRenderTarget(f.textureWidth,f.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(f.textureWidth,f.textureHeight,re,void 0,void 0,void 0,void 0,void 0,void 0,ne),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{const ne={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};p=new XRWebGLLayer(r,t,ne),r.updateRenderState({baseLayer:p}),e.setPixelRatio(1),e.setSize(p.framebufferWidth,p.framebufferHeight,!1),x=new WebGLRenderTarget(p.framebufferWidth,p.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(l),h=null,a=await r.requestReferenceSpace(o),oe.setContext(r),oe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function O(X){for(let Q=0;Q<X.removed.length;Q++){const ne=X.removed[Q],re=_.indexOf(ne);re>=0&&(_[re]=null,v[re].disconnect(ne))}for(let Q=0;Q<X.added.length;Q++){const ne=X.added[Q];let re=_.indexOf(ne);if(re===-1){for(let Fe=0;Fe<v.length;Fe++)if(Fe>=_.length){_.push(ne),re=Fe;break}else if(_[Fe]===null){_[Fe]=ne,re=Fe;break}if(re===-1)break}const me=v[re];me&&me.connect(ne)}}const C=new Vector3,L=new Vector3;function E(X,Q,ne){C.setFromMatrixPosition(Q.matrixWorld),L.setFromMatrixPosition(ne.matrixWorld);const re=C.distanceTo(L),me=Q.projectionMatrix.elements,Fe=ne.projectionMatrix.elements,Ee=me[14]/(me[10]-1),Ne=me[14]/(me[10]+1),Be=(me[9]+1)/me[5],_e=(me[9]-1)/me[5],U=(me[8]-1)/me[0],qe=(Fe[8]+1)/Fe[0],Le=Ee*U,Ie=Ee*qe,ge=re/(-U+qe),ke=ge*-U;if(Q.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(ke),X.translateZ(ge),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert(),me[10]===-1)X.projectionMatrix.copy(Q.projectionMatrix),X.projectionMatrixInverse.copy(Q.projectionMatrixInverse);else{const ve=Ee+ge,D=Ne+ge,I=Le-ke,q=Ie+(re-ke),J=Be*Ne/D*ve,te=_e*Ne/D*ve;X.projectionMatrix.makePerspective(I,q,J,te,ve,D),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}}function T(X,Q){Q===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(Q.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(r===null)return;let Q=X.near,ne=X.far;g.texture!==null&&(g.depthNear>0&&(Q=g.depthNear),g.depthFar>0&&(ne=g.depthFar)),P.near=R.near=A.near=Q,P.far=R.far=A.far=ne,(N!==P.near||V!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),N=P.near,V=P.far),A.layers.mask=X.layers.mask|2,R.layers.mask=X.layers.mask|4,P.layers.mask=A.layers.mask|R.layers.mask;const re=X.parent,me=P.cameras;T(P,re);for(let Fe=0;Fe<me.length;Fe++)T(me[Fe],re);me.length===2?E(P,A,R):P.projectionMatrix.copy(A.projectionMatrix),k(X,P,re)};function k(X,Q,ne){ne===null?X.matrix.copy(Q.matrixWorld):(X.matrix.copy(ne.matrixWorld),X.matrix.invert(),X.matrix.multiply(Q.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(Q.projectionMatrix),X.projectionMatrixInverse.copy(Q.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=RAD2DEG*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return P},this.getFoveation=function(){if(!(f===null&&p===null))return l},this.setFoveation=function(X){l=X,f!==null&&(f.fixedFoveation=X),p!==null&&p.fixedFoveation!==void 0&&(p.fixedFoveation=X)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(P)};let B=null;function ee(X,Q){if(u=Q.getViewerPose(h||a),m=Q,u!==null){const ne=u.views;p!==null&&(e.setRenderTargetFramebuffer(x,p.framebuffer),e.setRenderTarget(x));let re=!1;ne.length!==P.cameras.length&&(P.cameras.length=0,re=!0);for(let Ee=0;Ee<ne.length;Ee++){const Ne=ne[Ee];let Be=null;if(p!==null)Be=p.getViewport(Ne);else{const U=d.getViewSubImage(f,Ne);Be=U.viewport,Ee===0&&(e.setRenderTargetTextures(x,U.colorTexture,U.depthStencilTexture),e.setRenderTarget(x))}let _e=w[Ee];_e===void 0&&(_e=new PerspectiveCamera,_e.layers.enable(Ee),_e.viewport=new Vector4,w[Ee]=_e),_e.matrix.fromArray(Ne.transform.matrix),_e.matrix.decompose(_e.position,_e.quaternion,_e.scale),_e.projectionMatrix.fromArray(Ne.projectionMatrix),_e.projectionMatrixInverse.copy(_e.projectionMatrix).invert(),_e.viewport.set(Be.x,Be.y,Be.width,Be.height),Ee===0&&(P.matrix.copy(_e.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale)),re===!0&&P.cameras.push(_e)}const me=r.enabledFeatures;if(me&&me.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&d){const Ee=d.getDepthInformation(ne[0]);Ee&&Ee.isValid&&Ee.texture&&g.init(e,Ee,r.renderState)}}for(let ne=0;ne<v.length;ne++){const re=_[ne],me=v[ne];re!==null&&me!==void 0&&me.update(re,Q,h||a)}B&&B(X,Q),Q.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Q}),m=null}const oe=new WebGLAnimation;oe.setAnimationLoop(ee),this.setAnimationLoop=function(X){B=X},this.dispose=function(){}}}const _e1=new Euler,_m1=new Matrix4;function WebGLMaterials(i,e){function t(y,c){y.matrixAutoUpdate===!0&&y.updateMatrix(),c.value.copy(y.matrix)}function n(y,c){c.color.getRGB(y.fogColor.value,getUnlitUniformColorSpace(i)),c.isFog?(y.fogNear.value=c.near,y.fogFar.value=c.far):c.isFogExp2&&(y.fogDensity.value=c.density)}function r(y,c,x,v,_){c.isMeshBasicMaterial||c.isMeshLambertMaterial?s(y,c):c.isMeshToonMaterial?(s(y,c),d(y,c)):c.isMeshPhongMaterial?(s(y,c),u(y,c)):c.isMeshStandardMaterial?(s(y,c),f(y,c),c.isMeshPhysicalMaterial&&p(y,c,_)):c.isMeshMatcapMaterial?(s(y,c),m(y,c)):c.isMeshDepthMaterial?s(y,c):c.isMeshDistanceMaterial?(s(y,c),g(y,c)):c.isMeshNormalMaterial?s(y,c):c.isLineBasicMaterial?(a(y,c),c.isLineDashedMaterial&&o(y,c)):c.isPointsMaterial?l(y,c,x,v):c.isSpriteMaterial?h(y,c):c.isShadowMaterial?(y.color.value.copy(c.color),y.opacity.value=c.opacity):c.isShaderMaterial&&(c.uniformsNeedUpdate=!1)}function s(y,c){y.opacity.value=c.opacity,c.color&&y.diffuse.value.copy(c.color),c.emissive&&y.emissive.value.copy(c.emissive).multiplyScalar(c.emissiveIntensity),c.map&&(y.map.value=c.map,t(c.map,y.mapTransform)),c.alphaMap&&(y.alphaMap.value=c.alphaMap,t(c.alphaMap,y.alphaMapTransform)),c.bumpMap&&(y.bumpMap.value=c.bumpMap,t(c.bumpMap,y.bumpMapTransform),y.bumpScale.value=c.bumpScale,c.side===BackSide&&(y.bumpScale.value*=-1)),c.normalMap&&(y.normalMap.value=c.normalMap,t(c.normalMap,y.normalMapTransform),y.normalScale.value.copy(c.normalScale),c.side===BackSide&&y.normalScale.value.negate()),c.displacementMap&&(y.displacementMap.value=c.displacementMap,t(c.displacementMap,y.displacementMapTransform),y.displacementScale.value=c.displacementScale,y.displacementBias.value=c.displacementBias),c.emissiveMap&&(y.emissiveMap.value=c.emissiveMap,t(c.emissiveMap,y.emissiveMapTransform)),c.specularMap&&(y.specularMap.value=c.specularMap,t(c.specularMap,y.specularMapTransform)),c.alphaTest>0&&(y.alphaTest.value=c.alphaTest);const x=e.get(c),v=x.envMap,_=x.envMapRotation;v&&(y.envMap.value=v,_e1.copy(_),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(_e1.y*=-1,_e1.z*=-1),y.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),y.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=c.reflectivity,y.ior.value=c.ior,y.refractionRatio.value=c.refractionRatio),c.lightMap&&(y.lightMap.value=c.lightMap,y.lightMapIntensity.value=c.lightMapIntensity,t(c.lightMap,y.lightMapTransform)),c.aoMap&&(y.aoMap.value=c.aoMap,y.aoMapIntensity.value=c.aoMapIntensity,t(c.aoMap,y.aoMapTransform))}function a(y,c){y.diffuse.value.copy(c.color),y.opacity.value=c.opacity,c.map&&(y.map.value=c.map,t(c.map,y.mapTransform))}function o(y,c){y.dashSize.value=c.dashSize,y.totalSize.value=c.dashSize+c.gapSize,y.scale.value=c.scale}function l(y,c,x,v){y.diffuse.value.copy(c.color),y.opacity.value=c.opacity,y.size.value=c.size*x,y.scale.value=v*.5,c.map&&(y.map.value=c.map,t(c.map,y.uvTransform)),c.alphaMap&&(y.alphaMap.value=c.alphaMap,t(c.alphaMap,y.alphaMapTransform)),c.alphaTest>0&&(y.alphaTest.value=c.alphaTest)}function h(y,c){y.diffuse.value.copy(c.color),y.opacity.value=c.opacity,y.rotation.value=c.rotation,c.map&&(y.map.value=c.map,t(c.map,y.mapTransform)),c.alphaMap&&(y.alphaMap.value=c.alphaMap,t(c.alphaMap,y.alphaMapTransform)),c.alphaTest>0&&(y.alphaTest.value=c.alphaTest)}function u(y,c){y.specular.value.copy(c.specular),y.shininess.value=Math.max(c.shininess,1e-4)}function d(y,c){c.gradientMap&&(y.gradientMap.value=c.gradientMap)}function f(y,c){y.metalness.value=c.metalness,c.metalnessMap&&(y.metalnessMap.value=c.metalnessMap,t(c.metalnessMap,y.metalnessMapTransform)),y.roughness.value=c.roughness,c.roughnessMap&&(y.roughnessMap.value=c.roughnessMap,t(c.roughnessMap,y.roughnessMapTransform)),c.envMap&&(y.envMapIntensity.value=c.envMapIntensity)}function p(y,c,x){y.ior.value=c.ior,c.sheen>0&&(y.sheenColor.value.copy(c.sheenColor).multiplyScalar(c.sheen),y.sheenRoughness.value=c.sheenRoughness,c.sheenColorMap&&(y.sheenColorMap.value=c.sheenColorMap,t(c.sheenColorMap,y.sheenColorMapTransform)),c.sheenRoughnessMap&&(y.sheenRoughnessMap.value=c.sheenRoughnessMap,t(c.sheenRoughnessMap,y.sheenRoughnessMapTransform))),c.clearcoat>0&&(y.clearcoat.value=c.clearcoat,y.clearcoatRoughness.value=c.clearcoatRoughness,c.clearcoatMap&&(y.clearcoatMap.value=c.clearcoatMap,t(c.clearcoatMap,y.clearcoatMapTransform)),c.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=c.clearcoatRoughnessMap,t(c.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),c.clearcoatNormalMap&&(y.clearcoatNormalMap.value=c.clearcoatNormalMap,t(c.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(c.clearcoatNormalScale),c.side===BackSide&&y.clearcoatNormalScale.value.negate())),c.dispersion>0&&(y.dispersion.value=c.dispersion),c.iridescence>0&&(y.iridescence.value=c.iridescence,y.iridescenceIOR.value=c.iridescenceIOR,y.iridescenceThicknessMinimum.value=c.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=c.iridescenceThicknessRange[1],c.iridescenceMap&&(y.iridescenceMap.value=c.iridescenceMap,t(c.iridescenceMap,y.iridescenceMapTransform)),c.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=c.iridescenceThicknessMap,t(c.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),c.transmission>0&&(y.transmission.value=c.transmission,y.transmissionSamplerMap.value=x.texture,y.transmissionSamplerSize.value.set(x.width,x.height),c.transmissionMap&&(y.transmissionMap.value=c.transmissionMap,t(c.transmissionMap,y.transmissionMapTransform)),y.thickness.value=c.thickness,c.thicknessMap&&(y.thicknessMap.value=c.thicknessMap,t(c.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=c.attenuationDistance,y.attenuationColor.value.copy(c.attenuationColor)),c.anisotropy>0&&(y.anisotropyVector.value.set(c.anisotropy*Math.cos(c.anisotropyRotation),c.anisotropy*Math.sin(c.anisotropyRotation)),c.anisotropyMap&&(y.anisotropyMap.value=c.anisotropyMap,t(c.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=c.specularIntensity,y.specularColor.value.copy(c.specularColor),c.specularColorMap&&(y.specularColorMap.value=c.specularColorMap,t(c.specularColorMap,y.specularColorMapTransform)),c.specularIntensityMap&&(y.specularIntensityMap.value=c.specularIntensityMap,t(c.specularIntensityMap,y.specularIntensityMapTransform))}function m(y,c){c.matcap&&(y.matcap.value=c.matcap)}function g(y,c){const x=e.get(c).light;y.referencePosition.value.setFromMatrixPosition(x.matrixWorld),y.nearDistance.value=x.shadow.camera.near,y.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function WebGLUniformsGroups(i,e,t,n){let r={},s={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,v){const _=v.program;n.uniformBlockBinding(x,_)}function h(x,v){let _=r[x.id];_===void 0&&(m(x),_=u(x),r[x.id]=_,x.addEventListener("dispose",y));const b=v.program;n.updateUBOMapping(x,b);const M=e.render.frame;s[x.id]!==M&&(f(x),s[x.id]=M)}function u(x){const v=d();x.__bindingPointIndex=v;const _=i.createBuffer(),b=x.__size,M=x.usage;return i.bindBuffer(i.UNIFORM_BUFFER,_),i.bufferData(i.UNIFORM_BUFFER,b,M),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,v,_),_}function d(){for(let x=0;x<o;x++)if(a.indexOf(x)===-1)return a.push(x),x;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(x){const v=r[x.id],_=x.uniforms,b=x.__cache;i.bindBuffer(i.UNIFORM_BUFFER,v);for(let M=0,A=_.length;M<A;M++){const R=Array.isArray(_[M])?_[M]:[_[M]];for(let w=0,P=R.length;w<P;w++){const N=R[w];if(p(N,M,w,b)===!0){const V=N.__offset,G=Array.isArray(N.value)?N.value:[N.value];let H=0;for(let O=0;O<G.length;O++){const C=G[O],L=g(C);typeof C=="number"||typeof C=="boolean"?(N.__data[0]=C,i.bufferSubData(i.UNIFORM_BUFFER,V+H,N.__data)):C.isMatrix3?(N.__data[0]=C.elements[0],N.__data[1]=C.elements[1],N.__data[2]=C.elements[2],N.__data[3]=0,N.__data[4]=C.elements[3],N.__data[5]=C.elements[4],N.__data[6]=C.elements[5],N.__data[7]=0,N.__data[8]=C.elements[6],N.__data[9]=C.elements[7],N.__data[10]=C.elements[8],N.__data[11]=0):(C.toArray(N.__data,H),H+=L.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,V,N.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function p(x,v,_,b){const M=x.value,A=v+"_"+_;if(b[A]===void 0)return typeof M=="number"||typeof M=="boolean"?b[A]=M:b[A]=M.clone(),!0;{const R=b[A];if(typeof M=="number"||typeof M=="boolean"){if(R!==M)return b[A]=M,!0}else if(R.equals(M)===!1)return R.copy(M),!0}return!1}function m(x){const v=x.uniforms;let _=0;const b=16;for(let A=0,R=v.length;A<R;A++){const w=Array.isArray(v[A])?v[A]:[v[A]];for(let P=0,N=w.length;P<N;P++){const V=w[P],G=Array.isArray(V.value)?V.value:[V.value];for(let H=0,O=G.length;H<O;H++){const C=G[H],L=g(C),E=_%b,T=E%L.boundary,k=E+T;_+=T,k!==0&&b-k<L.storage&&(_+=b-k),V.__data=new Float32Array(L.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=_,_+=L.storage}}}const M=_%b;return M>0&&(_+=b-M),x.__size=_,x.__cache={},this}function g(x){const v={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(v.boundary=4,v.storage=4):x.isVector2?(v.boundary=8,v.storage=8):x.isVector3||x.isColor?(v.boundary=16,v.storage=12):x.isVector4?(v.boundary=16,v.storage=16):x.isMatrix3?(v.boundary=48,v.storage=48):x.isMatrix4?(v.boundary=64,v.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),v}function y(x){const v=x.target;v.removeEventListener("dispose",y);const _=a.indexOf(v.__bindingPointIndex);a.splice(_,1),i.deleteBuffer(r[v.id]),delete r[v.id],delete s[v.id]}function c(){for(const x in r)i.deleteBuffer(r[x]);a=[],r={},s={}}return{bind:l,update:h,dispose:c}}class WebGLRenderer{constructor(e={}){const{canvas:t=createCanvasElement(),context:n=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;const m=new Uint32Array(4),g=new Int32Array(4);let y=null,c=null;const x=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const _=this;let b=!1;this._outputColorSpace=SRGBColorSpace;let M=0,A=0,R=null,w=-1,P=null;const N=new Vector4,V=new Vector4;let G=null;const H=new Color(0);let O=0,C=t.width,L=t.height,E=1,T=null,k=null;const B=new Vector4(0,0,C,L),ee=new Vector4(0,0,C,L);let oe=!1;const X=new Frustum;let Q=!1,ne=!1;const re=new Matrix4,me=new Matrix4,Fe=new Vector3,Ee=new Vector4,Ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Be=!1;function _e(){return R===null?E:1}let U=n;function qe(F,W){return t.getContext(F,W)}try{const F={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${REVISION}`),t.addEventListener("webglcontextlost",ie,!1),t.addEventListener("webglcontextrestored",ue,!1),t.addEventListener("webglcontextcreationerror",fe,!1),U===null){const W="webgl2";if(U=qe(W,F),U===null)throw qe(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Le,Ie,ge,ke,ve,D,I,q,J,te,K,de,le,Me,be,se,ye,Ce,Pe,xe,Ve,Ue,$e,z;function ce(){Le=new WebGLExtensions(U),Le.init(),Ue=new WebGLUtils(U,Le),Ie=new WebGLCapabilities(U,Le,e,Ue),ge=new WebGLState(U,Le),Ie.reverseDepthBuffer&&f&&ge.buffers.depth.setReversed(!0),ke=new WebGLInfo(U),ve=new WebGLProperties,D=new WebGLTextures(U,Le,ge,ve,Ie,Ue,ke),I=new WebGLCubeMaps(_),q=new WebGLCubeUVMaps(_),J=new WebGLAttributes(U),$e=new WebGLBindingStates(U,J),te=new WebGLGeometries(U,J,ke,$e),K=new WebGLObjects(U,te,J,ke),Pe=new WebGLMorphtargets(U,Ie,D),se=new WebGLClipping(ve),de=new WebGLPrograms(_,I,q,Le,Ie,$e,se),le=new WebGLMaterials(_,ve),Me=new WebGLRenderLists,be=new WebGLRenderStates(Le),Ce=new WebGLBackground(_,I,q,ge,K,p,l),ye=new WebGLShadowMap(_,K,Ie),z=new WebGLUniformsGroups(U,ke,Ie,ge),xe=new WebGLBufferRenderer(U,Le,ke),Ve=new WebGLIndexedBufferRenderer(U,Le,ke),ke.programs=de.programs,_.capabilities=Ie,_.extensions=Le,_.properties=ve,_.renderLists=Me,_.shadowMap=ye,_.state=ge,_.info=ke}ce();const Z=new WebXRManager(_,U);this.xr=Z,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){const F=Le.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Le.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return E},this.setPixelRatio=function(F){F!==void 0&&(E=F,this.setSize(C,L,!1))},this.getSize=function(F){return F.set(C,L)},this.setSize=function(F,W,Y=!0){if(Z.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}C=F,L=W,t.width=Math.floor(F*E),t.height=Math.floor(W*E),Y===!0&&(t.style.width=F+"px",t.style.height=W+"px"),this.setViewport(0,0,F,W)},this.getDrawingBufferSize=function(F){return F.set(C*E,L*E).floor()},this.setDrawingBufferSize=function(F,W,Y){C=F,L=W,E=Y,t.width=Math.floor(F*Y),t.height=Math.floor(W*Y),this.setViewport(0,0,F,W)},this.getCurrentViewport=function(F){return F.copy(N)},this.getViewport=function(F){return F.copy(B)},this.setViewport=function(F,W,Y,j){F.isVector4?B.set(F.x,F.y,F.z,F.w):B.set(F,W,Y,j),ge.viewport(N.copy(B).multiplyScalar(E).round())},this.getScissor=function(F){return F.copy(ee)},this.setScissor=function(F,W,Y,j){F.isVector4?ee.set(F.x,F.y,F.z,F.w):ee.set(F,W,Y,j),ge.scissor(V.copy(ee).multiplyScalar(E).round())},this.getScissorTest=function(){return oe},this.setScissorTest=function(F){ge.setScissorTest(oe=F)},this.setOpaqueSort=function(F){T=F},this.setTransparentSort=function(F){k=F},this.getClearColor=function(F){return F.copy(Ce.getClearColor())},this.setClearColor=function(){Ce.setClearColor(...arguments)},this.getClearAlpha=function(){return Ce.getClearAlpha()},this.setClearAlpha=function(){Ce.setClearAlpha(...arguments)},this.clear=function(F=!0,W=!0,Y=!0){let j=0;if(F){let $=!1;if(R!==null){const ae=R.texture.format;$=ae===RGBAIntegerFormat||ae===RGIntegerFormat||ae===RedIntegerFormat}if($){const ae=R.texture.type,he=ae===UnsignedByteType||ae===UnsignedIntType||ae===UnsignedShortType||ae===UnsignedInt248Type||ae===UnsignedShort4444Type||ae===UnsignedShort5551Type,pe=Ce.getClearColor(),Se=Ce.getClearAlpha(),Re=pe.r,we=pe.g,Te=pe.b;he?(m[0]=Re,m[1]=we,m[2]=Te,m[3]=Se,U.clearBufferuiv(U.COLOR,0,m)):(g[0]=Re,g[1]=we,g[2]=Te,g[3]=Se,U.clearBufferiv(U.COLOR,0,g))}else j|=U.COLOR_BUFFER_BIT}W&&(j|=U.DEPTH_BUFFER_BIT),Y&&(j|=U.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),U.clear(j)},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(){t.removeEventListener("webglcontextlost",ie,!1),t.removeEventListener("webglcontextrestored",ue,!1),t.removeEventListener("webglcontextcreationerror",fe,!1),Ce.dispose(),Me.dispose(),be.dispose(),ve.dispose(),I.dispose(),q.dispose(),K.dispose(),$e.dispose(),z.dispose(),de.dispose(),Z.dispose(),Z.removeEventListener("sessionstart",mt),Z.removeEventListener("sessionend",gt),ot.stop()};function ie(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function ue(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const F=ke.autoReset,W=ye.enabled,Y=ye.autoUpdate,j=ye.needsUpdate,$=ye.type;ce(),ke.autoReset=F,ye.enabled=W,ye.autoUpdate=Y,ye.needsUpdate=j,ye.type=$}function fe(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function De(F){const W=F.target;W.removeEventListener("dispose",De),Ye(W)}function Ye(F){Je(F),ve.remove(F)}function Je(F){const W=ve.get(F).programs;W!==void 0&&(W.forEach(function(Y){de.releaseProgram(Y)}),F.isShaderMaterial&&de.releaseShaderCache(F))}this.renderBufferDirect=function(F,W,Y,j,$,ae){W===null&&(W=Ne);const he=$.isMesh&&$.matrixWorld.determinant()<0,pe=Et(F,W,Y,j,$);ge.setMaterial(j,he);let Se=Y.index,Re=1;if(j.wireframe===!0){if(Se=te.getWireframeAttribute(Y),Se===void 0)return;Re=2}const we=Y.drawRange,Te=Y.attributes.position;let Oe=we.start*Re,ze=(we.start+we.count)*Re;ae!==null&&(Oe=Math.max(Oe,ae.start*Re),ze=Math.min(ze,(ae.start+ae.count)*Re)),Se!==null?(Oe=Math.max(Oe,0),ze=Math.min(ze,Se.count)):Te!=null&&(Oe=Math.max(Oe,0),ze=Math.min(ze,Te.count));const Ke=ze-Oe;if(Ke<0||Ke===1/0)return;$e.setup($,j,pe,Y,Se);let je,Ge=xe;if(Se!==null&&(je=J.get(Se),Ge=Ve,Ge.setIndex(je)),$.isMesh)j.wireframe===!0?(ge.setLineWidth(j.wireframeLinewidth*_e()),Ge.setMode(U.LINES)):Ge.setMode(U.TRIANGLES);else if($.isLine){let Ae=j.linewidth;Ae===void 0&&(Ae=1),ge.setLineWidth(Ae*_e()),$.isLineSegments?Ge.setMode(U.LINES):$.isLineLoop?Ge.setMode(U.LINE_LOOP):Ge.setMode(U.LINE_STRIP)}else $.isPoints?Ge.setMode(U.POINTS):$.isSprite&&Ge.setMode(U.TRIANGLES);if($.isBatchedMesh)if($._multiDrawInstances!==null)warnOnce("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ge.renderMultiDrawInstances($._multiDrawStarts,$._multiDrawCounts,$._multiDrawCount,$._multiDrawInstances);else if(Le.get("WEBGL_multi_draw"))Ge.renderMultiDraw($._multiDrawStarts,$._multiDrawCounts,$._multiDrawCount);else{const Ae=$._multiDrawStarts,Ze=$._multiDrawCounts,He=$._multiDrawCount,st=Se?J.get(Se).bytesPerElement:1,ht=ve.get(j).currentProgram.getUniforms();for(let tt=0;tt<He;tt++)ht.setValue(U,"_gl_DrawID",tt),Ge.render(Ae[tt]/st,Ze[tt])}else if($.isInstancedMesh)Ge.renderInstances(Oe,Ke,$.count);else if(Y.isInstancedBufferGeometry){const Ae=Y._maxInstanceCount!==void 0?Y._maxInstanceCount:1/0,Ze=Math.min(Y.instanceCount,Ae);Ge.renderInstances(Oe,Ke,Ze)}else Ge.render(Oe,Ke)};function We(F,W,Y){F.transparent===!0&&F.side===DoubleSide&&F.forceSinglePass===!1?(F.side=BackSide,F.needsUpdate=!0,ut(F,W,Y),F.side=FrontSide,F.needsUpdate=!0,ut(F,W,Y),F.side=DoubleSide):ut(F,W,Y)}this.compile=function(F,W,Y=null){Y===null&&(Y=F),c=be.get(Y),c.init(W),v.push(c),Y.traverseVisible(function($){$.isLight&&$.layers.test(W.layers)&&(c.pushLight($),$.castShadow&&c.pushShadow($))}),F!==Y&&F.traverseVisible(function($){$.isLight&&$.layers.test(W.layers)&&(c.pushLight($),$.castShadow&&c.pushShadow($))}),c.setupLights();const j=new Set;return F.traverse(function($){if(!($.isMesh||$.isPoints||$.isLine||$.isSprite))return;const ae=$.material;if(ae)if(Array.isArray(ae))for(let he=0;he<ae.length;he++){const pe=ae[he];We(pe,Y,$),j.add(pe)}else We(ae,Y,$),j.add(ae)}),c=v.pop(),j},this.compileAsync=function(F,W,Y=null){const j=this.compile(F,W,Y);return new Promise($=>{function ae(){if(j.forEach(function(he){ve.get(he).currentProgram.isReady()&&j.delete(he)}),j.size===0){$(F);return}setTimeout(ae,10)}Le.get("KHR_parallel_shader_compile")!==null?ae():setTimeout(ae,10)})};let rt=null;function at(F){rt&&rt(F)}function mt(){ot.stop()}function gt(){ot.start()}const ot=new WebGLAnimation;ot.setAnimationLoop(at),typeof self<"u"&&ot.setContext(self),this.setAnimationLoop=function(F){rt=F,Z.setAnimationLoop(F),F===null?ot.stop():ot.start()},Z.addEventListener("sessionstart",mt),Z.addEventListener("sessionend",gt),this.render=function(F,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;if(F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),Z.enabled===!0&&Z.isPresenting===!0&&(Z.cameraAutoUpdate===!0&&Z.updateCamera(W),W=Z.getCamera()),F.isScene===!0&&F.onBeforeRender(_,F,W,R),c=be.get(F,v.length),c.init(W),v.push(c),me.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),X.setFromProjectionMatrix(me),ne=this.localClippingEnabled,Q=se.init(this.clippingPlanes,ne),y=Me.get(F,x.length),y.init(),x.push(y),Z.enabled===!0&&Z.isPresenting===!0){const ae=_.xr.getDepthSensingMesh();ae!==null&&dt(ae,W,-1/0,_.sortObjects)}dt(F,W,0,_.sortObjects),y.finish(),_.sortObjects===!0&&y.sort(T,k),Be=Z.enabled===!1||Z.isPresenting===!1||Z.hasDepthSensing()===!1,Be&&Ce.addToRenderList(y,F),this.info.render.frame++,Q===!0&&se.beginShadows();const Y=c.state.shadowsArray;ye.render(Y,F,W),Q===!0&&se.endShadows(),this.info.autoReset===!0&&this.info.reset();const j=y.opaque,$=y.transmissive;if(c.setupLights(),W.isArrayCamera){const ae=W.cameras;if($.length>0)for(let he=0,pe=ae.length;he<pe;he++){const Se=ae[he];_t(j,$,F,Se)}Be&&Ce.render(F);for(let he=0,pe=ae.length;he<pe;he++){const Se=ae[he];vt(y,F,Se,Se.viewport)}}else $.length>0&&_t(j,$,F,W),Be&&Ce.render(F),vt(y,F,W);R!==null&&A===0&&(D.updateMultisampleRenderTarget(R),D.updateRenderTargetMipmap(R)),F.isScene===!0&&F.onAfterRender(_,F,W),$e.resetDefaultState(),w=-1,P=null,v.pop(),v.length>0?(c=v[v.length-1],Q===!0&&se.setGlobalState(_.clippingPlanes,c.state.camera)):c=null,x.pop(),x.length>0?y=x[x.length-1]:y=null};function dt(F,W,Y,j){if(F.visible===!1)return;if(F.layers.test(W.layers)){if(F.isGroup)Y=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(W);else if(F.isLight)c.pushLight(F),F.castShadow&&c.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||X.intersectsSprite(F)){j&&Ee.setFromMatrixPosition(F.matrixWorld).applyMatrix4(me);const he=K.update(F),pe=F.material;pe.visible&&y.push(F,he,pe,Y,Ee.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||X.intersectsObject(F))){const he=K.update(F),pe=F.material;if(j&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Ee.copy(F.boundingSphere.center)):(he.boundingSphere===null&&he.computeBoundingSphere(),Ee.copy(he.boundingSphere.center)),Ee.applyMatrix4(F.matrixWorld).applyMatrix4(me)),Array.isArray(pe)){const Se=he.groups;for(let Re=0,we=Se.length;Re<we;Re++){const Te=Se[Re],Oe=pe[Te.materialIndex];Oe&&Oe.visible&&y.push(F,he,Oe,Y,Ee.z,Te)}}else pe.visible&&y.push(F,he,pe,Y,Ee.z,null)}}const ae=F.children;for(let he=0,pe=ae.length;he<pe;he++)dt(ae[he],W,Y,j)}function vt(F,W,Y,j){const $=F.opaque,ae=F.transmissive,he=F.transparent;c.setupLightsView(Y),Q===!0&&se.setGlobalState(_.clippingPlanes,Y),j&&ge.viewport(N.copy(j)),$.length>0&&ft($,W,Y),ae.length>0&&ft(ae,W,Y),he.length>0&&ft(he,W,Y),ge.buffers.depth.setTest(!0),ge.buffers.depth.setMask(!0),ge.buffers.color.setMask(!0),ge.setPolygonOffset(!1)}function _t(F,W,Y,j){if((Y.isScene===!0?Y.overrideMaterial:null)!==null)return;c.state.transmissionRenderTarget[j.id]===void 0&&(c.state.transmissionRenderTarget[j.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:Le.has("EXT_color_buffer_half_float")||Le.has("EXT_color_buffer_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ColorManagement.workingColorSpace}));const ae=c.state.transmissionRenderTarget[j.id],he=j.viewport||N;ae.setSize(he.z*_.transmissionResolutionScale,he.w*_.transmissionResolutionScale);const pe=_.getRenderTarget();_.setRenderTarget(ae),_.getClearColor(H),O=_.getClearAlpha(),O<1&&_.setClearColor(16777215,.5),_.clear(),Be&&Ce.render(Y);const Se=_.toneMapping;_.toneMapping=NoToneMapping;const Re=j.viewport;if(j.viewport!==void 0&&(j.viewport=void 0),c.setupLightsView(j),Q===!0&&se.setGlobalState(_.clippingPlanes,j),ft(F,Y,j),D.updateMultisampleRenderTarget(ae),D.updateRenderTargetMipmap(ae),Le.has("WEBGL_multisampled_render_to_texture")===!1){let we=!1;for(let Te=0,Oe=W.length;Te<Oe;Te++){const ze=W[Te],Ke=ze.object,je=ze.geometry,Ge=ze.material,Ae=ze.group;if(Ge.side===DoubleSide&&Ke.layers.test(j.layers)){const Ze=Ge.side;Ge.side=BackSide,Ge.needsUpdate=!0,yt(Ke,Y,j,je,Ge,Ae),Ge.side=Ze,Ge.needsUpdate=!0,we=!0}}we===!0&&(D.updateMultisampleRenderTarget(ae),D.updateRenderTargetMipmap(ae))}_.setRenderTarget(pe),_.setClearColor(H,O),Re!==void 0&&(j.viewport=Re),_.toneMapping=Se}function ft(F,W,Y){const j=W.isScene===!0?W.overrideMaterial:null;for(let $=0,ae=F.length;$<ae;$++){const he=F[$],pe=he.object,Se=he.geometry,Re=he.group;let we=he.material;we.allowOverride===!0&&j!==null&&(we=j),pe.layers.test(Y.layers)&&yt(pe,W,Y,Se,we,Re)}}function yt(F,W,Y,j,$,ae){F.onBeforeRender(_,W,Y,j,$,ae),F.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),$.onBeforeRender(_,W,Y,j,F,ae),$.transparent===!0&&$.side===DoubleSide&&$.forceSinglePass===!1?($.side=BackSide,$.needsUpdate=!0,_.renderBufferDirect(Y,W,j,$,F,ae),$.side=FrontSide,$.needsUpdate=!0,_.renderBufferDirect(Y,W,j,$,F,ae),$.side=DoubleSide):_.renderBufferDirect(Y,W,j,$,F,ae),F.onAfterRender(_,W,Y,j,$,ae)}function ut(F,W,Y){W.isScene!==!0&&(W=Ne);const j=ve.get(F),$=c.state.lights,ae=c.state.shadowsArray,he=$.state.version,pe=de.getParameters(F,$.state,ae,W,Y),Se=de.getProgramCacheKey(pe);let Re=j.programs;j.environment=F.isMeshStandardMaterial?W.environment:null,j.fog=W.fog,j.envMap=(F.isMeshStandardMaterial?q:I).get(F.envMap||j.environment),j.envMapRotation=j.environment!==null&&F.envMap===null?W.environmentRotation:F.envMapRotation,Re===void 0&&(F.addEventListener("dispose",De),Re=new Map,j.programs=Re);let we=Re.get(Se);if(we!==void 0){if(j.currentProgram===we&&j.lightsStateVersion===he)return St(F,pe),we}else pe.uniforms=de.getUniforms(F),F.onBeforeCompile(pe,_),we=de.acquireProgram(pe,Se),Re.set(Se,we),j.uniforms=pe.uniforms;const Te=j.uniforms;return(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(Te.clippingPlanes=se.uniform),St(F,pe),j.needsLights=bt(F),j.lightsStateVersion=he,j.needsLights&&(Te.ambientLightColor.value=$.state.ambient,Te.lightProbe.value=$.state.probe,Te.directionalLights.value=$.state.directional,Te.directionalLightShadows.value=$.state.directionalShadow,Te.spotLights.value=$.state.spot,Te.spotLightShadows.value=$.state.spotShadow,Te.rectAreaLights.value=$.state.rectArea,Te.ltc_1.value=$.state.rectAreaLTC1,Te.ltc_2.value=$.state.rectAreaLTC2,Te.pointLights.value=$.state.point,Te.pointLightShadows.value=$.state.pointShadow,Te.hemisphereLights.value=$.state.hemi,Te.directionalShadowMap.value=$.state.directionalShadowMap,Te.directionalShadowMatrix.value=$.state.directionalShadowMatrix,Te.spotShadowMap.value=$.state.spotShadowMap,Te.spotLightMatrix.value=$.state.spotLightMatrix,Te.spotLightMap.value=$.state.spotLightMap,Te.pointShadowMap.value=$.state.pointShadowMap,Te.pointShadowMatrix.value=$.state.pointShadowMatrix),j.currentProgram=we,j.uniformsList=null,we}function xt(F){if(F.uniformsList===null){const W=F.currentProgram.getUniforms();F.uniformsList=WebGLUniforms.seqWithValue(W.seq,F.uniforms)}return F.uniformsList}function St(F,W){const Y=ve.get(F);Y.outputColorSpace=W.outputColorSpace,Y.batching=W.batching,Y.batchingColor=W.batchingColor,Y.instancing=W.instancing,Y.instancingColor=W.instancingColor,Y.instancingMorph=W.instancingMorph,Y.skinning=W.skinning,Y.morphTargets=W.morphTargets,Y.morphNormals=W.morphNormals,Y.morphColors=W.morphColors,Y.morphTargetsCount=W.morphTargetsCount,Y.numClippingPlanes=W.numClippingPlanes,Y.numIntersection=W.numClipIntersection,Y.vertexAlphas=W.vertexAlphas,Y.vertexTangents=W.vertexTangents,Y.toneMapping=W.toneMapping}function Et(F,W,Y,j,$){W.isScene!==!0&&(W=Ne),D.resetTextureUnits();const ae=W.fog,he=j.isMeshStandardMaterial?W.environment:null,pe=R===null?_.outputColorSpace:R.isXRRenderTarget===!0?R.texture.colorSpace:LinearSRGBColorSpace,Se=(j.isMeshStandardMaterial?q:I).get(j.envMap||he),Re=j.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,we=!!Y.attributes.tangent&&(!!j.normalMap||j.anisotropy>0),Te=!!Y.morphAttributes.position,Oe=!!Y.morphAttributes.normal,ze=!!Y.morphAttributes.color;let Ke=NoToneMapping;j.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(Ke=_.toneMapping);const je=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,Ge=je!==void 0?je.length:0,Ae=ve.get(j),Ze=c.state.lights;if(Q===!0&&(ne===!0||F!==P)){const Qe=F===P&&j.id===w;se.setState(j,F,Qe)}let He=!1;j.version===Ae.__version?(Ae.needsLights&&Ae.lightsStateVersion!==Ze.state.version||Ae.outputColorSpace!==pe||$.isBatchedMesh&&Ae.batching===!1||!$.isBatchedMesh&&Ae.batching===!0||$.isBatchedMesh&&Ae.batchingColor===!0&&$.colorTexture===null||$.isBatchedMesh&&Ae.batchingColor===!1&&$.colorTexture!==null||$.isInstancedMesh&&Ae.instancing===!1||!$.isInstancedMesh&&Ae.instancing===!0||$.isSkinnedMesh&&Ae.skinning===!1||!$.isSkinnedMesh&&Ae.skinning===!0||$.isInstancedMesh&&Ae.instancingColor===!0&&$.instanceColor===null||$.isInstancedMesh&&Ae.instancingColor===!1&&$.instanceColor!==null||$.isInstancedMesh&&Ae.instancingMorph===!0&&$.morphTexture===null||$.isInstancedMesh&&Ae.instancingMorph===!1&&$.morphTexture!==null||Ae.envMap!==Se||j.fog===!0&&Ae.fog!==ae||Ae.numClippingPlanes!==void 0&&(Ae.numClippingPlanes!==se.numPlanes||Ae.numIntersection!==se.numIntersection)||Ae.vertexAlphas!==Re||Ae.vertexTangents!==we||Ae.morphTargets!==Te||Ae.morphNormals!==Oe||Ae.morphColors!==ze||Ae.toneMapping!==Ke||Ae.morphTargetsCount!==Ge)&&(He=!0):(He=!0,Ae.__version=j.version);let st=Ae.currentProgram;He===!0&&(st=ut(j,W,$));let ht=!1,tt=!1,ct=!1;const Xe=st.getUniforms(),it=Ae.uniforms;if(ge.useProgram(st.program)&&(ht=!0,tt=!0,ct=!0),j.id!==w&&(w=j.id,tt=!0),ht||P!==F){ge.buffers.depth.getReversed()?(re.copy(F.projectionMatrix),toNormalizedProjectionMatrix(re),toReversedProjectionMatrix(re),Xe.setValue(U,"projectionMatrix",re)):Xe.setValue(U,"projectionMatrix",F.projectionMatrix),Xe.setValue(U,"viewMatrix",F.matrixWorldInverse);const et=Xe.map.cameraPosition;et!==void 0&&et.setValue(U,Fe.setFromMatrixPosition(F.matrixWorld)),Ie.logarithmicDepthBuffer&&Xe.setValue(U,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&Xe.setValue(U,"isOrthographic",F.isOrthographicCamera===!0),P!==F&&(P=F,tt=!0,ct=!0)}if($.isSkinnedMesh){Xe.setOptional(U,$,"bindMatrix"),Xe.setOptional(U,$,"bindMatrixInverse");const Qe=$.skeleton;Qe&&(Qe.boneTexture===null&&Qe.computeBoneTexture(),Xe.setValue(U,"boneTexture",Qe.boneTexture,D))}$.isBatchedMesh&&(Xe.setOptional(U,$,"batchingTexture"),Xe.setValue(U,"batchingTexture",$._matricesTexture,D),Xe.setOptional(U,$,"batchingIdTexture"),Xe.setValue(U,"batchingIdTexture",$._indirectTexture,D),Xe.setOptional(U,$,"batchingColorTexture"),$._colorsTexture!==null&&Xe.setValue(U,"batchingColorTexture",$._colorsTexture,D));const nt=Y.morphAttributes;if((nt.position!==void 0||nt.normal!==void 0||nt.color!==void 0)&&Pe.update($,Y,st),(tt||Ae.receiveShadow!==$.receiveShadow)&&(Ae.receiveShadow=$.receiveShadow,Xe.setValue(U,"receiveShadow",$.receiveShadow)),j.isMeshGouraudMaterial&&j.envMap!==null&&(it.envMap.value=Se,it.flipEnvMap.value=Se.isCubeTexture&&Se.isRenderTargetTexture===!1?-1:1),j.isMeshStandardMaterial&&j.envMap===null&&W.environment!==null&&(it.envMapIntensity.value=W.environmentIntensity),tt&&(Xe.setValue(U,"toneMappingExposure",_.toneMappingExposure),Ae.needsLights&&Mt(it,ct),ae&&j.fog===!0&&le.refreshFogUniforms(it,ae),le.refreshMaterialUniforms(it,j,E,L,c.state.transmissionRenderTarget[F.id]),WebGLUniforms.upload(U,xt(Ae),it,D)),j.isShaderMaterial&&j.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(U,xt(Ae),it,D),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&Xe.setValue(U,"center",$.center),Xe.setValue(U,"modelViewMatrix",$.modelViewMatrix),Xe.setValue(U,"normalMatrix",$.normalMatrix),Xe.setValue(U,"modelMatrix",$.matrixWorld),j.isShaderMaterial||j.isRawShaderMaterial){const Qe=j.uniformsGroups;for(let et=0,pt=Qe.length;et<pt;et++){const lt=Qe[et];z.update(lt,st),z.bind(lt,st)}}return st}function Mt(F,W){F.ambientLightColor.needsUpdate=W,F.lightProbe.needsUpdate=W,F.directionalLights.needsUpdate=W,F.directionalLightShadows.needsUpdate=W,F.pointLights.needsUpdate=W,F.pointLightShadows.needsUpdate=W,F.spotLights.needsUpdate=W,F.spotLightShadows.needsUpdate=W,F.rectAreaLights.needsUpdate=W,F.hemisphereLights.needsUpdate=W}function bt(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return R},this.setRenderTargetTextures=function(F,W,Y){const j=ve.get(F);j.__autoAllocateDepthBuffer=F.resolveDepthBuffer===!1,j.__autoAllocateDepthBuffer===!1&&(j.__useRenderToTexture=!1),ve.get(F.texture).__webglTexture=W,ve.get(F.depthTexture).__webglTexture=j.__autoAllocateDepthBuffer?void 0:Y,j.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(F,W){const Y=ve.get(F);Y.__webglFramebuffer=W,Y.__useDefaultFramebuffer=W===void 0};const Tt=U.createFramebuffer();this.setRenderTarget=function(F,W=0,Y=0){R=F,M=W,A=Y;let j=!0,$=null,ae=!1,he=!1;if(F){const Se=ve.get(F);if(Se.__useDefaultFramebuffer!==void 0)ge.bindFramebuffer(U.FRAMEBUFFER,null),j=!1;else if(Se.__webglFramebuffer===void 0)D.setupRenderTarget(F);else if(Se.__hasExternalTextures)D.rebindTextures(F,ve.get(F.texture).__webglTexture,ve.get(F.depthTexture).__webglTexture);else if(F.depthBuffer){const Te=F.depthTexture;if(Se.__boundDepthTexture!==Te){if(Te!==null&&ve.has(Te)&&(F.width!==Te.image.width||F.height!==Te.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");D.setupDepthRenderbuffer(F)}}const Re=F.texture;(Re.isData3DTexture||Re.isDataArrayTexture||Re.isCompressedArrayTexture)&&(he=!0);const we=ve.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(Array.isArray(we[W])?$=we[W][Y]:$=we[W],ae=!0):F.samples>0&&D.useMultisampledRTT(F)===!1?$=ve.get(F).__webglMultisampledFramebuffer:Array.isArray(we)?$=we[Y]:$=we,N.copy(F.viewport),V.copy(F.scissor),G=F.scissorTest}else N.copy(B).multiplyScalar(E).floor(),V.copy(ee).multiplyScalar(E).floor(),G=oe;if(Y!==0&&($=Tt),ge.bindFramebuffer(U.FRAMEBUFFER,$)&&j&&ge.drawBuffers(F,$),ge.viewport(N),ge.scissor(V),ge.setScissorTest(G),ae){const Se=ve.get(F.texture);U.framebufferTexture2D(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_CUBE_MAP_POSITIVE_X+W,Se.__webglTexture,Y)}else if(he){const Se=ve.get(F.texture),Re=W;U.framebufferTextureLayer(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,Se.__webglTexture,Y,Re)}else if(F!==null&&Y!==0){const Se=ve.get(F.texture);U.framebufferTexture2D(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_2D,Se.__webglTexture,Y)}w=-1},this.readRenderTargetPixels=function(F,W,Y,j,$,ae,he){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let pe=ve.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&he!==void 0&&(pe=pe[he]),pe){ge.bindFramebuffer(U.FRAMEBUFFER,pe);try{const Se=F.texture,Re=Se.format,we=Se.type;if(!Ie.textureFormatReadable(Re)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ie.textureTypeReadable(we)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=F.width-j&&Y>=0&&Y<=F.height-$&&U.readPixels(W,Y,j,$,Ue.convert(Re),Ue.convert(we),ae)}finally{const Se=R!==null?ve.get(R).__webglFramebuffer:null;ge.bindFramebuffer(U.FRAMEBUFFER,Se)}}},this.readRenderTargetPixelsAsync=async function(F,W,Y,j,$,ae,he){if(!(F&&F.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let pe=ve.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&he!==void 0&&(pe=pe[he]),pe)if(W>=0&&W<=F.width-j&&Y>=0&&Y<=F.height-$){ge.bindFramebuffer(U.FRAMEBUFFER,pe);const Se=F.texture,Re=Se.format,we=Se.type;if(!Ie.textureFormatReadable(Re))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ie.textureTypeReadable(we))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Te=U.createBuffer();U.bindBuffer(U.PIXEL_PACK_BUFFER,Te),U.bufferData(U.PIXEL_PACK_BUFFER,ae.byteLength,U.STREAM_READ),U.readPixels(W,Y,j,$,Ue.convert(Re),Ue.convert(we),0);const Oe=R!==null?ve.get(R).__webglFramebuffer:null;ge.bindFramebuffer(U.FRAMEBUFFER,Oe);const ze=U.fenceSync(U.SYNC_GPU_COMMANDS_COMPLETE,0);return U.flush(),await probeAsync(U,ze,4),U.bindBuffer(U.PIXEL_PACK_BUFFER,Te),U.getBufferSubData(U.PIXEL_PACK_BUFFER,0,ae),U.deleteBuffer(Te),U.deleteSync(ze),ae}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(F,W=null,Y=0){const j=Math.pow(2,-Y),$=Math.floor(F.image.width*j),ae=Math.floor(F.image.height*j),he=W!==null?W.x:0,pe=W!==null?W.y:0;D.setTexture2D(F,0),U.copyTexSubImage2D(U.TEXTURE_2D,Y,0,0,he,pe,$,ae),ge.unbindTexture()};const At=U.createFramebuffer(),Ct=U.createFramebuffer();this.copyTextureToTexture=function(F,W,Y=null,j=null,$=0,ae=null){ae===null&&($!==0?(warnOnce("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ae=$,$=0):ae=0);let he,pe,Se,Re,we,Te,Oe,ze,Ke;const je=F.isCompressedTexture?F.mipmaps[ae]:F.image;if(Y!==null)he=Y.max.x-Y.min.x,pe=Y.max.y-Y.min.y,Se=Y.isBox3?Y.max.z-Y.min.z:1,Re=Y.min.x,we=Y.min.y,Te=Y.isBox3?Y.min.z:0;else{const nt=Math.pow(2,-$);he=Math.floor(je.width*nt),pe=Math.floor(je.height*nt),F.isDataArrayTexture?Se=je.depth:F.isData3DTexture?Se=Math.floor(je.depth*nt):Se=1,Re=0,we=0,Te=0}j!==null?(Oe=j.x,ze=j.y,Ke=j.z):(Oe=0,ze=0,Ke=0);const Ge=Ue.convert(W.format),Ae=Ue.convert(W.type);let Ze;W.isData3DTexture?(D.setTexture3D(W,0),Ze=U.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(D.setTexture2DArray(W,0),Ze=U.TEXTURE_2D_ARRAY):(D.setTexture2D(W,0),Ze=U.TEXTURE_2D),U.pixelStorei(U.UNPACK_FLIP_Y_WEBGL,W.flipY),U.pixelStorei(U.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),U.pixelStorei(U.UNPACK_ALIGNMENT,W.unpackAlignment);const He=U.getParameter(U.UNPACK_ROW_LENGTH),st=U.getParameter(U.UNPACK_IMAGE_HEIGHT),ht=U.getParameter(U.UNPACK_SKIP_PIXELS),tt=U.getParameter(U.UNPACK_SKIP_ROWS),ct=U.getParameter(U.UNPACK_SKIP_IMAGES);U.pixelStorei(U.UNPACK_ROW_LENGTH,je.width),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,je.height),U.pixelStorei(U.UNPACK_SKIP_PIXELS,Re),U.pixelStorei(U.UNPACK_SKIP_ROWS,we),U.pixelStorei(U.UNPACK_SKIP_IMAGES,Te);const Xe=F.isDataArrayTexture||F.isData3DTexture,it=W.isDataArrayTexture||W.isData3DTexture;if(F.isDepthTexture){const nt=ve.get(F),Qe=ve.get(W),et=ve.get(nt.__renderTarget),pt=ve.get(Qe.__renderTarget);ge.bindFramebuffer(U.READ_FRAMEBUFFER,et.__webglFramebuffer),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,pt.__webglFramebuffer);for(let lt=0;lt<Se;lt++)Xe&&(U.framebufferTextureLayer(U.READ_FRAMEBUFFER,U.COLOR_ATTACHMENT0,ve.get(F).__webglTexture,$,Te+lt),U.framebufferTextureLayer(U.DRAW_FRAMEBUFFER,U.COLOR_ATTACHMENT0,ve.get(W).__webglTexture,ae,Ke+lt)),U.blitFramebuffer(Re,we,he,pe,Oe,ze,he,pe,U.DEPTH_BUFFER_BIT,U.NEAREST);ge.bindFramebuffer(U.READ_FRAMEBUFFER,null),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,null)}else if($!==0||F.isRenderTargetTexture||ve.has(F)){const nt=ve.get(F),Qe=ve.get(W);ge.bindFramebuffer(U.READ_FRAMEBUFFER,At),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,Ct);for(let et=0;et<Se;et++)Xe?U.framebufferTextureLayer(U.READ_FRAMEBUFFER,U.COLOR_ATTACHMENT0,nt.__webglTexture,$,Te+et):U.framebufferTexture2D(U.READ_FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_2D,nt.__webglTexture,$),it?U.framebufferTextureLayer(U.DRAW_FRAMEBUFFER,U.COLOR_ATTACHMENT0,Qe.__webglTexture,ae,Ke+et):U.framebufferTexture2D(U.DRAW_FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_2D,Qe.__webglTexture,ae),$!==0?U.blitFramebuffer(Re,we,he,pe,Oe,ze,he,pe,U.COLOR_BUFFER_BIT,U.NEAREST):it?U.copyTexSubImage3D(Ze,ae,Oe,ze,Ke+et,Re,we,he,pe):U.copyTexSubImage2D(Ze,ae,Oe,ze,Re,we,he,pe);ge.bindFramebuffer(U.READ_FRAMEBUFFER,null),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,null)}else it?F.isDataTexture||F.isData3DTexture?U.texSubImage3D(Ze,ae,Oe,ze,Ke,he,pe,Se,Ge,Ae,je.data):W.isCompressedArrayTexture?U.compressedTexSubImage3D(Ze,ae,Oe,ze,Ke,he,pe,Se,Ge,je.data):U.texSubImage3D(Ze,ae,Oe,ze,Ke,he,pe,Se,Ge,Ae,je):F.isDataTexture?U.texSubImage2D(U.TEXTURE_2D,ae,Oe,ze,he,pe,Ge,Ae,je.data):F.isCompressedTexture?U.compressedTexSubImage2D(U.TEXTURE_2D,ae,Oe,ze,je.width,je.height,Ge,je.data):U.texSubImage2D(U.TEXTURE_2D,ae,Oe,ze,he,pe,Ge,Ae,je);U.pixelStorei(U.UNPACK_ROW_LENGTH,He),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,st),U.pixelStorei(U.UNPACK_SKIP_PIXELS,ht),U.pixelStorei(U.UNPACK_SKIP_ROWS,tt),U.pixelStorei(U.UNPACK_SKIP_IMAGES,ct),ae===0&&W.generateMipmaps&&U.generateMipmap(Ze),ge.unbindTexture()},this.copyTextureToTexture3D=function(F,W,Y=null,j=null,$=0){return warnOnce('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(F,W,Y,j,$)},this.initRenderTarget=function(F){ve.get(F).__webglFramebuffer===void 0&&D.setupRenderTarget(F)},this.initTexture=function(F){F.isCubeTexture?D.setTextureCube(F,0):F.isData3DTexture?D.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?D.setTexture2DArray(F,0):D.setTexture2D(F,0),ge.unbindTexture()},this.resetState=function(){M=0,A=0,R=null,ge.reset(),$e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return WebGLCoordinateSystem}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=ColorManagement._getDrawingBufferColorSpace(e),t.unpackColorSpace=ColorManagement._getUnpackColorSpace()}}const VISUAL_TIERS=new Set(["idle","thinking","waiting","working","responding","success","error","attention"]),WORKING_CLUSTER=new Set(["thinking","searching","writing","working"]),HUD_LABELS={idle:["IDLE","standing by"],thinking:["THINKING","processing depth"],waiting:["WAITING","awaiting signal"],working:["WORKING","executing task"],searching:["SEARCHING","scanning context"],writing:["WRITING","composing output"],responding:["RESPONDING","transmitting"],success:["SUCCESS","turn finished"],error:["ERROR","failure detected"],attention:["ATTENTION","priority interrupt"]},IDLE_VARIANT_LABELS=["breathe","drift","focus","release","presence"],S={idle:{primary:new Color(14716976),accent:new Color(16769184),aura:new Color(6303760),coreCol:new Color(16771248),lightCol:13664288,lightInt:2.2,noiseAmp:.065,noiseFreq:.5,swirl:0,pulseRate:.9,bodySize:.026,glowSize:.052},thinking:{primary:new Color(3170559),accent:new Color(9482495),aura:new Color(1574976),coreCol:new Color(11586815),lightCol:1589452,lightInt:2.8,noiseAmp:.11,noiseFreq:.8,swirl:.55,pulseRate:1.6,bodySize:.022,glowSize:.048},waiting:{primary:new Color(7902888),accent:new Color(11059408),aura:new Color(3162192),coreCol:new Color(11585752),lightCol:6324376,lightInt:2,noiseAmp:.075,noiseFreq:.55,swirl:.2,pulseRate:1,bodySize:.024,glowSize:.05},working:{primary:new Color(16740384),accent:new Color(16772672),aura:new Color(5246976),coreCol:new Color(16772704),lightCol:14700560,lightInt:3.6,noiseAmp:.16,noiseFreq:3.2,swirl:0,pulseRate:3.5,bodySize:.02,glowSize:.038},responding:{primary:new Color(16773264),accent:new Color(16777215),aura:new Color(4206592),coreCol:new Color(16777215),lightCol:16769120,lightInt:4.5,noiseAmp:.13,noiseFreq:1.9,swirl:0,pulseRate:2.5,bodySize:.03,glowSize:.065},success:{primary:new Color(12642424),accent:new Color(15269808),aura:new Color(2113552),coreCol:new Color(15794128),lightCol:9488448,lightInt:3.8,noiseAmp:.09,noiseFreq:1.2,swirl:0,pulseRate:1.4,bodySize:.028,glowSize:.06},error:{primary:new Color(13395711),accent:new Color(15645695),aura:new Color(2099256),coreCol:new Color(14527231),lightCol:8925388,lightInt:1.8,noiseAmp:.2,noiseFreq:.75,swirl:-.4,pulseRate:1,bodySize:.026,glowSize:.052},attention:{primary:new Color(16717864),accent:new Color(16748640),aura:new Color(3146760),coreCol:new Color(16744544),lightCol:14485528,lightInt:5.5,noiseAmp:.26,noiseFreq:5.5,swirl:0,pulseRate:7,bodySize:.027,glowSize:.058}},REGIONS=[[0,3.22,.02,.3,.32,.26,.13,"s"],[0,2.6,0,.12,.15,.12,.03,"s"],[0,2.02,0,.4,.62,.2,.22,"c"],[0,1.52,0,.34,.22,.18,.07,"c"],[-.57,2.36,.02,.1,.37,.1,.06,"c"],[.57,2.36,.02,.1,.37,.1,.06,"c"],[-.63,1.85,.04,.08,.33,.08,.05,"c"],[.63,1.85,.04,.08,.33,.08,.05,"c"],[-.19,1.02,.01,.1,.44,.1,.07,"c"],[.19,1.02,.01,.1,.44,.1,.07,"c"],[-.19,.45,.02,.08,.42,.08,.06,"c"],[.19,.45,.02,.08,.42,.08,.06,"c"],[-.19,.08,.07,.1,.04,.17,.02,"c"],[.19,.08,.07,.1,.04,.17,.02,"c"]],PI2=Math.PI*2,NB=1400,NG=520,NA=360,NM=200,NS=750;function generateBodyPositions(i){const e=new Float32Array(i*3),t=REGIONS.reduce((r,s)=>r+s[6],0);let n=0;for(REGIONS.forEach(r=>{const s=Math.round(i*r[6]/t);for(let a=0;a<s&&n<i;a++,n++)if(r[7]==="s"){const o=Math.acos(2*Math.random()-1),l=Math.random()*PI2,h=Math.cbrt(Math.random());e[n*3]=r[0]+Math.sin(o)*Math.cos(l)*r[3]*h,e[n*3+1]=r[1]+Math.cos(o)*r[4]*h,e[n*3+2]=r[2]+Math.sin(o)*Math.sin(l)*r[5]*h}else{const o=Math.random()*PI2,l=Math.sqrt(Math.random());e[n*3]=r[0]+Math.cos(o)*r[3]*l,e[n*3+1]=r[1]+(Math.random()-.5)*r[4]*2,e[n*3+2]=r[2]+Math.sin(o)*r[5]*l}});n<i;)e[n*3]=(Math.random()-.5)*1.3,e[n*3+1]=Math.random()*3.4+.1,e[n*3+2]=(Math.random()-.5)*.4,n++;return e}function genOffsets(i){const e=new Float32Array(i*4);for(let t=0;t<i;t++)e[t*4]=Math.random()*PI2,e[t*4+1]=Math.random()*PI2,e[t*4+2]=Math.random()*PI2,e[t*4+3]=.65+Math.random()*.85;return e}class CaminaVesselRenderer{constructor(e,t){this.elapsed=0,this.camAngle=0,this.animFrameId=0,this.visualTier="idle",this.semanticState="idle",this.idleIdx=0,this.idleTimer=0,this.auraData=[],this.moteData=[],this.hudEl=null,this.hudStateEl=null,this.hudSubEl=null,this.hudEbarsEl=null,this.godRaysEl=null,this.circularFrameEl=null,this.circularArcEl=null,this.layoutTier="widescreen",this.layoutParams={fov:50,camZ:6.2,camY:2.1,auraXS:.78,auraZS:.45,moteSpreadX:5},this.viewportWidth=0,this.viewportHeight=0,this.animate=()=>{this.animFrameId=requestAnimationFrame(this.animate);const n=Math.min(this.clock.getDelta(),.05);this.elapsed+=n,this.tick(n),this.renderer.render(this.scene,this.camera)},this.opts={pixelRatio:Math.min(devicePixelRatio,2),idleCycleMs:9e3,transitionMs:3.2,circularDisplay:!1,...t},this.opts.circularDisplay&&(Object.assign(e.style,{borderRadius:"50%"}),e.classList.add("ev-circular-container")),this.renderer=new WebGLRenderer({antialias:!0}),this.renderer.setSize(t.width,t.height,!1),this.renderer.setPixelRatio(this.opts.pixelRatio),this.renderer.toneMapping=ACESFilmicToneMapping,this.renderer.toneMappingExposure=1.35,Object.assign(this.renderer.domElement.style,{display:"block",position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"1"}),e.appendChild(this.renderer.domElement),this.scene=new Scene,this.scene.background=new Color(131848),this.scene.fog=new FogExp2(131848,.016),this.viewportWidth=t.width,this.viewportHeight=t.height,this.applyLayoutTier(t.width,t.height,!1),this.camera=new PerspectiveCamera(this.layoutParams.fov,t.width/t.height,.1,300),this.camera.position.set(.6,this.layoutParams.camY,this.layoutParams.camZ),this.camera.lookAt(0,1.9,0),this.clock=new Clock,this.tgt=S.idle,this.cur={primary:S.idle.primary.clone(),accent:S.idle.accent.clone(),aura:S.idle.aura.clone(),coreCol:S.idle.coreCol.clone(),lightInt:S.idle.lightInt,noiseAmp:S.idle.noiseAmp,noiseFreq:S.idle.noiseFreq,swirl:S.idle.swirl,pulseRate:S.idle.pulseRate,bodySize:S.idle.bodySize,glowSize:S.idle.glowSize},this.homeB=generateBodyPositions(NB),this.homeG=generateBodyPositions(NG),this.offB=genOffsets(NB),this.offG=genOffsets(NG),this.posB=this.homeB.slice(),this.posG=this.homeG.slice(),this.posA=new Float32Array(NA*3),this.posM=new Float32Array(NM*3),this.initAuraParticles(),this.initMoteParticles(),this.geoBody=this.makeGeo(this.posB),this.geoGlow=this.makeGeo(this.posG),this.geoAura=this.makeGeo(this.posA),this.geoMotes=this.makeGeo(this.posM),this.matBody=this.makePMat(14716976,.026,.9),this.matGlow=this.makePMat(16771232,.052,.32),this.matAura=this.makePMat(6303760,.075,.2),this.matMotes=this.makePMat(5255184,.033,.5),this.coreLight=new PointLight,this.groundGlow=new PointLight,this.buildScene(),this.buildHUD(e),this.animate()}setState(e,t){const n=t?.semantic??e,r=this.resolveVisualTier(e,n,!!t),s=S[r];if(!s){console.warn(`[CaminaVesselRenderer] Unknown visual tier "${e}" — ignoring`);return}this.semanticState=n,this.hudTool=t?.tool,r!==this.visualTier&&(this.visualTier=r,r!=="idle"&&(this.idleTimer=0),this.tgt=s),this.refreshHud()}resolveVisualTier(e,t,n){return n&&VISUAL_TIERS.has(e)||!n&&VISUAL_TIERS.has(e)?e:t==="searching"||t==="writing"?"working":VISUAL_TIERS.has(t)?t:"idle"}resolveHudSub(){if(this.hudTool)return this.hudTool;if(this.visualTier==="working"&&WORKING_CLUSTER.has(this.semanticState))return this.semanticState;const[,e]=HUD_LABELS[this.visualTier]??["IDLE","standing by"];return e}refreshHud(){const e=S[this.visualTier],[t]=HUD_LABELS[this.visualTier]??["IDLE","standing by"],n=this.resolveHudSub(),r=e.primary,s="#"+r.getHexString(),a=`${Math.round(r.r*255)}, ${Math.round(r.g*255)}, ${Math.round(r.b*255)}`;this.hudStateEl&&(this.hudStateEl.textContent=t,this.hudStateEl.style.color=s),this.hudSubEl&&(this.hudSubEl.textContent=n,this.opts.circularDisplay&&(this.hudSubEl.style.display=n&&n!==(HUD_LABELS[this.visualTier]?.[1]??"")?"":"none")),this.godRaysEl&&this.godRaysEl.style.setProperty("--ev-ray-color",a)}resize(e,t){this.renderer.setSize(e,t,!1),this.applyLayoutTier(e,t,!0),this.camera.fov=this.layoutParams.fov,this.camera.aspect=e/t,this.camera.position.y=this.layoutParams.camY,this.camera.position.z=this.layoutParams.camZ,this.camera.updateProjectionMatrix()}dispose(){cancelAnimationFrame(this.animFrameId),this.renderer.dispose(),this.renderer.domElement.remove(),this.godRaysEl?.remove(),this.circularArcEl?.remove(),this.circularFrameEl?.remove(),this.hudEl?.remove()}get currentIdleVariant(){return this.idleIdx}get currentIdleLabel(){return IDLE_VARIANT_LABELS[this.idleIdx]??""}makeGeo(e){const t=new BufferGeometry;return t.setAttribute("position",new BufferAttribute(e,3)),t}makePMat(e,t,n){return new PointsMaterial({color:e,size:t,sizeAttenuation:!0,transparent:!0,opacity:n,blending:AdditiveBlending,depthWrite:!1})}lv(e,t,n){return e+(t-e)*n}smooth(e,t){return 1-Math.pow(.001,e*t)}resolveLayoutTier(e,t){if(this.opts.circularDisplay)return"circular";const n=e/Math.max(t,1);return n>2.5?"ultrawide":n>=.85&&n<=1.15?"square":"widescreen"}layoutParamsForTier(e){switch(e){case"ultrawide":return{fov:42,camZ:4.8,camY:2.1,auraXS:2.2,auraZS:.9,moteSpreadX:14};case"square":return{fov:48,camZ:5.4,camY:2,auraXS:1,auraZS:.72,moteSpreadX:6.5};case"circular":return{fov:44,camZ:6.4,camY:1.92,auraXS:.82,auraZS:.62,moteSpreadX:4.2};default:return{fov:50,camZ:6.2,camY:2.1,auraXS:.78,auraZS:.45,moteSpreadX:5}}}initAuraParticles(){this.auraData=[];for(let e=0;e<NA;e++){const t=Math.random()*PI2,n=.9+Math.random()*1;this.auraData.push({angle:t,spd:.07+Math.random()*.14,phase:Math.random()*PI2,r:n,elev:Math.random()*.3}),this.posA[e*3]=Math.cos(t)*n*this.layoutParams.auraXS,this.posA[e*3+1]=1.7+Math.sin(t*.65)*n*1.45,this.posA[e*3+2]=Math.sin(t)*n*this.layoutParams.auraZS}}initMoteParticles(){this.moteData=[];for(let e=0;e<NM;e++){const t=(Math.random()-.5)*this.layoutParams.moteSpreadX,n=(Math.random()-.5)*3.5-.5;this.moteData.push({x:t,z:n,riseSpd:.04+Math.random()*.2,phase:Math.random()*PI2}),this.posM[e*3]=t,this.posM[e*3+1]=Math.random()*1,this.posM[e*3+2]=n}}applyLayoutTier(e,t,n){const r=this.resolveLayoutTier(e,t),s=r!==this.layoutTier;this.layoutTier=r,this.layoutParams=this.layoutParamsForTier(r),this.viewportWidth=e,this.viewportHeight=t,n&&s&&(this.initAuraParticles(),this.initMoteParticles(),this.geoAura.attributes.position.needsUpdate=!0,this.geoMotes.attributes.position.needsUpdate=!0)}buildHUD(e){if(!document.getElementById("ev-hud-styles")){const r=document.createElement("style");r.id="ev-hud-styles",r.textContent=`
|
|
3820
|
+
}`;class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const r=new Texture,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new ShaderMaterial({vertexShader:_occlusion_vertex,fragmentShader:_occlusion_fragment,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class WebXRManager extends EventDispatcher{constructor(e,t){super();const n=this;let r=null,s=1,a=null,o="local-floor",l=1,h=null,u=null,p=null,f=null,d=null,m=null;const g=new WebXRDepthSensing,y=t.getContextAttributes();let c=null,x=null;const v=[],_=[],b=new Vector2;let M=null;const A=new PerspectiveCamera;A.viewport=new Vector4;const R=new PerspectiveCamera;R.viewport=new Vector4;const w=[A,R],P=new ArrayCamera;let N=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let Q=v[X];return Q===void 0&&(Q=new WebXRController,v[X]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(X){let Q=v[X];return Q===void 0&&(Q=new WebXRController,v[X]=Q),Q.getGripSpace()},this.getHand=function(X){let Q=v[X];return Q===void 0&&(Q=new WebXRController,v[X]=Q),Q.getHandSpace()};function G(X){const Q=_.indexOf(X.inputSource);if(Q===-1)return;const ne=v[Q];ne!==void 0&&(ne.update(X.inputSource,X.frame,h||a),ne.dispatchEvent({type:X.type,data:X.inputSource}))}function H(){r.removeEventListener("select",G),r.removeEventListener("selectstart",G),r.removeEventListener("selectend",G),r.removeEventListener("squeeze",G),r.removeEventListener("squeezestart",G),r.removeEventListener("squeezeend",G),r.removeEventListener("end",H),r.removeEventListener("inputsourceschange",O);for(let X=0;X<v.length;X++){const Q=_[X];Q!==null&&(_[X]=null,v[X].disconnect(Q))}N=null,V=null,g.reset(),e.setRenderTarget(c),d=null,f=null,p=null,r=null,x=null,oe.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(b.width,b.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){s=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){o=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||a},this.setReferenceSpace=function(X){h=X},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return p},this.getFrame=function(){return m},this.getSession=function(){return r},this.setSession=async function(X){if(r=X,r!==null){if(c=e.getRenderTarget(),r.addEventListener("select",G),r.addEventListener("selectstart",G),r.addEventListener("selectend",G),r.addEventListener("squeeze",G),r.addEventListener("squeezestart",G),r.addEventListener("squeezeend",G),r.addEventListener("end",H),r.addEventListener("inputsourceschange",O),y.xrCompatible!==!0&&await t.makeXRCompatible(),M=e.getPixelRatio(),e.getSize(b),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ne=null,re=null,me=null;y.depth&&(me=y.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ne=y.stencil?DepthStencilFormat:DepthFormat,re=y.stencil?UnsignedInt248Type:UnsignedIntType);const Fe={colorFormat:t.RGBA8,depthFormat:me,scaleFactor:s};p=new XRWebGLBinding(r,t),f=p.createProjectionLayer(Fe),r.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),x=new WebGLRenderTarget(f.textureWidth,f.textureHeight,{format:RGBAFormat,type:UnsignedByteType,depthTexture:new DepthTexture(f.textureWidth,f.textureHeight,re,void 0,void 0,void 0,void 0,void 0,void 0,ne),stencilBuffer:y.stencil,colorSpace:e.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}else{const ne={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(r,t,ne),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),x=new WebGLRenderTarget(d.framebufferWidth,d.framebufferHeight,{format:RGBAFormat,type:UnsignedByteType,colorSpace:e.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(l),h=null,a=await r.requestReferenceSpace(o),oe.setContext(r),oe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function O(X){for(let Q=0;Q<X.removed.length;Q++){const ne=X.removed[Q],re=_.indexOf(ne);re>=0&&(_[re]=null,v[re].disconnect(ne))}for(let Q=0;Q<X.added.length;Q++){const ne=X.added[Q];let re=_.indexOf(ne);if(re===-1){for(let Fe=0;Fe<v.length;Fe++)if(Fe>=_.length){_.push(ne),re=Fe;break}else if(_[Fe]===null){_[Fe]=ne,re=Fe;break}if(re===-1)break}const me=v[re];me&&me.connect(ne)}}const C=new Vector3,L=new Vector3;function E(X,Q,ne){C.setFromMatrixPosition(Q.matrixWorld),L.setFromMatrixPosition(ne.matrixWorld);const re=C.distanceTo(L),me=Q.projectionMatrix.elements,Fe=ne.projectionMatrix.elements,Ee=me[14]/(me[10]-1),Ne=me[14]/(me[10]+1),Be=(me[9]+1)/me[5],_e=(me[9]-1)/me[5],U=(me[8]-1)/me[0],qe=(Fe[8]+1)/Fe[0],Le=Ee*U,Ie=Ee*qe,ge=re/(-U+qe),ke=ge*-U;if(Q.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(ke),X.translateZ(ge),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert(),me[10]===-1)X.projectionMatrix.copy(Q.projectionMatrix),X.projectionMatrixInverse.copy(Q.projectionMatrixInverse);else{const ve=Ee+ge,D=Ne+ge,I=Le-ke,q=Ie+(re-ke),J=Be*Ne/D*ve,te=_e*Ne/D*ve;X.projectionMatrix.makePerspective(I,q,J,te,ve,D),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}}function T(X,Q){Q===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(Q.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(r===null)return;let Q=X.near,ne=X.far;g.texture!==null&&(g.depthNear>0&&(Q=g.depthNear),g.depthFar>0&&(ne=g.depthFar)),P.near=R.near=A.near=Q,P.far=R.far=A.far=ne,(N!==P.near||V!==P.far)&&(r.updateRenderState({depthNear:P.near,depthFar:P.far}),N=P.near,V=P.far),A.layers.mask=X.layers.mask|2,R.layers.mask=X.layers.mask|4,P.layers.mask=A.layers.mask|R.layers.mask;const re=X.parent,me=P.cameras;T(P,re);for(let Fe=0;Fe<me.length;Fe++)T(me[Fe],re);me.length===2?E(P,A,R):P.projectionMatrix.copy(A.projectionMatrix),k(X,P,re)};function k(X,Q,ne){ne===null?X.matrix.copy(Q.matrixWorld):(X.matrix.copy(ne.matrixWorld),X.matrix.invert(),X.matrix.multiply(Q.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(Q.projectionMatrix),X.projectionMatrixInverse.copy(Q.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=RAD2DEG*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return P},this.getFoveation=function(){if(!(f===null&&d===null))return l},this.setFoveation=function(X){l=X,f!==null&&(f.fixedFoveation=X),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=X)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(P)};let B=null;function ee(X,Q){if(u=Q.getViewerPose(h||a),m=Q,u!==null){const ne=u.views;d!==null&&(e.setRenderTargetFramebuffer(x,d.framebuffer),e.setRenderTarget(x));let re=!1;ne.length!==P.cameras.length&&(P.cameras.length=0,re=!0);for(let Ee=0;Ee<ne.length;Ee++){const Ne=ne[Ee];let Be=null;if(d!==null)Be=d.getViewport(Ne);else{const U=p.getViewSubImage(f,Ne);Be=U.viewport,Ee===0&&(e.setRenderTargetTextures(x,U.colorTexture,U.depthStencilTexture),e.setRenderTarget(x))}let _e=w[Ee];_e===void 0&&(_e=new PerspectiveCamera,_e.layers.enable(Ee),_e.viewport=new Vector4,w[Ee]=_e),_e.matrix.fromArray(Ne.transform.matrix),_e.matrix.decompose(_e.position,_e.quaternion,_e.scale),_e.projectionMatrix.fromArray(Ne.projectionMatrix),_e.projectionMatrixInverse.copy(_e.projectionMatrix).invert(),_e.viewport.set(Be.x,Be.y,Be.width,Be.height),Ee===0&&(P.matrix.copy(_e.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale)),re===!0&&P.cameras.push(_e)}const me=r.enabledFeatures;if(me&&me.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&p){const Ee=p.getDepthInformation(ne[0]);Ee&&Ee.isValid&&Ee.texture&&g.init(e,Ee,r.renderState)}}for(let ne=0;ne<v.length;ne++){const re=_[ne],me=v[ne];re!==null&&me!==void 0&&me.update(re,Q,h||a)}B&&B(X,Q),Q.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:Q}),m=null}const oe=new WebGLAnimation;oe.setAnimationLoop(ee),this.setAnimationLoop=function(X){B=X},this.dispose=function(){}}}const _e1=new Euler,_m1=new Matrix4;function WebGLMaterials(i,e){function t(y,c){y.matrixAutoUpdate===!0&&y.updateMatrix(),c.value.copy(y.matrix)}function n(y,c){c.color.getRGB(y.fogColor.value,getUnlitUniformColorSpace(i)),c.isFog?(y.fogNear.value=c.near,y.fogFar.value=c.far):c.isFogExp2&&(y.fogDensity.value=c.density)}function r(y,c,x,v,_){c.isMeshBasicMaterial||c.isMeshLambertMaterial?s(y,c):c.isMeshToonMaterial?(s(y,c),p(y,c)):c.isMeshPhongMaterial?(s(y,c),u(y,c)):c.isMeshStandardMaterial?(s(y,c),f(y,c),c.isMeshPhysicalMaterial&&d(y,c,_)):c.isMeshMatcapMaterial?(s(y,c),m(y,c)):c.isMeshDepthMaterial?s(y,c):c.isMeshDistanceMaterial?(s(y,c),g(y,c)):c.isMeshNormalMaterial?s(y,c):c.isLineBasicMaterial?(a(y,c),c.isLineDashedMaterial&&o(y,c)):c.isPointsMaterial?l(y,c,x,v):c.isSpriteMaterial?h(y,c):c.isShadowMaterial?(y.color.value.copy(c.color),y.opacity.value=c.opacity):c.isShaderMaterial&&(c.uniformsNeedUpdate=!1)}function s(y,c){y.opacity.value=c.opacity,c.color&&y.diffuse.value.copy(c.color),c.emissive&&y.emissive.value.copy(c.emissive).multiplyScalar(c.emissiveIntensity),c.map&&(y.map.value=c.map,t(c.map,y.mapTransform)),c.alphaMap&&(y.alphaMap.value=c.alphaMap,t(c.alphaMap,y.alphaMapTransform)),c.bumpMap&&(y.bumpMap.value=c.bumpMap,t(c.bumpMap,y.bumpMapTransform),y.bumpScale.value=c.bumpScale,c.side===BackSide&&(y.bumpScale.value*=-1)),c.normalMap&&(y.normalMap.value=c.normalMap,t(c.normalMap,y.normalMapTransform),y.normalScale.value.copy(c.normalScale),c.side===BackSide&&y.normalScale.value.negate()),c.displacementMap&&(y.displacementMap.value=c.displacementMap,t(c.displacementMap,y.displacementMapTransform),y.displacementScale.value=c.displacementScale,y.displacementBias.value=c.displacementBias),c.emissiveMap&&(y.emissiveMap.value=c.emissiveMap,t(c.emissiveMap,y.emissiveMapTransform)),c.specularMap&&(y.specularMap.value=c.specularMap,t(c.specularMap,y.specularMapTransform)),c.alphaTest>0&&(y.alphaTest.value=c.alphaTest);const x=e.get(c),v=x.envMap,_=x.envMapRotation;v&&(y.envMap.value=v,_e1.copy(_),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(_e1.y*=-1,_e1.z*=-1),y.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),y.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=c.reflectivity,y.ior.value=c.ior,y.refractionRatio.value=c.refractionRatio),c.lightMap&&(y.lightMap.value=c.lightMap,y.lightMapIntensity.value=c.lightMapIntensity,t(c.lightMap,y.lightMapTransform)),c.aoMap&&(y.aoMap.value=c.aoMap,y.aoMapIntensity.value=c.aoMapIntensity,t(c.aoMap,y.aoMapTransform))}function a(y,c){y.diffuse.value.copy(c.color),y.opacity.value=c.opacity,c.map&&(y.map.value=c.map,t(c.map,y.mapTransform))}function o(y,c){y.dashSize.value=c.dashSize,y.totalSize.value=c.dashSize+c.gapSize,y.scale.value=c.scale}function l(y,c,x,v){y.diffuse.value.copy(c.color),y.opacity.value=c.opacity,y.size.value=c.size*x,y.scale.value=v*.5,c.map&&(y.map.value=c.map,t(c.map,y.uvTransform)),c.alphaMap&&(y.alphaMap.value=c.alphaMap,t(c.alphaMap,y.alphaMapTransform)),c.alphaTest>0&&(y.alphaTest.value=c.alphaTest)}function h(y,c){y.diffuse.value.copy(c.color),y.opacity.value=c.opacity,y.rotation.value=c.rotation,c.map&&(y.map.value=c.map,t(c.map,y.mapTransform)),c.alphaMap&&(y.alphaMap.value=c.alphaMap,t(c.alphaMap,y.alphaMapTransform)),c.alphaTest>0&&(y.alphaTest.value=c.alphaTest)}function u(y,c){y.specular.value.copy(c.specular),y.shininess.value=Math.max(c.shininess,1e-4)}function p(y,c){c.gradientMap&&(y.gradientMap.value=c.gradientMap)}function f(y,c){y.metalness.value=c.metalness,c.metalnessMap&&(y.metalnessMap.value=c.metalnessMap,t(c.metalnessMap,y.metalnessMapTransform)),y.roughness.value=c.roughness,c.roughnessMap&&(y.roughnessMap.value=c.roughnessMap,t(c.roughnessMap,y.roughnessMapTransform)),c.envMap&&(y.envMapIntensity.value=c.envMapIntensity)}function d(y,c,x){y.ior.value=c.ior,c.sheen>0&&(y.sheenColor.value.copy(c.sheenColor).multiplyScalar(c.sheen),y.sheenRoughness.value=c.sheenRoughness,c.sheenColorMap&&(y.sheenColorMap.value=c.sheenColorMap,t(c.sheenColorMap,y.sheenColorMapTransform)),c.sheenRoughnessMap&&(y.sheenRoughnessMap.value=c.sheenRoughnessMap,t(c.sheenRoughnessMap,y.sheenRoughnessMapTransform))),c.clearcoat>0&&(y.clearcoat.value=c.clearcoat,y.clearcoatRoughness.value=c.clearcoatRoughness,c.clearcoatMap&&(y.clearcoatMap.value=c.clearcoatMap,t(c.clearcoatMap,y.clearcoatMapTransform)),c.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=c.clearcoatRoughnessMap,t(c.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),c.clearcoatNormalMap&&(y.clearcoatNormalMap.value=c.clearcoatNormalMap,t(c.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(c.clearcoatNormalScale),c.side===BackSide&&y.clearcoatNormalScale.value.negate())),c.dispersion>0&&(y.dispersion.value=c.dispersion),c.iridescence>0&&(y.iridescence.value=c.iridescence,y.iridescenceIOR.value=c.iridescenceIOR,y.iridescenceThicknessMinimum.value=c.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=c.iridescenceThicknessRange[1],c.iridescenceMap&&(y.iridescenceMap.value=c.iridescenceMap,t(c.iridescenceMap,y.iridescenceMapTransform)),c.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=c.iridescenceThicknessMap,t(c.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),c.transmission>0&&(y.transmission.value=c.transmission,y.transmissionSamplerMap.value=x.texture,y.transmissionSamplerSize.value.set(x.width,x.height),c.transmissionMap&&(y.transmissionMap.value=c.transmissionMap,t(c.transmissionMap,y.transmissionMapTransform)),y.thickness.value=c.thickness,c.thicknessMap&&(y.thicknessMap.value=c.thicknessMap,t(c.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=c.attenuationDistance,y.attenuationColor.value.copy(c.attenuationColor)),c.anisotropy>0&&(y.anisotropyVector.value.set(c.anisotropy*Math.cos(c.anisotropyRotation),c.anisotropy*Math.sin(c.anisotropyRotation)),c.anisotropyMap&&(y.anisotropyMap.value=c.anisotropyMap,t(c.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=c.specularIntensity,y.specularColor.value.copy(c.specularColor),c.specularColorMap&&(y.specularColorMap.value=c.specularColorMap,t(c.specularColorMap,y.specularColorMapTransform)),c.specularIntensityMap&&(y.specularIntensityMap.value=c.specularIntensityMap,t(c.specularIntensityMap,y.specularIntensityMapTransform))}function m(y,c){c.matcap&&(y.matcap.value=c.matcap)}function g(y,c){const x=e.get(c).light;y.referencePosition.value.setFromMatrixPosition(x.matrixWorld),y.nearDistance.value=x.shadow.camera.near,y.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function WebGLUniformsGroups(i,e,t,n){let r={},s={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,v){const _=v.program;n.uniformBlockBinding(x,_)}function h(x,v){let _=r[x.id];_===void 0&&(m(x),_=u(x),r[x.id]=_,x.addEventListener("dispose",y));const b=v.program;n.updateUBOMapping(x,b);const M=e.render.frame;s[x.id]!==M&&(f(x),s[x.id]=M)}function u(x){const v=p();x.__bindingPointIndex=v;const _=i.createBuffer(),b=x.__size,M=x.usage;return i.bindBuffer(i.UNIFORM_BUFFER,_),i.bufferData(i.UNIFORM_BUFFER,b,M),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,v,_),_}function p(){for(let x=0;x<o;x++)if(a.indexOf(x)===-1)return a.push(x),x;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(x){const v=r[x.id],_=x.uniforms,b=x.__cache;i.bindBuffer(i.UNIFORM_BUFFER,v);for(let M=0,A=_.length;M<A;M++){const R=Array.isArray(_[M])?_[M]:[_[M]];for(let w=0,P=R.length;w<P;w++){const N=R[w];if(d(N,M,w,b)===!0){const V=N.__offset,G=Array.isArray(N.value)?N.value:[N.value];let H=0;for(let O=0;O<G.length;O++){const C=G[O],L=g(C);typeof C=="number"||typeof C=="boolean"?(N.__data[0]=C,i.bufferSubData(i.UNIFORM_BUFFER,V+H,N.__data)):C.isMatrix3?(N.__data[0]=C.elements[0],N.__data[1]=C.elements[1],N.__data[2]=C.elements[2],N.__data[3]=0,N.__data[4]=C.elements[3],N.__data[5]=C.elements[4],N.__data[6]=C.elements[5],N.__data[7]=0,N.__data[8]=C.elements[6],N.__data[9]=C.elements[7],N.__data[10]=C.elements[8],N.__data[11]=0):(C.toArray(N.__data,H),H+=L.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,V,N.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function d(x,v,_,b){const M=x.value,A=v+"_"+_;if(b[A]===void 0)return typeof M=="number"||typeof M=="boolean"?b[A]=M:b[A]=M.clone(),!0;{const R=b[A];if(typeof M=="number"||typeof M=="boolean"){if(R!==M)return b[A]=M,!0}else if(R.equals(M)===!1)return R.copy(M),!0}return!1}function m(x){const v=x.uniforms;let _=0;const b=16;for(let A=0,R=v.length;A<R;A++){const w=Array.isArray(v[A])?v[A]:[v[A]];for(let P=0,N=w.length;P<N;P++){const V=w[P],G=Array.isArray(V.value)?V.value:[V.value];for(let H=0,O=G.length;H<O;H++){const C=G[H],L=g(C),E=_%b,T=E%L.boundary,k=E+T;_+=T,k!==0&&b-k<L.storage&&(_+=b-k),V.__data=new Float32Array(L.storage/Float32Array.BYTES_PER_ELEMENT),V.__offset=_,_+=L.storage}}}const M=_%b;return M>0&&(_+=b-M),x.__size=_,x.__cache={},this}function g(x){const v={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(v.boundary=4,v.storage=4):x.isVector2?(v.boundary=8,v.storage=8):x.isVector3||x.isColor?(v.boundary=16,v.storage=12):x.isVector4?(v.boundary=16,v.storage=16):x.isMatrix3?(v.boundary=48,v.storage=48):x.isMatrix4?(v.boundary=64,v.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),v}function y(x){const v=x.target;v.removeEventListener("dispose",y);const _=a.indexOf(v.__bindingPointIndex);a.splice(_,1),i.deleteBuffer(r[v.id]),delete r[v.id],delete s[v.id]}function c(){for(const x in r)i.deleteBuffer(r[x]);a=[],r={},s={}}return{bind:l,update:h,dispose:c}}class WebGLRenderer{constructor(e={}){const{canvas:t=createCanvasElement(),context:n=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:p=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const m=new Uint32Array(4),g=new Int32Array(4);let y=null,c=null;const x=[],v=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const _=this;let b=!1;this._outputColorSpace=SRGBColorSpace;let M=0,A=0,R=null,w=-1,P=null;const N=new Vector4,V=new Vector4;let G=null;const H=new Color(0);let O=0,C=t.width,L=t.height,E=1,T=null,k=null;const B=new Vector4(0,0,C,L),ee=new Vector4(0,0,C,L);let oe=!1;const X=new Frustum;let Q=!1,ne=!1;const re=new Matrix4,me=new Matrix4,Fe=new Vector3,Ee=new Vector4,Ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Be=!1;function _e(){return R===null?E:1}let U=n;function qe(F,W){return t.getContext(F,W)}try{const F={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:u,failIfMajorPerformanceCaveat:p};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${REVISION}`),t.addEventListener("webglcontextlost",ie,!1),t.addEventListener("webglcontextrestored",ue,!1),t.addEventListener("webglcontextcreationerror",fe,!1),U===null){const W="webgl2";if(U=qe(W,F),U===null)throw qe(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Le,Ie,ge,ke,ve,D,I,q,J,te,K,de,le,Me,be,se,ye,Ce,Pe,xe,Ve,Ue,$e,z;function ce(){Le=new WebGLExtensions(U),Le.init(),Ue=new WebGLUtils(U,Le),Ie=new WebGLCapabilities(U,Le,e,Ue),ge=new WebGLState(U,Le),Ie.reverseDepthBuffer&&f&&ge.buffers.depth.setReversed(!0),ke=new WebGLInfo(U),ve=new WebGLProperties,D=new WebGLTextures(U,Le,ge,ve,Ie,Ue,ke),I=new WebGLCubeMaps(_),q=new WebGLCubeUVMaps(_),J=new WebGLAttributes(U),$e=new WebGLBindingStates(U,J),te=new WebGLGeometries(U,J,ke,$e),K=new WebGLObjects(U,te,J,ke),Pe=new WebGLMorphtargets(U,Ie,D),se=new WebGLClipping(ve),de=new WebGLPrograms(_,I,q,Le,Ie,$e,se),le=new WebGLMaterials(_,ve),Me=new WebGLRenderLists,be=new WebGLRenderStates(Le),Ce=new WebGLBackground(_,I,q,ge,K,d,l),ye=new WebGLShadowMap(_,K,Ie),z=new WebGLUniformsGroups(U,ke,Ie,ge),xe=new WebGLBufferRenderer(U,Le,ke),Ve=new WebGLIndexedBufferRenderer(U,Le,ke),ke.programs=de.programs,_.capabilities=Ie,_.extensions=Le,_.properties=ve,_.renderLists=Me,_.shadowMap=ye,_.state=ge,_.info=ke}ce();const Z=new WebXRManager(_,U);this.xr=Z,this.getContext=function(){return U},this.getContextAttributes=function(){return U.getContextAttributes()},this.forceContextLoss=function(){const F=Le.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Le.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return E},this.setPixelRatio=function(F){F!==void 0&&(E=F,this.setSize(C,L,!1))},this.getSize=function(F){return F.set(C,L)},this.setSize=function(F,W,Y=!0){if(Z.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}C=F,L=W,t.width=Math.floor(F*E),t.height=Math.floor(W*E),Y===!0&&(t.style.width=F+"px",t.style.height=W+"px"),this.setViewport(0,0,F,W)},this.getDrawingBufferSize=function(F){return F.set(C*E,L*E).floor()},this.setDrawingBufferSize=function(F,W,Y){C=F,L=W,E=Y,t.width=Math.floor(F*Y),t.height=Math.floor(W*Y),this.setViewport(0,0,F,W)},this.getCurrentViewport=function(F){return F.copy(N)},this.getViewport=function(F){return F.copy(B)},this.setViewport=function(F,W,Y,j){F.isVector4?B.set(F.x,F.y,F.z,F.w):B.set(F,W,Y,j),ge.viewport(N.copy(B).multiplyScalar(E).round())},this.getScissor=function(F){return F.copy(ee)},this.setScissor=function(F,W,Y,j){F.isVector4?ee.set(F.x,F.y,F.z,F.w):ee.set(F,W,Y,j),ge.scissor(V.copy(ee).multiplyScalar(E).round())},this.getScissorTest=function(){return oe},this.setScissorTest=function(F){ge.setScissorTest(oe=F)},this.setOpaqueSort=function(F){T=F},this.setTransparentSort=function(F){k=F},this.getClearColor=function(F){return F.copy(Ce.getClearColor())},this.setClearColor=function(){Ce.setClearColor(...arguments)},this.getClearAlpha=function(){return Ce.getClearAlpha()},this.setClearAlpha=function(){Ce.setClearAlpha(...arguments)},this.clear=function(F=!0,W=!0,Y=!0){let j=0;if(F){let $=!1;if(R!==null){const ae=R.texture.format;$=ae===RGBAIntegerFormat||ae===RGIntegerFormat||ae===RedIntegerFormat}if($){const ae=R.texture.type,he=ae===UnsignedByteType||ae===UnsignedIntType||ae===UnsignedShortType||ae===UnsignedInt248Type||ae===UnsignedShort4444Type||ae===UnsignedShort5551Type,pe=Ce.getClearColor(),Se=Ce.getClearAlpha(),Re=pe.r,we=pe.g,Te=pe.b;he?(m[0]=Re,m[1]=we,m[2]=Te,m[3]=Se,U.clearBufferuiv(U.COLOR,0,m)):(g[0]=Re,g[1]=we,g[2]=Te,g[3]=Se,U.clearBufferiv(U.COLOR,0,g))}else j|=U.COLOR_BUFFER_BIT}W&&(j|=U.DEPTH_BUFFER_BIT),Y&&(j|=U.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),U.clear(j)},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(){t.removeEventListener("webglcontextlost",ie,!1),t.removeEventListener("webglcontextrestored",ue,!1),t.removeEventListener("webglcontextcreationerror",fe,!1),Ce.dispose(),Me.dispose(),be.dispose(),ve.dispose(),I.dispose(),q.dispose(),K.dispose(),$e.dispose(),z.dispose(),de.dispose(),Z.dispose(),Z.removeEventListener("sessionstart",mt),Z.removeEventListener("sessionend",gt),ot.stop()};function ie(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function ue(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const F=ke.autoReset,W=ye.enabled,Y=ye.autoUpdate,j=ye.needsUpdate,$=ye.type;ce(),ke.autoReset=F,ye.enabled=W,ye.autoUpdate=Y,ye.needsUpdate=j,ye.type=$}function fe(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function De(F){const W=F.target;W.removeEventListener("dispose",De),Ye(W)}function Ye(F){Je(F),ve.remove(F)}function Je(F){const W=ve.get(F).programs;W!==void 0&&(W.forEach(function(Y){de.releaseProgram(Y)}),F.isShaderMaterial&&de.releaseShaderCache(F))}this.renderBufferDirect=function(F,W,Y,j,$,ae){W===null&&(W=Ne);const he=$.isMesh&&$.matrixWorld.determinant()<0,pe=Et(F,W,Y,j,$);ge.setMaterial(j,he);let Se=Y.index,Re=1;if(j.wireframe===!0){if(Se=te.getWireframeAttribute(Y),Se===void 0)return;Re=2}const we=Y.drawRange,Te=Y.attributes.position;let Oe=we.start*Re,ze=(we.start+we.count)*Re;ae!==null&&(Oe=Math.max(Oe,ae.start*Re),ze=Math.min(ze,(ae.start+ae.count)*Re)),Se!==null?(Oe=Math.max(Oe,0),ze=Math.min(ze,Se.count)):Te!=null&&(Oe=Math.max(Oe,0),ze=Math.min(ze,Te.count));const Ke=ze-Oe;if(Ke<0||Ke===1/0)return;$e.setup($,j,pe,Y,Se);let je,Ge=xe;if(Se!==null&&(je=J.get(Se),Ge=Ve,Ge.setIndex(je)),$.isMesh)j.wireframe===!0?(ge.setLineWidth(j.wireframeLinewidth*_e()),Ge.setMode(U.LINES)):Ge.setMode(U.TRIANGLES);else if($.isLine){let Ae=j.linewidth;Ae===void 0&&(Ae=1),ge.setLineWidth(Ae*_e()),$.isLineSegments?Ge.setMode(U.LINES):$.isLineLoop?Ge.setMode(U.LINE_LOOP):Ge.setMode(U.LINE_STRIP)}else $.isPoints?Ge.setMode(U.POINTS):$.isSprite&&Ge.setMode(U.TRIANGLES);if($.isBatchedMesh)if($._multiDrawInstances!==null)warnOnce("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ge.renderMultiDrawInstances($._multiDrawStarts,$._multiDrawCounts,$._multiDrawCount,$._multiDrawInstances);else if(Le.get("WEBGL_multi_draw"))Ge.renderMultiDraw($._multiDrawStarts,$._multiDrawCounts,$._multiDrawCount);else{const Ae=$._multiDrawStarts,Ze=$._multiDrawCounts,He=$._multiDrawCount,st=Se?J.get(Se).bytesPerElement:1,ht=ve.get(j).currentProgram.getUniforms();for(let tt=0;tt<He;tt++)ht.setValue(U,"_gl_DrawID",tt),Ge.render(Ae[tt]/st,Ze[tt])}else if($.isInstancedMesh)Ge.renderInstances(Oe,Ke,$.count);else if(Y.isInstancedBufferGeometry){const Ae=Y._maxInstanceCount!==void 0?Y._maxInstanceCount:1/0,Ze=Math.min(Y.instanceCount,Ae);Ge.renderInstances(Oe,Ke,Ze)}else Ge.render(Oe,Ke)};function We(F,W,Y){F.transparent===!0&&F.side===DoubleSide&&F.forceSinglePass===!1?(F.side=BackSide,F.needsUpdate=!0,ut(F,W,Y),F.side=FrontSide,F.needsUpdate=!0,ut(F,W,Y),F.side=DoubleSide):ut(F,W,Y)}this.compile=function(F,W,Y=null){Y===null&&(Y=F),c=be.get(Y),c.init(W),v.push(c),Y.traverseVisible(function($){$.isLight&&$.layers.test(W.layers)&&(c.pushLight($),$.castShadow&&c.pushShadow($))}),F!==Y&&F.traverseVisible(function($){$.isLight&&$.layers.test(W.layers)&&(c.pushLight($),$.castShadow&&c.pushShadow($))}),c.setupLights();const j=new Set;return F.traverse(function($){if(!($.isMesh||$.isPoints||$.isLine||$.isSprite))return;const ae=$.material;if(ae)if(Array.isArray(ae))for(let he=0;he<ae.length;he++){const pe=ae[he];We(pe,Y,$),j.add(pe)}else We(ae,Y,$),j.add(ae)}),c=v.pop(),j},this.compileAsync=function(F,W,Y=null){const j=this.compile(F,W,Y);return new Promise($=>{function ae(){if(j.forEach(function(he){ve.get(he).currentProgram.isReady()&&j.delete(he)}),j.size===0){$(F);return}setTimeout(ae,10)}Le.get("KHR_parallel_shader_compile")!==null?ae():setTimeout(ae,10)})};let rt=null;function at(F){rt&&rt(F)}function mt(){ot.stop()}function gt(){ot.start()}const ot=new WebGLAnimation;ot.setAnimationLoop(at),typeof self<"u"&&ot.setContext(self),this.setAnimationLoop=function(F){rt=F,Z.setAnimationLoop(F),F===null?ot.stop():ot.start()},Z.addEventListener("sessionstart",mt),Z.addEventListener("sessionend",gt),this.render=function(F,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;if(F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),Z.enabled===!0&&Z.isPresenting===!0&&(Z.cameraAutoUpdate===!0&&Z.updateCamera(W),W=Z.getCamera()),F.isScene===!0&&F.onBeforeRender(_,F,W,R),c=be.get(F,v.length),c.init(W),v.push(c),me.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),X.setFromProjectionMatrix(me),ne=this.localClippingEnabled,Q=se.init(this.clippingPlanes,ne),y=Me.get(F,x.length),y.init(),x.push(y),Z.enabled===!0&&Z.isPresenting===!0){const ae=_.xr.getDepthSensingMesh();ae!==null&&dt(ae,W,-1/0,_.sortObjects)}dt(F,W,0,_.sortObjects),y.finish(),_.sortObjects===!0&&y.sort(T,k),Be=Z.enabled===!1||Z.isPresenting===!1||Z.hasDepthSensing()===!1,Be&&Ce.addToRenderList(y,F),this.info.render.frame++,Q===!0&&se.beginShadows();const Y=c.state.shadowsArray;ye.render(Y,F,W),Q===!0&&se.endShadows(),this.info.autoReset===!0&&this.info.reset();const j=y.opaque,$=y.transmissive;if(c.setupLights(),W.isArrayCamera){const ae=W.cameras;if($.length>0)for(let he=0,pe=ae.length;he<pe;he++){const Se=ae[he];_t(j,$,F,Se)}Be&&Ce.render(F);for(let he=0,pe=ae.length;he<pe;he++){const Se=ae[he];vt(y,F,Se,Se.viewport)}}else $.length>0&&_t(j,$,F,W),Be&&Ce.render(F),vt(y,F,W);R!==null&&A===0&&(D.updateMultisampleRenderTarget(R),D.updateRenderTargetMipmap(R)),F.isScene===!0&&F.onAfterRender(_,F,W),$e.resetDefaultState(),w=-1,P=null,v.pop(),v.length>0?(c=v[v.length-1],Q===!0&&se.setGlobalState(_.clippingPlanes,c.state.camera)):c=null,x.pop(),x.length>0?y=x[x.length-1]:y=null};function dt(F,W,Y,j){if(F.visible===!1)return;if(F.layers.test(W.layers)){if(F.isGroup)Y=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(W);else if(F.isLight)c.pushLight(F),F.castShadow&&c.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||X.intersectsSprite(F)){j&&Ee.setFromMatrixPosition(F.matrixWorld).applyMatrix4(me);const he=K.update(F),pe=F.material;pe.visible&&y.push(F,he,pe,Y,Ee.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||X.intersectsObject(F))){const he=K.update(F),pe=F.material;if(j&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Ee.copy(F.boundingSphere.center)):(he.boundingSphere===null&&he.computeBoundingSphere(),Ee.copy(he.boundingSphere.center)),Ee.applyMatrix4(F.matrixWorld).applyMatrix4(me)),Array.isArray(pe)){const Se=he.groups;for(let Re=0,we=Se.length;Re<we;Re++){const Te=Se[Re],Oe=pe[Te.materialIndex];Oe&&Oe.visible&&y.push(F,he,Oe,Y,Ee.z,Te)}}else pe.visible&&y.push(F,he,pe,Y,Ee.z,null)}}const ae=F.children;for(let he=0,pe=ae.length;he<pe;he++)dt(ae[he],W,Y,j)}function vt(F,W,Y,j){const $=F.opaque,ae=F.transmissive,he=F.transparent;c.setupLightsView(Y),Q===!0&&se.setGlobalState(_.clippingPlanes,Y),j&&ge.viewport(N.copy(j)),$.length>0&&ft($,W,Y),ae.length>0&&ft(ae,W,Y),he.length>0&&ft(he,W,Y),ge.buffers.depth.setTest(!0),ge.buffers.depth.setMask(!0),ge.buffers.color.setMask(!0),ge.setPolygonOffset(!1)}function _t(F,W,Y,j){if((Y.isScene===!0?Y.overrideMaterial:null)!==null)return;c.state.transmissionRenderTarget[j.id]===void 0&&(c.state.transmissionRenderTarget[j.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:Le.has("EXT_color_buffer_half_float")||Le.has("EXT_color_buffer_float")?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ColorManagement.workingColorSpace}));const ae=c.state.transmissionRenderTarget[j.id],he=j.viewport||N;ae.setSize(he.z*_.transmissionResolutionScale,he.w*_.transmissionResolutionScale);const pe=_.getRenderTarget();_.setRenderTarget(ae),_.getClearColor(H),O=_.getClearAlpha(),O<1&&_.setClearColor(16777215,.5),_.clear(),Be&&Ce.render(Y);const Se=_.toneMapping;_.toneMapping=NoToneMapping;const Re=j.viewport;if(j.viewport!==void 0&&(j.viewport=void 0),c.setupLightsView(j),Q===!0&&se.setGlobalState(_.clippingPlanes,j),ft(F,Y,j),D.updateMultisampleRenderTarget(ae),D.updateRenderTargetMipmap(ae),Le.has("WEBGL_multisampled_render_to_texture")===!1){let we=!1;for(let Te=0,Oe=W.length;Te<Oe;Te++){const ze=W[Te],Ke=ze.object,je=ze.geometry,Ge=ze.material,Ae=ze.group;if(Ge.side===DoubleSide&&Ke.layers.test(j.layers)){const Ze=Ge.side;Ge.side=BackSide,Ge.needsUpdate=!0,yt(Ke,Y,j,je,Ge,Ae),Ge.side=Ze,Ge.needsUpdate=!0,we=!0}}we===!0&&(D.updateMultisampleRenderTarget(ae),D.updateRenderTargetMipmap(ae))}_.setRenderTarget(pe),_.setClearColor(H,O),Re!==void 0&&(j.viewport=Re),_.toneMapping=Se}function ft(F,W,Y){const j=W.isScene===!0?W.overrideMaterial:null;for(let $=0,ae=F.length;$<ae;$++){const he=F[$],pe=he.object,Se=he.geometry,Re=he.group;let we=he.material;we.allowOverride===!0&&j!==null&&(we=j),pe.layers.test(Y.layers)&&yt(pe,W,Y,Se,we,Re)}}function yt(F,W,Y,j,$,ae){F.onBeforeRender(_,W,Y,j,$,ae),F.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),$.onBeforeRender(_,W,Y,j,F,ae),$.transparent===!0&&$.side===DoubleSide&&$.forceSinglePass===!1?($.side=BackSide,$.needsUpdate=!0,_.renderBufferDirect(Y,W,j,$,F,ae),$.side=FrontSide,$.needsUpdate=!0,_.renderBufferDirect(Y,W,j,$,F,ae),$.side=DoubleSide):_.renderBufferDirect(Y,W,j,$,F,ae),F.onAfterRender(_,W,Y,j,$,ae)}function ut(F,W,Y){W.isScene!==!0&&(W=Ne);const j=ve.get(F),$=c.state.lights,ae=c.state.shadowsArray,he=$.state.version,pe=de.getParameters(F,$.state,ae,W,Y),Se=de.getProgramCacheKey(pe);let Re=j.programs;j.environment=F.isMeshStandardMaterial?W.environment:null,j.fog=W.fog,j.envMap=(F.isMeshStandardMaterial?q:I).get(F.envMap||j.environment),j.envMapRotation=j.environment!==null&&F.envMap===null?W.environmentRotation:F.envMapRotation,Re===void 0&&(F.addEventListener("dispose",De),Re=new Map,j.programs=Re);let we=Re.get(Se);if(we!==void 0){if(j.currentProgram===we&&j.lightsStateVersion===he)return St(F,pe),we}else pe.uniforms=de.getUniforms(F),F.onBeforeCompile(pe,_),we=de.acquireProgram(pe,Se),Re.set(Se,we),j.uniforms=pe.uniforms;const Te=j.uniforms;return(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(Te.clippingPlanes=se.uniform),St(F,pe),j.needsLights=bt(F),j.lightsStateVersion=he,j.needsLights&&(Te.ambientLightColor.value=$.state.ambient,Te.lightProbe.value=$.state.probe,Te.directionalLights.value=$.state.directional,Te.directionalLightShadows.value=$.state.directionalShadow,Te.spotLights.value=$.state.spot,Te.spotLightShadows.value=$.state.spotShadow,Te.rectAreaLights.value=$.state.rectArea,Te.ltc_1.value=$.state.rectAreaLTC1,Te.ltc_2.value=$.state.rectAreaLTC2,Te.pointLights.value=$.state.point,Te.pointLightShadows.value=$.state.pointShadow,Te.hemisphereLights.value=$.state.hemi,Te.directionalShadowMap.value=$.state.directionalShadowMap,Te.directionalShadowMatrix.value=$.state.directionalShadowMatrix,Te.spotShadowMap.value=$.state.spotShadowMap,Te.spotLightMatrix.value=$.state.spotLightMatrix,Te.spotLightMap.value=$.state.spotLightMap,Te.pointShadowMap.value=$.state.pointShadowMap,Te.pointShadowMatrix.value=$.state.pointShadowMatrix),j.currentProgram=we,j.uniformsList=null,we}function xt(F){if(F.uniformsList===null){const W=F.currentProgram.getUniforms();F.uniformsList=WebGLUniforms.seqWithValue(W.seq,F.uniforms)}return F.uniformsList}function St(F,W){const Y=ve.get(F);Y.outputColorSpace=W.outputColorSpace,Y.batching=W.batching,Y.batchingColor=W.batchingColor,Y.instancing=W.instancing,Y.instancingColor=W.instancingColor,Y.instancingMorph=W.instancingMorph,Y.skinning=W.skinning,Y.morphTargets=W.morphTargets,Y.morphNormals=W.morphNormals,Y.morphColors=W.morphColors,Y.morphTargetsCount=W.morphTargetsCount,Y.numClippingPlanes=W.numClippingPlanes,Y.numIntersection=W.numClipIntersection,Y.vertexAlphas=W.vertexAlphas,Y.vertexTangents=W.vertexTangents,Y.toneMapping=W.toneMapping}function Et(F,W,Y,j,$){W.isScene!==!0&&(W=Ne),D.resetTextureUnits();const ae=W.fog,he=j.isMeshStandardMaterial?W.environment:null,pe=R===null?_.outputColorSpace:R.isXRRenderTarget===!0?R.texture.colorSpace:LinearSRGBColorSpace,Se=(j.isMeshStandardMaterial?q:I).get(j.envMap||he),Re=j.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,we=!!Y.attributes.tangent&&(!!j.normalMap||j.anisotropy>0),Te=!!Y.morphAttributes.position,Oe=!!Y.morphAttributes.normal,ze=!!Y.morphAttributes.color;let Ke=NoToneMapping;j.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(Ke=_.toneMapping);const je=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,Ge=je!==void 0?je.length:0,Ae=ve.get(j),Ze=c.state.lights;if(Q===!0&&(ne===!0||F!==P)){const Qe=F===P&&j.id===w;se.setState(j,F,Qe)}let He=!1;j.version===Ae.__version?(Ae.needsLights&&Ae.lightsStateVersion!==Ze.state.version||Ae.outputColorSpace!==pe||$.isBatchedMesh&&Ae.batching===!1||!$.isBatchedMesh&&Ae.batching===!0||$.isBatchedMesh&&Ae.batchingColor===!0&&$.colorTexture===null||$.isBatchedMesh&&Ae.batchingColor===!1&&$.colorTexture!==null||$.isInstancedMesh&&Ae.instancing===!1||!$.isInstancedMesh&&Ae.instancing===!0||$.isSkinnedMesh&&Ae.skinning===!1||!$.isSkinnedMesh&&Ae.skinning===!0||$.isInstancedMesh&&Ae.instancingColor===!0&&$.instanceColor===null||$.isInstancedMesh&&Ae.instancingColor===!1&&$.instanceColor!==null||$.isInstancedMesh&&Ae.instancingMorph===!0&&$.morphTexture===null||$.isInstancedMesh&&Ae.instancingMorph===!1&&$.morphTexture!==null||Ae.envMap!==Se||j.fog===!0&&Ae.fog!==ae||Ae.numClippingPlanes!==void 0&&(Ae.numClippingPlanes!==se.numPlanes||Ae.numIntersection!==se.numIntersection)||Ae.vertexAlphas!==Re||Ae.vertexTangents!==we||Ae.morphTargets!==Te||Ae.morphNormals!==Oe||Ae.morphColors!==ze||Ae.toneMapping!==Ke||Ae.morphTargetsCount!==Ge)&&(He=!0):(He=!0,Ae.__version=j.version);let st=Ae.currentProgram;He===!0&&(st=ut(j,W,$));let ht=!1,tt=!1,ct=!1;const Xe=st.getUniforms(),it=Ae.uniforms;if(ge.useProgram(st.program)&&(ht=!0,tt=!0,ct=!0),j.id!==w&&(w=j.id,tt=!0),ht||P!==F){ge.buffers.depth.getReversed()?(re.copy(F.projectionMatrix),toNormalizedProjectionMatrix(re),toReversedProjectionMatrix(re),Xe.setValue(U,"projectionMatrix",re)):Xe.setValue(U,"projectionMatrix",F.projectionMatrix),Xe.setValue(U,"viewMatrix",F.matrixWorldInverse);const et=Xe.map.cameraPosition;et!==void 0&&et.setValue(U,Fe.setFromMatrixPosition(F.matrixWorld)),Ie.logarithmicDepthBuffer&&Xe.setValue(U,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(j.isMeshPhongMaterial||j.isMeshToonMaterial||j.isMeshLambertMaterial||j.isMeshBasicMaterial||j.isMeshStandardMaterial||j.isShaderMaterial)&&Xe.setValue(U,"isOrthographic",F.isOrthographicCamera===!0),P!==F&&(P=F,tt=!0,ct=!0)}if($.isSkinnedMesh){Xe.setOptional(U,$,"bindMatrix"),Xe.setOptional(U,$,"bindMatrixInverse");const Qe=$.skeleton;Qe&&(Qe.boneTexture===null&&Qe.computeBoneTexture(),Xe.setValue(U,"boneTexture",Qe.boneTexture,D))}$.isBatchedMesh&&(Xe.setOptional(U,$,"batchingTexture"),Xe.setValue(U,"batchingTexture",$._matricesTexture,D),Xe.setOptional(U,$,"batchingIdTexture"),Xe.setValue(U,"batchingIdTexture",$._indirectTexture,D),Xe.setOptional(U,$,"batchingColorTexture"),$._colorsTexture!==null&&Xe.setValue(U,"batchingColorTexture",$._colorsTexture,D));const nt=Y.morphAttributes;if((nt.position!==void 0||nt.normal!==void 0||nt.color!==void 0)&&Pe.update($,Y,st),(tt||Ae.receiveShadow!==$.receiveShadow)&&(Ae.receiveShadow=$.receiveShadow,Xe.setValue(U,"receiveShadow",$.receiveShadow)),j.isMeshGouraudMaterial&&j.envMap!==null&&(it.envMap.value=Se,it.flipEnvMap.value=Se.isCubeTexture&&Se.isRenderTargetTexture===!1?-1:1),j.isMeshStandardMaterial&&j.envMap===null&&W.environment!==null&&(it.envMapIntensity.value=W.environmentIntensity),tt&&(Xe.setValue(U,"toneMappingExposure",_.toneMappingExposure),Ae.needsLights&&Mt(it,ct),ae&&j.fog===!0&&le.refreshFogUniforms(it,ae),le.refreshMaterialUniforms(it,j,E,L,c.state.transmissionRenderTarget[F.id]),WebGLUniforms.upload(U,xt(Ae),it,D)),j.isShaderMaterial&&j.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(U,xt(Ae),it,D),j.uniformsNeedUpdate=!1),j.isSpriteMaterial&&Xe.setValue(U,"center",$.center),Xe.setValue(U,"modelViewMatrix",$.modelViewMatrix),Xe.setValue(U,"normalMatrix",$.normalMatrix),Xe.setValue(U,"modelMatrix",$.matrixWorld),j.isShaderMaterial||j.isRawShaderMaterial){const Qe=j.uniformsGroups;for(let et=0,pt=Qe.length;et<pt;et++){const lt=Qe[et];z.update(lt,st),z.bind(lt,st)}}return st}function Mt(F,W){F.ambientLightColor.needsUpdate=W,F.lightProbe.needsUpdate=W,F.directionalLights.needsUpdate=W,F.directionalLightShadows.needsUpdate=W,F.pointLights.needsUpdate=W,F.pointLightShadows.needsUpdate=W,F.spotLights.needsUpdate=W,F.spotLightShadows.needsUpdate=W,F.rectAreaLights.needsUpdate=W,F.hemisphereLights.needsUpdate=W}function bt(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return M},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return R},this.setRenderTargetTextures=function(F,W,Y){const j=ve.get(F);j.__autoAllocateDepthBuffer=F.resolveDepthBuffer===!1,j.__autoAllocateDepthBuffer===!1&&(j.__useRenderToTexture=!1),ve.get(F.texture).__webglTexture=W,ve.get(F.depthTexture).__webglTexture=j.__autoAllocateDepthBuffer?void 0:Y,j.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(F,W){const Y=ve.get(F);Y.__webglFramebuffer=W,Y.__useDefaultFramebuffer=W===void 0};const Tt=U.createFramebuffer();this.setRenderTarget=function(F,W=0,Y=0){R=F,M=W,A=Y;let j=!0,$=null,ae=!1,he=!1;if(F){const Se=ve.get(F);if(Se.__useDefaultFramebuffer!==void 0)ge.bindFramebuffer(U.FRAMEBUFFER,null),j=!1;else if(Se.__webglFramebuffer===void 0)D.setupRenderTarget(F);else if(Se.__hasExternalTextures)D.rebindTextures(F,ve.get(F.texture).__webglTexture,ve.get(F.depthTexture).__webglTexture);else if(F.depthBuffer){const Te=F.depthTexture;if(Se.__boundDepthTexture!==Te){if(Te!==null&&ve.has(Te)&&(F.width!==Te.image.width||F.height!==Te.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");D.setupDepthRenderbuffer(F)}}const Re=F.texture;(Re.isData3DTexture||Re.isDataArrayTexture||Re.isCompressedArrayTexture)&&(he=!0);const we=ve.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(Array.isArray(we[W])?$=we[W][Y]:$=we[W],ae=!0):F.samples>0&&D.useMultisampledRTT(F)===!1?$=ve.get(F).__webglMultisampledFramebuffer:Array.isArray(we)?$=we[Y]:$=we,N.copy(F.viewport),V.copy(F.scissor),G=F.scissorTest}else N.copy(B).multiplyScalar(E).floor(),V.copy(ee).multiplyScalar(E).floor(),G=oe;if(Y!==0&&($=Tt),ge.bindFramebuffer(U.FRAMEBUFFER,$)&&j&&ge.drawBuffers(F,$),ge.viewport(N),ge.scissor(V),ge.setScissorTest(G),ae){const Se=ve.get(F.texture);U.framebufferTexture2D(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_CUBE_MAP_POSITIVE_X+W,Se.__webglTexture,Y)}else if(he){const Se=ve.get(F.texture),Re=W;U.framebufferTextureLayer(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,Se.__webglTexture,Y,Re)}else if(F!==null&&Y!==0){const Se=ve.get(F.texture);U.framebufferTexture2D(U.FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_2D,Se.__webglTexture,Y)}w=-1},this.readRenderTargetPixels=function(F,W,Y,j,$,ae,he){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let pe=ve.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&he!==void 0&&(pe=pe[he]),pe){ge.bindFramebuffer(U.FRAMEBUFFER,pe);try{const Se=F.texture,Re=Se.format,we=Se.type;if(!Ie.textureFormatReadable(Re)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ie.textureTypeReadable(we)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=F.width-j&&Y>=0&&Y<=F.height-$&&U.readPixels(W,Y,j,$,Ue.convert(Re),Ue.convert(we),ae)}finally{const Se=R!==null?ve.get(R).__webglFramebuffer:null;ge.bindFramebuffer(U.FRAMEBUFFER,Se)}}},this.readRenderTargetPixelsAsync=async function(F,W,Y,j,$,ae,he){if(!(F&&F.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let pe=ve.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&he!==void 0&&(pe=pe[he]),pe)if(W>=0&&W<=F.width-j&&Y>=0&&Y<=F.height-$){ge.bindFramebuffer(U.FRAMEBUFFER,pe);const Se=F.texture,Re=Se.format,we=Se.type;if(!Ie.textureFormatReadable(Re))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ie.textureTypeReadable(we))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Te=U.createBuffer();U.bindBuffer(U.PIXEL_PACK_BUFFER,Te),U.bufferData(U.PIXEL_PACK_BUFFER,ae.byteLength,U.STREAM_READ),U.readPixels(W,Y,j,$,Ue.convert(Re),Ue.convert(we),0);const Oe=R!==null?ve.get(R).__webglFramebuffer:null;ge.bindFramebuffer(U.FRAMEBUFFER,Oe);const ze=U.fenceSync(U.SYNC_GPU_COMMANDS_COMPLETE,0);return U.flush(),await probeAsync(U,ze,4),U.bindBuffer(U.PIXEL_PACK_BUFFER,Te),U.getBufferSubData(U.PIXEL_PACK_BUFFER,0,ae),U.deleteBuffer(Te),U.deleteSync(ze),ae}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(F,W=null,Y=0){const j=Math.pow(2,-Y),$=Math.floor(F.image.width*j),ae=Math.floor(F.image.height*j),he=W!==null?W.x:0,pe=W!==null?W.y:0;D.setTexture2D(F,0),U.copyTexSubImage2D(U.TEXTURE_2D,Y,0,0,he,pe,$,ae),ge.unbindTexture()};const At=U.createFramebuffer(),Ct=U.createFramebuffer();this.copyTextureToTexture=function(F,W,Y=null,j=null,$=0,ae=null){ae===null&&($!==0?(warnOnce("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ae=$,$=0):ae=0);let he,pe,Se,Re,we,Te,Oe,ze,Ke;const je=F.isCompressedTexture?F.mipmaps[ae]:F.image;if(Y!==null)he=Y.max.x-Y.min.x,pe=Y.max.y-Y.min.y,Se=Y.isBox3?Y.max.z-Y.min.z:1,Re=Y.min.x,we=Y.min.y,Te=Y.isBox3?Y.min.z:0;else{const nt=Math.pow(2,-$);he=Math.floor(je.width*nt),pe=Math.floor(je.height*nt),F.isDataArrayTexture?Se=je.depth:F.isData3DTexture?Se=Math.floor(je.depth*nt):Se=1,Re=0,we=0,Te=0}j!==null?(Oe=j.x,ze=j.y,Ke=j.z):(Oe=0,ze=0,Ke=0);const Ge=Ue.convert(W.format),Ae=Ue.convert(W.type);let Ze;W.isData3DTexture?(D.setTexture3D(W,0),Ze=U.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(D.setTexture2DArray(W,0),Ze=U.TEXTURE_2D_ARRAY):(D.setTexture2D(W,0),Ze=U.TEXTURE_2D),U.pixelStorei(U.UNPACK_FLIP_Y_WEBGL,W.flipY),U.pixelStorei(U.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),U.pixelStorei(U.UNPACK_ALIGNMENT,W.unpackAlignment);const He=U.getParameter(U.UNPACK_ROW_LENGTH),st=U.getParameter(U.UNPACK_IMAGE_HEIGHT),ht=U.getParameter(U.UNPACK_SKIP_PIXELS),tt=U.getParameter(U.UNPACK_SKIP_ROWS),ct=U.getParameter(U.UNPACK_SKIP_IMAGES);U.pixelStorei(U.UNPACK_ROW_LENGTH,je.width),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,je.height),U.pixelStorei(U.UNPACK_SKIP_PIXELS,Re),U.pixelStorei(U.UNPACK_SKIP_ROWS,we),U.pixelStorei(U.UNPACK_SKIP_IMAGES,Te);const Xe=F.isDataArrayTexture||F.isData3DTexture,it=W.isDataArrayTexture||W.isData3DTexture;if(F.isDepthTexture){const nt=ve.get(F),Qe=ve.get(W),et=ve.get(nt.__renderTarget),pt=ve.get(Qe.__renderTarget);ge.bindFramebuffer(U.READ_FRAMEBUFFER,et.__webglFramebuffer),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,pt.__webglFramebuffer);for(let lt=0;lt<Se;lt++)Xe&&(U.framebufferTextureLayer(U.READ_FRAMEBUFFER,U.COLOR_ATTACHMENT0,ve.get(F).__webglTexture,$,Te+lt),U.framebufferTextureLayer(U.DRAW_FRAMEBUFFER,U.COLOR_ATTACHMENT0,ve.get(W).__webglTexture,ae,Ke+lt)),U.blitFramebuffer(Re,we,he,pe,Oe,ze,he,pe,U.DEPTH_BUFFER_BIT,U.NEAREST);ge.bindFramebuffer(U.READ_FRAMEBUFFER,null),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,null)}else if($!==0||F.isRenderTargetTexture||ve.has(F)){const nt=ve.get(F),Qe=ve.get(W);ge.bindFramebuffer(U.READ_FRAMEBUFFER,At),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,Ct);for(let et=0;et<Se;et++)Xe?U.framebufferTextureLayer(U.READ_FRAMEBUFFER,U.COLOR_ATTACHMENT0,nt.__webglTexture,$,Te+et):U.framebufferTexture2D(U.READ_FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_2D,nt.__webglTexture,$),it?U.framebufferTextureLayer(U.DRAW_FRAMEBUFFER,U.COLOR_ATTACHMENT0,Qe.__webglTexture,ae,Ke+et):U.framebufferTexture2D(U.DRAW_FRAMEBUFFER,U.COLOR_ATTACHMENT0,U.TEXTURE_2D,Qe.__webglTexture,ae),$!==0?U.blitFramebuffer(Re,we,he,pe,Oe,ze,he,pe,U.COLOR_BUFFER_BIT,U.NEAREST):it?U.copyTexSubImage3D(Ze,ae,Oe,ze,Ke+et,Re,we,he,pe):U.copyTexSubImage2D(Ze,ae,Oe,ze,Re,we,he,pe);ge.bindFramebuffer(U.READ_FRAMEBUFFER,null),ge.bindFramebuffer(U.DRAW_FRAMEBUFFER,null)}else it?F.isDataTexture||F.isData3DTexture?U.texSubImage3D(Ze,ae,Oe,ze,Ke,he,pe,Se,Ge,Ae,je.data):W.isCompressedArrayTexture?U.compressedTexSubImage3D(Ze,ae,Oe,ze,Ke,he,pe,Se,Ge,je.data):U.texSubImage3D(Ze,ae,Oe,ze,Ke,he,pe,Se,Ge,Ae,je):F.isDataTexture?U.texSubImage2D(U.TEXTURE_2D,ae,Oe,ze,he,pe,Ge,Ae,je.data):F.isCompressedTexture?U.compressedTexSubImage2D(U.TEXTURE_2D,ae,Oe,ze,je.width,je.height,Ge,je.data):U.texSubImage2D(U.TEXTURE_2D,ae,Oe,ze,he,pe,Ge,Ae,je);U.pixelStorei(U.UNPACK_ROW_LENGTH,He),U.pixelStorei(U.UNPACK_IMAGE_HEIGHT,st),U.pixelStorei(U.UNPACK_SKIP_PIXELS,ht),U.pixelStorei(U.UNPACK_SKIP_ROWS,tt),U.pixelStorei(U.UNPACK_SKIP_IMAGES,ct),ae===0&&W.generateMipmaps&&U.generateMipmap(Ze),ge.unbindTexture()},this.copyTextureToTexture3D=function(F,W,Y=null,j=null,$=0){return warnOnce('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(F,W,Y,j,$)},this.initRenderTarget=function(F){ve.get(F).__webglFramebuffer===void 0&&D.setupRenderTarget(F)},this.initTexture=function(F){F.isCubeTexture?D.setTextureCube(F,0):F.isData3DTexture?D.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?D.setTexture2DArray(F,0):D.setTexture2D(F,0),ge.unbindTexture()},this.resetState=function(){M=0,A=0,R=null,ge.reset(),$e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return WebGLCoordinateSystem}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=ColorManagement._getDrawingBufferColorSpace(e),t.unpackColorSpace=ColorManagement._getUnpackColorSpace()}}const VISUAL_TIERS=new Set(["idle","thinking","waiting","working","responding","success","error","attention"]),WORKING_CLUSTER=new Set(["thinking","searching","writing","working"]),HUD_LABELS={idle:["IDLE","standing by"],thinking:["THINKING","processing depth"],waiting:["WAITING","awaiting signal"],working:["WORKING","executing task"],searching:["SEARCHING","scanning context"],writing:["WRITING","composing output"],responding:["RESPONDING","transmitting"],success:["SUCCESS","turn finished"],error:["ERROR","failure detected"],attention:["ATTENTION","priority interrupt"]},IDLE_VARIANT_LABELS=["breathe","drift","focus","release","presence"],S={idle:{primary:new Color(14716976),accent:new Color(16769184),aura:new Color(6303760),coreCol:new Color(16771248),lightCol:13664288,lightInt:2.2,noiseAmp:.065,noiseFreq:.5,swirl:0,pulseRate:.9,bodySize:.026,glowSize:.052},thinking:{primary:new Color(3170559),accent:new Color(9482495),aura:new Color(1574976),coreCol:new Color(11586815),lightCol:1589452,lightInt:2.8,noiseAmp:.11,noiseFreq:.8,swirl:.55,pulseRate:1.6,bodySize:.022,glowSize:.048},waiting:{primary:new Color(7902888),accent:new Color(11059408),aura:new Color(3162192),coreCol:new Color(11585752),lightCol:6324376,lightInt:2,noiseAmp:.075,noiseFreq:.55,swirl:.2,pulseRate:1,bodySize:.024,glowSize:.05},working:{primary:new Color(16740384),accent:new Color(16772672),aura:new Color(5246976),coreCol:new Color(16772704),lightCol:14700560,lightInt:3.6,noiseAmp:.16,noiseFreq:3.2,swirl:0,pulseRate:3.5,bodySize:.02,glowSize:.038},responding:{primary:new Color(16773264),accent:new Color(16777215),aura:new Color(4206592),coreCol:new Color(16777215),lightCol:16769120,lightInt:4.5,noiseAmp:.13,noiseFreq:1.9,swirl:0,pulseRate:2.5,bodySize:.03,glowSize:.065},success:{primary:new Color(12642424),accent:new Color(15269808),aura:new Color(2113552),coreCol:new Color(15794128),lightCol:9488448,lightInt:3.8,noiseAmp:.09,noiseFreq:1.2,swirl:0,pulseRate:1.4,bodySize:.028,glowSize:.06},error:{primary:new Color(13395711),accent:new Color(15645695),aura:new Color(2099256),coreCol:new Color(14527231),lightCol:8925388,lightInt:1.8,noiseAmp:.2,noiseFreq:.75,swirl:-.4,pulseRate:1,bodySize:.026,glowSize:.052},attention:{primary:new Color(16717864),accent:new Color(16748640),aura:new Color(3146760),coreCol:new Color(16744544),lightCol:14485528,lightInt:5.5,noiseAmp:.26,noiseFreq:5.5,swirl:0,pulseRate:7,bodySize:.027,glowSize:.058}},REGIONS=[[0,3.22,.02,.3,.32,.26,.13,"s"],[0,2.6,0,.12,.15,.12,.03,"s"],[0,2.02,0,.4,.62,.2,.22,"c"],[0,1.52,0,.34,.22,.18,.07,"c"],[-.57,2.36,.02,.1,.37,.1,.06,"c"],[.57,2.36,.02,.1,.37,.1,.06,"c"],[-.63,1.85,.04,.08,.33,.08,.05,"c"],[.63,1.85,.04,.08,.33,.08,.05,"c"],[-.19,1.02,.01,.1,.44,.1,.07,"c"],[.19,1.02,.01,.1,.44,.1,.07,"c"],[-.19,.45,.02,.08,.42,.08,.06,"c"],[.19,.45,.02,.08,.42,.08,.06,"c"],[-.19,.08,.07,.1,.04,.17,.02,"c"],[.19,.08,.07,.1,.04,.17,.02,"c"]],PI2=Math.PI*2,NB=1400,NG=520,NA=360,NM=200,NS=750;function generateBodyPositions(i){const e=new Float32Array(i*3),t=REGIONS.reduce((r,s)=>r+s[6],0);let n=0;for(REGIONS.forEach(r=>{const s=Math.round(i*r[6]/t);for(let a=0;a<s&&n<i;a++,n++)if(r[7]==="s"){const o=Math.acos(2*Math.random()-1),l=Math.random()*PI2,h=Math.cbrt(Math.random());e[n*3]=r[0]+Math.sin(o)*Math.cos(l)*r[3]*h,e[n*3+1]=r[1]+Math.cos(o)*r[4]*h,e[n*3+2]=r[2]+Math.sin(o)*Math.sin(l)*r[5]*h}else{const o=Math.random()*PI2,l=Math.sqrt(Math.random());e[n*3]=r[0]+Math.cos(o)*r[3]*l,e[n*3+1]=r[1]+(Math.random()-.5)*r[4]*2,e[n*3+2]=r[2]+Math.sin(o)*r[5]*l}});n<i;)e[n*3]=(Math.random()-.5)*1.3,e[n*3+1]=Math.random()*3.4+.1,e[n*3+2]=(Math.random()-.5)*.4,n++;return e}function genOffsets(i){const e=new Float32Array(i*4);for(let t=0;t<i;t++)e[t*4]=Math.random()*PI2,e[t*4+1]=Math.random()*PI2,e[t*4+2]=Math.random()*PI2,e[t*4+3]=.65+Math.random()*.85;return e}class CaminaVesselRenderer{constructor(e,t){this.elapsed=0,this.camAngle=0,this.animFrameId=0,this.visualTier="idle",this.semanticState="idle",this.idleIdx=0,this.idleTimer=0,this.auraData=[],this.moteData=[],this.hudEl=null,this.hudStateEl=null,this.hudSubEl=null,this.hudEbarsEl=null,this.godRaysEl=null,this.circularFrameEl=null,this.circularArcEl=null,this.layoutTier="widescreen",this.layoutParams={fov:50,camZ:6.2,camY:2.1,auraXS:.78,auraZS:.45,moteSpreadX:5},this.viewportWidth=0,this.viewportHeight=0,this.animate=()=>{this.animFrameId=requestAnimationFrame(this.animate);const n=Math.min(this.clock.getDelta(),.05);this.elapsed+=n,this.tick(n),this.renderer.render(this.scene,this.camera)},this.opts={pixelRatio:Math.min(devicePixelRatio,2),idleCycleMs:9e3,transitionMs:3.2,circularDisplay:!1,...t},this.opts.circularDisplay&&(Object.assign(e.style,{borderRadius:"50%"}),e.classList.add("ev-circular-container")),this.renderer=new WebGLRenderer({antialias:!0}),this.renderer.setSize(t.width,t.height,!1),this.renderer.setPixelRatio(this.opts.pixelRatio),this.renderer.toneMapping=ACESFilmicToneMapping,this.renderer.toneMappingExposure=1.35,Object.assign(this.renderer.domElement.style,{display:"block",position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"1"}),e.appendChild(this.renderer.domElement),this.scene=new Scene,this.scene.background=new Color(131848),this.scene.fog=new FogExp2(131848,.016),this.viewportWidth=t.width,this.viewportHeight=t.height,this.applyLayoutTier(t.width,t.height,!1),this.camera=new PerspectiveCamera(this.layoutParams.fov,t.width/t.height,.1,300),this.camera.position.set(.6,this.layoutParams.camY,this.layoutParams.camZ),this.camera.lookAt(0,1.9,0),this.clock=new Clock,this.tgt=S.idle,this.cur={primary:S.idle.primary.clone(),accent:S.idle.accent.clone(),aura:S.idle.aura.clone(),coreCol:S.idle.coreCol.clone(),lightInt:S.idle.lightInt,noiseAmp:S.idle.noiseAmp,noiseFreq:S.idle.noiseFreq,swirl:S.idle.swirl,pulseRate:S.idle.pulseRate,bodySize:S.idle.bodySize,glowSize:S.idle.glowSize},this.homeB=generateBodyPositions(NB),this.homeG=generateBodyPositions(NG),this.offB=genOffsets(NB),this.offG=genOffsets(NG),this.posB=this.homeB.slice(),this.posG=this.homeG.slice(),this.posA=new Float32Array(NA*3),this.posM=new Float32Array(NM*3),this.initAuraParticles(),this.initMoteParticles(),this.geoBody=this.makeGeo(this.posB),this.geoGlow=this.makeGeo(this.posG),this.geoAura=this.makeGeo(this.posA),this.geoMotes=this.makeGeo(this.posM),this.matBody=this.makePMat(14716976,.026,.9),this.matGlow=this.makePMat(16771232,.052,.32),this.matAura=this.makePMat(6303760,.075,.2),this.matMotes=this.makePMat(5255184,.033,.5),this.coreLight=new PointLight,this.groundGlow=new PointLight,this.buildScene(),this.buildHUD(e),this.animate()}setState(e,t){const n=t?.semantic??e,r=this.resolveVisualTier(e,n,!!t),s=S[r];if(!s){console.warn(`[CaminaVesselRenderer] Unknown visual tier "${e}" — ignoring`);return}this.semanticState=n,this.hudTool=t?.tool,r!==this.visualTier&&(this.visualTier=r,r!=="idle"&&(this.idleTimer=0),this.tgt=s),this.refreshHud()}resolveVisualTier(e,t,n){return n&&VISUAL_TIERS.has(e)||!n&&VISUAL_TIERS.has(e)?e:t==="searching"||t==="writing"?"working":VISUAL_TIERS.has(t)?t:"idle"}resolveHudSub(){if(this.hudTool)return this.hudTool;if(this.visualTier==="working"&&WORKING_CLUSTER.has(this.semanticState))return this.semanticState;const[,e]=HUD_LABELS[this.visualTier]??["IDLE","standing by"];return e}refreshHud(){const e=S[this.visualTier],[t]=HUD_LABELS[this.visualTier]??["IDLE","standing by"],n=this.resolveHudSub(),r=e.primary,s="#"+r.getHexString(),a=`${Math.round(r.r*255)}, ${Math.round(r.g*255)}, ${Math.round(r.b*255)}`;this.hudStateEl&&(this.hudStateEl.textContent=t,this.hudStateEl.style.color=s),this.hudSubEl&&(this.hudSubEl.textContent=n,this.opts.circularDisplay&&(this.hudSubEl.style.display=n&&n!==(HUD_LABELS[this.visualTier]?.[1]??"")?"":"none")),this.godRaysEl&&this.godRaysEl.style.setProperty("--ev-ray-color",a)}resize(e,t){this.renderer.setSize(e,t,!1),this.applyLayoutTier(e,t,!0),this.camera.fov=this.layoutParams.fov,this.camera.aspect=e/t,this.camera.position.y=this.layoutParams.camY,this.camera.position.z=this.layoutParams.camZ,this.camera.updateProjectionMatrix()}dispose(){cancelAnimationFrame(this.animFrameId),this.renderer.dispose(),this.renderer.domElement.remove(),this.godRaysEl?.remove(),this.circularArcEl?.remove(),this.circularFrameEl?.remove(),this.hudEl?.remove()}get currentIdleVariant(){return this.idleIdx}get currentIdleLabel(){return IDLE_VARIANT_LABELS[this.idleIdx]??""}makeGeo(e){const t=new BufferGeometry;return t.setAttribute("position",new BufferAttribute(e,3)),t}makePMat(e,t,n){return new PointsMaterial({color:e,size:t,sizeAttenuation:!0,transparent:!0,opacity:n,blending:AdditiveBlending,depthWrite:!1})}lv(e,t,n){return e+(t-e)*n}smooth(e,t){return 1-Math.pow(.001,e*t)}resolveLayoutTier(e,t){if(this.opts.circularDisplay)return"circular";const n=e/Math.max(t,1);return n>2.5?"ultrawide":n>=.85&&n<=1.15?"square":"widescreen"}layoutParamsForTier(e){switch(e){case"ultrawide":return{fov:42,camZ:4.8,camY:2.1,auraXS:2.2,auraZS:.9,moteSpreadX:14};case"square":return{fov:48,camZ:5.4,camY:2,auraXS:1,auraZS:.72,moteSpreadX:6.5};case"circular":return{fov:44,camZ:6.4,camY:1.92,auraXS:.82,auraZS:.62,moteSpreadX:4.2};default:return{fov:50,camZ:6.2,camY:2.1,auraXS:.78,auraZS:.45,moteSpreadX:5}}}initAuraParticles(){this.auraData=[];for(let e=0;e<NA;e++){const t=Math.random()*PI2,n=.9+Math.random()*1;this.auraData.push({angle:t,spd:.07+Math.random()*.14,phase:Math.random()*PI2,r:n,elev:Math.random()*.3}),this.posA[e*3]=Math.cos(t)*n*this.layoutParams.auraXS,this.posA[e*3+1]=1.7+Math.sin(t*.65)*n*1.45,this.posA[e*3+2]=Math.sin(t)*n*this.layoutParams.auraZS}}initMoteParticles(){this.moteData=[];for(let e=0;e<NM;e++){const t=(Math.random()-.5)*this.layoutParams.moteSpreadX,n=(Math.random()-.5)*3.5-.5;this.moteData.push({x:t,z:n,riseSpd:.04+Math.random()*.2,phase:Math.random()*PI2}),this.posM[e*3]=t,this.posM[e*3+1]=Math.random()*1,this.posM[e*3+2]=n}}applyLayoutTier(e,t,n){const r=this.resolveLayoutTier(e,t),s=r!==this.layoutTier;this.layoutTier=r,this.layoutParams=this.layoutParamsForTier(r),this.viewportWidth=e,this.viewportHeight=t,n&&s&&(this.initAuraParticles(),this.initMoteParticles(),this.geoAura.attributes.position.needsUpdate=!0,this.geoMotes.attributes.position.needsUpdate=!0)}buildHUD(e){if(!document.getElementById("ev-hud-styles")){const r=document.createElement("style");r.id="ev-hud-styles",r.textContent=`
|
|
3821
3821
|
.ev-hud {
|
|
3822
3822
|
position: absolute; inset: 0;
|
|
3823
3823
|
pointer-events: none; z-index: 10;
|
|
@@ -4037,7 +4037,7 @@ void main() {
|
|
|
4037
4037
|
<div class="ev-sub" id="ev-state-sub">standing by</div>
|
|
4038
4038
|
<div class="ev-title">EIDOLA RUNTIME<br><span>VESSEL · THREE.JS</span></div>
|
|
4039
4039
|
<div class="ev-ebars" id="ev-ebars"></div>
|
|
4040
|
-
`,e.appendChild(n),this.hudEl=n,this.hudStateEl=n.querySelector("#ev-state-label"),this.hudSubEl=n.querySelector("#ev-state-sub"),this.hudEbarsEl=n.querySelector("#ev-ebars");for(let r=0;r<12;r++){const s=document.createElement("div");s.className="ev-ebar",s.style.height="10px",this.hudEbarsEl.appendChild(s)}}buildScene(){this.scene.add(new Points(this.geoBody,this.matBody),new Points(this.geoGlow,this.matGlow),new Points(this.geoAura,this.matAura),new Points(this.geoMotes,this.matMotes));const e=new Float32Array(NS*3);for(let r=0;r<NS;r++){const s=Math.acos(2*Math.random()-1),a=Math.random()*PI2,o=35+Math.random()*60;e[r*3]=Math.sin(s)*Math.cos(a)*o,e[r*3+1]=Math.abs(Math.cos(s))*o*.8+2,e[r*3+2]=Math.sin(s)*Math.sin(a)*o-6}const t=new BufferGeometry;t.setAttribute("position",new BufferAttribute(e,3)),this.scene.add(new Points(t,this.makePMat(12636384,.072,.55))),this.scene.add(new AmbientLight(395282,.9));const n=new DirectionalLight(396320,.4);n.position.set(2,5,8),this.scene.add(n),this.coreLight=new PointLight(13664288,2.2,9,2),this.coreLight.position.set(0,1.95,0),this.scene.add(this.coreLight),this.groundGlow=new PointLight(2100228,.6,5,2),this.groundGlow.position.set(0,.15,.5),this.scene.add(this.groundGlow)}tick(e){const t=this.elapsed,n=this.smooth(e,2.2),r=this.lv.bind(this);this.cur.primary.lerp(this.tgt.primary,n),this.cur.accent.lerp(this.tgt.accent,n),this.cur.aura.lerp(this.tgt.aura,n),this.cur.coreCol.lerp(this.tgt.coreCol,n),this.cur.lightInt=r(this.cur.lightInt,this.tgt.lightInt,n),this.cur.noiseAmp=r(this.cur.noiseAmp,this.tgt.noiseAmp,n),this.cur.noiseFreq=r(this.cur.noiseFreq,this.tgt.noiseFreq,n),this.cur.swirl=r(this.cur.swirl,this.tgt.swirl,n),this.cur.pulseRate=r(this.cur.pulseRate,this.tgt.pulseRate,n),this.cur.bodySize=r(this.cur.bodySize,this.tgt.bodySize,n),this.cur.glowSize=r(this.cur.glowSize,this.tgt.glowSize,n);const s=.5+.5*Math.sin(t*this.cur.pulseRate),a=this.visualTier==="attention"?.4+.6*Math.abs(Math.sin(t*8.5)):s;this.coreLight.color.setHex(this.tgt.lightCol),this.coreLight.intensity=this.cur.lightInt*(.75+.25*a),this.groundGlow.color.copy(this.cur.primary),this.groundGlow.intensity=this.cur.lightInt*.22,this.matBody.color.copy(this.cur.primary),this.matBody.size=this.cur.bodySize,this.matGlow.color.copy(this.cur.accent),this.matGlow.size=this.cur.glowSize,this.matGlow.opacity=.25+.12*s,this.matAura.color.copy(this.cur.aura),this.matMotes.color.copy(this.cur.primary),this.matMotes.opacity=.35+.2*s;const o=Math.abs(this.cur.swirl)>.001?Math.sin(t*.42)*this.cur.swirl*Math.PI*.38:0,l=Math.cos(o),h=Math.sin(o);for(let m=0;m<NB;m++){const g=m*4,y=this.offB[g+3]*this.cur.noiseFreq;let c=this.homeB[m*3],x=this.homeB[m*3+1],v=this.homeB[m*3+2];if(o!==0){const _=c,b=v;c=_*l-b*h,v=_*h+b*l}this.posB[m*3]=c+Math.sin(t*y+this.offB[g])*this.cur.noiseAmp,this.posB[m*3+1]=x+Math.sin(t*y*1.3+this.offB[g+1])*this.cur.noiseAmp*.6,this.posB[m*3+2]=v+Math.cos(t*y*.9+this.offB[g+2])*this.cur.noiseAmp}this.geoBody.attributes.position.needsUpdate=!0;for(let m=0;m<NG;m++){const g=m*4,y=this.offG[g+3]*this.cur.noiseFreq*.65;let c=this.homeG[m*3],x=this.homeG[m*3+1],v=this.homeG[m*3+2];if(o!==0){const _=c,b=v;c=_*l-b*h,v=_*h+b*l}this.posG[m*3]=c+Math.sin(t*y+this.offG[g]+1.1)*this.cur.noiseAmp*1.5,this.posG[m*3+1]=x+Math.sin(t*y*1.2+this.offG[g+1]+.7)*this.cur.noiseAmp,this.posG[m*3+2]=v+Math.cos(t*y*.8+this.offG[g+2]+1.9)*this.cur.noiseAmp*1.5}this.geoGlow.attributes.position.needsUpdate=!0;const u=this.cur.noiseAmp/.065,
|
|
4040
|
+
`,e.appendChild(n),this.hudEl=n,this.hudStateEl=n.querySelector("#ev-state-label"),this.hudSubEl=n.querySelector("#ev-state-sub"),this.hudEbarsEl=n.querySelector("#ev-ebars");for(let r=0;r<12;r++){const s=document.createElement("div");s.className="ev-ebar",s.style.height="10px",this.hudEbarsEl.appendChild(s)}}buildScene(){this.scene.add(new Points(this.geoBody,this.matBody),new Points(this.geoGlow,this.matGlow),new Points(this.geoAura,this.matAura),new Points(this.geoMotes,this.matMotes));const e=new Float32Array(NS*3);for(let r=0;r<NS;r++){const s=Math.acos(2*Math.random()-1),a=Math.random()*PI2,o=35+Math.random()*60;e[r*3]=Math.sin(s)*Math.cos(a)*o,e[r*3+1]=Math.abs(Math.cos(s))*o*.8+2,e[r*3+2]=Math.sin(s)*Math.sin(a)*o-6}const t=new BufferGeometry;t.setAttribute("position",new BufferAttribute(e,3)),this.scene.add(new Points(t,this.makePMat(12636384,.072,.55))),this.scene.add(new AmbientLight(395282,.9));const n=new DirectionalLight(396320,.4);n.position.set(2,5,8),this.scene.add(n),this.coreLight=new PointLight(13664288,2.2,9,2),this.coreLight.position.set(0,1.95,0),this.scene.add(this.coreLight),this.groundGlow=new PointLight(2100228,.6,5,2),this.groundGlow.position.set(0,.15,.5),this.scene.add(this.groundGlow)}tick(e){const t=this.elapsed,n=this.smooth(e,2.2),r=this.lv.bind(this);this.cur.primary.lerp(this.tgt.primary,n),this.cur.accent.lerp(this.tgt.accent,n),this.cur.aura.lerp(this.tgt.aura,n),this.cur.coreCol.lerp(this.tgt.coreCol,n),this.cur.lightInt=r(this.cur.lightInt,this.tgt.lightInt,n),this.cur.noiseAmp=r(this.cur.noiseAmp,this.tgt.noiseAmp,n),this.cur.noiseFreq=r(this.cur.noiseFreq,this.tgt.noiseFreq,n),this.cur.swirl=r(this.cur.swirl,this.tgt.swirl,n),this.cur.pulseRate=r(this.cur.pulseRate,this.tgt.pulseRate,n),this.cur.bodySize=r(this.cur.bodySize,this.tgt.bodySize,n),this.cur.glowSize=r(this.cur.glowSize,this.tgt.glowSize,n);const s=.5+.5*Math.sin(t*this.cur.pulseRate),a=this.visualTier==="attention"?.4+.6*Math.abs(Math.sin(t*8.5)):s;this.coreLight.color.setHex(this.tgt.lightCol),this.coreLight.intensity=this.cur.lightInt*(.75+.25*a),this.groundGlow.color.copy(this.cur.primary),this.groundGlow.intensity=this.cur.lightInt*.22,this.matBody.color.copy(this.cur.primary),this.matBody.size=this.cur.bodySize,this.matGlow.color.copy(this.cur.accent),this.matGlow.size=this.cur.glowSize,this.matGlow.opacity=.25+.12*s,this.matAura.color.copy(this.cur.aura),this.matMotes.color.copy(this.cur.primary),this.matMotes.opacity=.35+.2*s;const o=Math.abs(this.cur.swirl)>.001?Math.sin(t*.42)*this.cur.swirl*Math.PI*.38:0,l=Math.cos(o),h=Math.sin(o);for(let m=0;m<NB;m++){const g=m*4,y=this.offB[g+3]*this.cur.noiseFreq;let c=this.homeB[m*3],x=this.homeB[m*3+1],v=this.homeB[m*3+2];if(o!==0){const _=c,b=v;c=_*l-b*h,v=_*h+b*l}this.posB[m*3]=c+Math.sin(t*y+this.offB[g])*this.cur.noiseAmp,this.posB[m*3+1]=x+Math.sin(t*y*1.3+this.offB[g+1])*this.cur.noiseAmp*.6,this.posB[m*3+2]=v+Math.cos(t*y*.9+this.offB[g+2])*this.cur.noiseAmp}this.geoBody.attributes.position.needsUpdate=!0;for(let m=0;m<NG;m++){const g=m*4,y=this.offG[g+3]*this.cur.noiseFreq*.65;let c=this.homeG[m*3],x=this.homeG[m*3+1],v=this.homeG[m*3+2];if(o!==0){const _=c,b=v;c=_*l-b*h,v=_*h+b*l}this.posG[m*3]=c+Math.sin(t*y+this.offG[g]+1.1)*this.cur.noiseAmp*1.5,this.posG[m*3+1]=x+Math.sin(t*y*1.2+this.offG[g+1]+.7)*this.cur.noiseAmp,this.posG[m*3+2]=v+Math.cos(t*y*.8+this.offG[g+2]+1.9)*this.cur.noiseAmp*1.5}this.geoGlow.attributes.position.needsUpdate=!0;const u=this.cur.noiseAmp/.065,p=this.layoutParams.auraXS,f=this.layoutParams.auraZS;for(let m=0;m<NA;m++){const g=this.auraData[m];g.angle+=e*g.spd*(1+Math.abs(this.cur.swirl)*.6);const y=g.r*u*(.85+.15*Math.sin(t*.28+g.phase));this.posA[m*3]=Math.cos(g.angle)*y*p,this.posA[m*3+1]=1.7+Math.sin(g.angle*.65+g.phase)*y*1.45+g.elev,this.posA[m*3+2]=Math.sin(g.angle)*y*f}this.geoAura.attributes.position.needsUpdate=!0;for(let m=0;m<NM;m++){const g=this.moteData[m],y=(t*g.riseSpd+g.phase)%2.8;this.posM[m*3]=g.x+Math.sin(t*.38+g.phase)*.22,this.posM[m*3+1]=y,this.posM[m*3+2]=g.z}this.geoMotes.attributes.position.needsUpdate=!0;const d=this.visualTier==="waiting"?.012:.048;if(this.camAngle+=e*d,this.camera.position.x=Math.sin(this.camAngle)*.9+.6,this.camera.position.y=2.1+Math.sin(t*(this.visualTier==="waiting"?.05:.11))*.07,this.camera.lookAt(0,1.9,0),this.godRaysEl){const m=this.visualTier==="waiting"?12:Math.max(2.5,10/Math.max(this.cur.pulseRate,.5));this.godRaysEl.style.setProperty("--ev-ray-pulse-sec",`${m}s`)}if(this.opts.circularDisplay){const m="#"+this.cur.primary.getHexString(),g=this.visualTier==="waiting",y=.5+Math.sin(t*this.cur.pulseRate*2)*.5;if(this.circularFrameEl){const c=24+y*32,x=40+y*24;this.circularFrameEl.style.borderColor=m,this.circularFrameEl.style.boxShadow=`inset 0 0 ${x}px ${m}33, 0 0 ${c}px ${m}44`}if(this.circularArcEl){const c=g?10:Math.max(1.4,3.2/Math.max(this.cur.pulseRate,.4));this.circularArcEl.style.animationDuration=`${c}s`,this.circularArcEl.style.opacity=g?"0.35":String(.55+y*.4)}}else if(this.hudEbarsEl){const m=this.hudEbarsEl.children,g="#"+this.cur.primary.getHexString(),y=this.visualTier==="waiting",c=(y?.22:.35+Math.min(this.cur.lightInt/8,.55)).toFixed(2),x=y?.65:2.4,v=y?10:28*Math.min(this.cur.lightInt/4,1);for(let _=0;_<m.length;_++){const b=m[_],M=6+(Math.sin(t*x+_*1.07)*.5+.5)*v;b.style.height=M.toFixed(1)+"px",b.style.background=g,b.style.opacity=c}}this.visualTier==="idle"&&(this.idleTimer+=e,this.idleTimer*1e3>=this.opts.idleCycleMs&&(this.idleTimer=0,this.idleIdx=(this.idleIdx+1)%IDLE_VARIANT_LABELS.length))}}const VISUAL_TIER_SET=new Set(["idle","thinking","waiting","working","responding","success","error","attention"]);function isCircularShrineDisplay(){return document.documentElement.classList.contains("shrine-kraken")}class ComponentVesselPlayer{constructor(e){this.renderer=null,this.mounted=!1,this.surfaceWidth=0,this.surfaceHeight=0,this.currentVisualTier="",this.stage=e}setSurfaceDimensions(e){const t=this.stage.getBoundingClientRect();t.width>0&&t.height>0?(this.surfaceWidth=t.width,this.surfaceHeight=t.height):(this.surfaceWidth=e.width,this.surfaceHeight=e.height),this.renderer&&this.surfaceWidth>0&&this.surfaceHeight>0&&this.renderer.resize(this.surfaceWidth,this.surfaceHeight)}mount(){if(this.mounted)return;this.mounted=!0,this.stage.querySelectorAll(".vessel-layer-a, .vessel-layer-b").forEach(r=>{r.style.display="none"});const e=this.stage.getBoundingClientRect(),t=this.surfaceWidth>0?this.surfaceWidth:e.width>0?e.width:this.stage.offsetWidth||400,n=this.surfaceHeight>0?this.surfaceHeight:e.height>0?e.height:this.stage.offsetHeight||400;window.eidolaShrine.log(`[renderer] ComponentVesselPlayer mount ${t}x${n}`);try{this.renderer=new CaminaVesselRenderer(this.stage,{width:t,height:n,idleCycleMs:9e3,circularDisplay:isCircularShrineDisplay()})}catch(r){window.eidolaShrine.log(`[renderer] CaminaVesselRenderer FAILED: ${String(r)}`)}typeof ResizeObserver<"u"&&new ResizeObserver(s=>{const a=s[0];if(!a||!this.renderer)return;const{width:o,height:l}=a.contentRect;o>0&&l>0&&this.renderer.resize(o,l)}).observe(this.stage)}setState(e,t){if(!VISUAL_TIER_SET.has(e)){console.warn(`[ComponentVesselPlayer] Unknown visual tier "${e}" — ignoring`);return}e!==this.currentVisualTier&&(this.currentVisualTier=e),this.mount(),this.renderer?.setState(e,{semantic:t?.semantic??e,...t?.tool!==void 0?{tool:t.tool}:{}})}dispose(){this.mounted&&(this.renderer?.dispose(),this.renderer=null,this.mounted=!1,this.currentVisualTier="",this.stage.querySelectorAll(".vessel-layer-a, .vessel-layer-b").forEach(e=>{e.style.display=""}))}}function shrineBasePath(){const i=window.location.pathname.replace(/\/$/,"");return i.endsWith("/index.html")?i.slice(0,-11):i||"/shrine"}function shrineEventsPath(){return`${shrineBasePath()}/events`}function shrineReadyPath(){return`${shrineBasePath()}/ready`}function installBrowserShrineApi(){const i=new Set,e=new Set,t=new Set,n=new EventSource(shrineEventsPath());n.onmessage=s=>{try{const a=JSON.parse(s.data);if(a.type==="state")for(const o of i)o(a.payload);else if(a.type==="vessel-config")for(const o of e)o(a.payload);else if(a.type==="surface")for(const o of t)o(a.payload)}catch{}};const r={onState(s){return i.add(s),()=>i.delete(s)},onVesselConfig(s){return e.add(s),()=>e.delete(s)},onSurface(s){return t.add(s),()=>t.delete(s)},ready(){fetch(shrineReadyPath(),{method:"POST"}).catch(()=>{})},log(s){console.log("[eidola-shrine:browser]",s)}};return window.eidolaShrine=r,r}function hasElectronShrineApi(){return!!window.eidolaShrine?.onState}const PARTICLE_COUNT=36;function mountShrineAtmosphere(i=document.body){if(i.querySelector(".shrine-atmosphere"))return;const e=document.createElement("div");e.className="shrine-atmosphere",e.setAttribute("aria-hidden","true"),e.innerHTML=`
|
|
4041
4041
|
<div class="god-rays"></div>
|
|
4042
4042
|
<div class="particle-field"></div>
|
|
4043
4043
|
<div class="landing-vignette"></div>
|
|
@@ -4048,36 +4048,122 @@ void main() {
|
|
|
4048
4048
|
<input type="text" readonly value="${e}" aria-label="NZXT CAM Web Integration URL" />
|
|
4049
4049
|
<button type="button" class="btn-divine btn-nav !normal-case" data-copy="cam">Copy</button>
|
|
4050
4050
|
</label>
|
|
4051
|
-
`,i.querySelector('[data-copy="cam"]')?.addEventListener("click",()=>{copyText(e)})}const ASPECT_OPTIONS=[{id:"ultrawide-4-1",label:"4:1",hint:"1920×480"},{id:"widescreen-16-9",label:"16:9",hint:"1920×1080"},{id:"square-1-1",label:"1:1",hint:"640×640"}];function aspectState(i){const e=SHRINE_ASPECT_RATIO_PRESETS[i];return{aspectRatio:i,width:e.width,height:e.height}}function applyKrakenPresentation(i){document.documentElement.dataset.shrineSurface="kraken-elite-v2",document.documentElement.dataset.shrineWidth=String(i.width),document.documentElement.dataset.shrineHeight=String(i.height),document.documentElement.classList.add("shrine-kraken"),document.documentElement.dataset.shrineMask="circle",document.documentElement.style.setProperty("--shrine-bg","#000000")}function applyAspectPresentation(i){document.documentElement.dataset.aspectRatio=i.aspectRatio,document.documentElement.dataset.shrineWidth=String(i.width),document.documentElement.dataset.shrineHeight=String(i.height)}function mountShrineSetupPage(i){const e=document.querySelector("[data-shrine-setup]");if(!e)throw new Error("Missing shrine setup host");
|
|
4051
|
+
`,i.querySelector('[data-copy="cam"]')?.addEventListener("click",()=>{copyText(e)})}const DEFAULT_BROWSE_URL="https://eidola.app/browse",ASPECT_OPTIONS=[{id:"ultrawide-4-1",label:"4:1",hint:"1920×480"},{id:"widescreen-16-9",label:"16:9",hint:"1920×1080"},{id:"square-1-1",label:"1:1",hint:"640×640"}];function aspectState(i){const e=SHRINE_ASPECT_RATIO_PRESETS[i];return{aspectRatio:i,width:e.width,height:e.height}}function applyKrakenPresentation(i){document.documentElement.dataset.shrineSurface="kraken-elite-v2",document.documentElement.dataset.shrineWidth=String(i.width),document.documentElement.dataset.shrineHeight=String(i.height),document.documentElement.classList.add("shrine-kraken"),document.documentElement.dataset.shrineMask="circle",document.documentElement.style.setProperty("--shrine-bg","#000000")}function applyAspectPresentation(i){document.documentElement.dataset.aspectRatio=i.aspectRatio,document.documentElement.dataset.shrineWidth=String(i.width),document.documentElement.dataset.shrineHeight=String(i.height)}function escapeHtml(i){return i.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function mountShrineSetupPage(i){const e=document.querySelector("[data-shrine-setup]");if(!e)throw new Error("Missing shrine setup host");const t=i.browseUrl??DEFAULT_BROWSE_URL;let n=i.initialAspect,r=[],s=null,a=!0,o=null,l=null;e.innerHTML=`
|
|
4052
|
+
|
|
4052
4053
|
<div class="shrine-setup-stack">
|
|
4054
|
+
|
|
4053
4055
|
<header class="shrine-setup-hero">
|
|
4056
|
+
|
|
4054
4057
|
<h1 class="shrine-setup-brand text-gold-gradient">Eidola</h1>
|
|
4058
|
+
|
|
4055
4059
|
<p class="shrine-setup-tagline">Shrine</p>
|
|
4060
|
+
|
|
4056
4061
|
</header>
|
|
4057
4062
|
|
|
4063
|
+
|
|
4064
|
+
|
|
4065
|
+
<section class="ui-panel shrine-control-panel" aria-labelledby="shrine-eidolons-title" data-eidolons-panel>
|
|
4066
|
+
|
|
4067
|
+
<h2 id="shrine-eidolons-title" class="type-overline">Eidolons</h2>
|
|
4068
|
+
|
|
4069
|
+
<div data-eidolons-list></div>
|
|
4070
|
+
|
|
4071
|
+
</section>
|
|
4072
|
+
|
|
4073
|
+
|
|
4074
|
+
|
|
4058
4075
|
<section class="ui-panel shrine-control-panel" aria-labelledby="shrine-aspect-title">
|
|
4076
|
+
|
|
4059
4077
|
<h2 id="shrine-aspect-title" class="type-overline">Aspect ratio</h2>
|
|
4078
|
+
|
|
4060
4079
|
<div class="shrine-settings-options" data-group="aspect"></div>
|
|
4080
|
+
|
|
4061
4081
|
</section>
|
|
4062
4082
|
|
|
4083
|
+
|
|
4084
|
+
|
|
4063
4085
|
<section class="ui-panel shrine-control-panel" aria-labelledby="shrine-kraken-title">
|
|
4086
|
+
|
|
4064
4087
|
<h2 id="shrine-kraken-title" class="type-overline">Kraken LCD</h2>
|
|
4088
|
+
|
|
4065
4089
|
<div data-kraken-url></div>
|
|
4090
|
+
|
|
4066
4091
|
</section>
|
|
4067
4092
|
|
|
4068
|
-
|
|
4069
|
-
Awaken
|
|
4070
|
-
</button>
|
|
4093
|
+
|
|
4071
4094
|
|
|
4072
4095
|
<p class="shrine-setup-hint">Press <kbd>Esc</kbd> to return here once awakened.</p>
|
|
4096
|
+
|
|
4073
4097
|
</div>
|
|
4074
|
-
|
|
4098
|
+
|
|
4099
|
+
`;const h=e.querySelector('[data-group="aspect"]'),u=e.querySelector("[data-kraken-url]"),p=e.querySelector("[data-eidolons-list]");if(!h||!u||!p)throw new Error("Shrine setup markup incomplete");renderKrakenCamUrl(u);function f(){h.innerHTML=ASPECT_OPTIONS.map(x=>`
|
|
4100
|
+
|
|
4075
4101
|
<button
|
|
4102
|
+
|
|
4076
4103
|
type="button"
|
|
4077
|
-
|
|
4078
|
-
|
|
4104
|
+
|
|
4105
|
+
class="shrine-option-btn ${x.id===n?"btn-divine":"btn-ignite"} btn-nav btn-nav-pair !normal-case"
|
|
4106
|
+
|
|
4107
|
+
data-aspect="${x.id}"
|
|
4108
|
+
|
|
4079
4109
|
>
|
|
4080
|
-
|
|
4081
|
-
<span class="shrine-option-
|
|
4110
|
+
|
|
4111
|
+
<span class="shrine-option-label">${x.label}</span>
|
|
4112
|
+
|
|
4113
|
+
<span class="shrine-option-hint">${x.hint}</span>
|
|
4114
|
+
|
|
4082
4115
|
</button>
|
|
4083
|
-
|
|
4116
|
+
|
|
4117
|
+
`).join("")}function d(){if(a){p.innerHTML='<p class="shrine-eidolon-status">Loading Eidolons…</p>';return}if(o){p.innerHTML=`<p class="shrine-eidolon-status shrine-eidolon-status--error">${escapeHtml(o)}</p>`;return}if(r.length===0){p.innerHTML=`
|
|
4118
|
+
|
|
4119
|
+
<div class="shrine-eidolon-empty">
|
|
4120
|
+
|
|
4121
|
+
<p class="shrine-eidolon-empty-text">No Engrams in your Eidola folder yet.</p>
|
|
4122
|
+
|
|
4123
|
+
<a class="shrine-eidolon-browse btn-ignite btn-nav !normal-case" href="${escapeHtml(t)}">
|
|
4124
|
+
|
|
4125
|
+
Browse Engrams →
|
|
4126
|
+
|
|
4127
|
+
</a>
|
|
4128
|
+
|
|
4129
|
+
</div>
|
|
4130
|
+
|
|
4131
|
+
`;return}p.innerHTML=`
|
|
4132
|
+
|
|
4133
|
+
<div class="shrine-eidolon-list">
|
|
4134
|
+
|
|
4135
|
+
${r.map(x=>{const v=x.id===s,_=x.id===l,b=x.description?.trim();return`
|
|
4136
|
+
|
|
4137
|
+
<article class="shrine-eidolon-card${v?" shrine-eidolon-card--selected":""}" data-engram-id="${escapeHtml(x.id)}">
|
|
4138
|
+
|
|
4139
|
+
<div class="shrine-eidolon-card-body">
|
|
4140
|
+
|
|
4141
|
+
<h3 class="shrine-eidolon-name">${escapeHtml(x.name)}</h3>
|
|
4142
|
+
|
|
4143
|
+
${b?`<p class="shrine-eidolon-description">${escapeHtml(b)}</p>`:""}
|
|
4144
|
+
|
|
4145
|
+
</div>
|
|
4146
|
+
|
|
4147
|
+
<button
|
|
4148
|
+
|
|
4149
|
+
type="button"
|
|
4150
|
+
|
|
4151
|
+
class="shrine-eidolon-awaken btn-divine btn-nav !normal-case"
|
|
4152
|
+
|
|
4153
|
+
data-awaken="${escapeHtml(x.id)}"
|
|
4154
|
+
|
|
4155
|
+
${_?"disabled":""}
|
|
4156
|
+
|
|
4157
|
+
>
|
|
4158
|
+
|
|
4159
|
+
${_?"Awakening…":"Awaken"}
|
|
4160
|
+
|
|
4161
|
+
</button>
|
|
4162
|
+
|
|
4163
|
+
</article>
|
|
4164
|
+
|
|
4165
|
+
`}).join("")}
|
|
4166
|
+
|
|
4167
|
+
</div>
|
|
4168
|
+
|
|
4169
|
+
`}async function m(){a=!0,o=null,d();try{const x=await fetch("/shrine/api/eidolons");if(!x.ok)throw new Error("Could not load Eidolons.");const v=await x.json();r=Array.isArray(v.eidolons)?v.eidolons:[],r.length===1&&(s=r[0].id)}catch(x){o=x instanceof Error?x.message:"Could not load Eidolons.",r=[]}finally{a=!1,d()}}const g=e;function y(){g.hidden=!1,g.classList.remove("hidden"),document.documentElement.classList.remove("shrine-awakened")}function c(){g.hidden=!0,g.classList.add("hidden")}return f(),m(),h.addEventListener("click",x=>{const v=x.target.closest("[data-aspect]");v?.dataset.aspect&&(n=v.dataset.aspect,f())}),p.addEventListener("click",x=>{const v=x.target.closest("[data-awaken]");if(!v?.dataset.awaken||v.disabled)return;const _=v.dataset.awaken;s=_,l=_,d(),(async()=>{try{await i.onAwaken({engramId:_,state:aspectState(n)})}finally{l=null,d()}})()}),y(),{show:y,hide:c,selectedAspect:()=>aspectState(n)}}function readNzxtViewport(){if(typeof window>"u")return null;const i=window.nzxt?.v1;if(!i)return null;const e=typeof i.width=="number"?i.width:640,t=typeof i.height=="number"?i.height:640,n=typeof i.shape=="string"?i.shape:"circle",r=typeof i.targetFps=="number"?i.targetFps:void 0;return{width:e,height:t,shape:n,targetFps:r}}function isKrakenQueryParam(i){const e=i??(typeof window<"u"?window.location.search:""),n=new URLSearchParams(e).get("kraken");return n==="1"||n==="true"}function detectKrakenMode(i){const e=typeof window<"u"?window.location.search:"",t=isKrakenQueryParam(e),n=readNzxtViewport(),r=t||n!==null;return{isKrakenBrowser:r,isConfigBrowser:!r,viewport:n}}function resolveBrowserShrineSurface(i,e="ultrawide-4-1"){if(!i.isKrakenBrowser)return{preset:e,...SHRINE_SURFACE_PRESETS[e]};const t=SHRINE_SURFACE_PRESETS["kraken-elite-v2"],n=i.viewport;if(!n)return{preset:"kraken-elite-v2",...t};const r=n.shape==="circle"||t.circularMask===!0;return{preset:"kraken-elite-v2",width:n.width,height:n.height,circularMask:r,layoutTier:t.layoutTier}}const SHRINE_STATE_COLORS={idle:"#c9a84c",thinking:"#b29e58",waiting:"#7896a8",working:"#da8a3a",searching:"#449eb2",writing:"#76a862",responding:"#eed04e",success:"#a8c850",error:"#9e76c6",attention:"#da302a"};function shrineColorForState(i){return SHRINE_STATE_COLORS[i]??SHRINE_STATE_COLORS.idle}const DEFAULT_CONFIG={rendererType:"lottie",pack:"camina-v1",idleClip:"idle.json",crossfadeMs:300,idleLoops:!0,approvalIdleMs:3e3,successHoldMs:3e3};let vesselConfig=DEFAULT_CONFIG,cachedIdlePayload=null,activeAspect=aspectState(DEFAULT_SHRINE_ASPECT_RATIO),activeSurface=null,setupController=null,browserAwakened=!1,shrineReadySent=!1,pendingAwakenRender=!1;async function bootstrap(){if(hasElectronShrineApi())return!0;mountShrineAtmosphere();const i=detectKrakenMode();if(installBrowserShrineApi(),i.isKrakenBrowser){const e=resolveBrowserShrineSurface(i);return activeSurface=e,applyKrakenPresentation(e),showVesselView(),!0}return setupController=mountShrineSetupPage({initialAspect:DEFAULT_SHRINE_ASPECT_RATIO,onAwaken:async({state:e,engramId:t})=>{await awakenBrowserShrine(e,t)}}),!0}function showVesselView(){document.querySelector("[data-shrine-vessel]")?.classList.remove("hidden"),setupController?.hide(),document.documentElement.classList.add("shrine-awakened")}function hideVesselView(){document.querySelector("[data-shrine-vessel]")?.classList.add("hidden"),setupController?.show()}async function awakenBrowserShrine(i,e){const t=await fetch("/shrine/api/awaken",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engram_id:e,aspect:i.aspectRatio})});if(!t.ok){const r=(await t.json().catch(()=>null))?.error??`Awaken failed (${t.status}).`;console.error("[eidola-shrine]",r);return}activeAspect=i,applyAspectPresentation(i),activeSurface=aspectToSurface(i),browserAwakened=!0,showVesselView(),window.dispatchEvent(new CustomEvent("shrine-awakened",{detail:i}))}function returnBrowserToSetup(){browserAwakened&&(browserAwakened=!1,hideVesselView(),window.dispatchEvent(new Event("shrine-return-setup")))}function aspectToSurface(i){return{preset:i.aspectRatio,width:i.width,height:i.height,layoutTier:i.aspectRatio==="ultrawide-4-1"?"ultrawide":i.aspectRatio==="widescreen-16-9"?"widescreen":"square"}}await bootstrap()&&runShrine();function runShrine(){const i=document.querySelector(".vessel-stage");if(!i)throw new Error("Missing vessel stage");const e=i,t=new VesselPlayer(e),n=new ComponentVesselPlayer(e),r=new ApprovalIdleController(M=>{x(M)});r.setConfig(vesselConfig);const s=new SuccessHoldController(()=>{m()});s.setConfig(vesselConfig);const a=document.querySelector(".shrine-dev-flag"),o=detectKrakenMode();let l=!1,h=null;function u(M){if(M.visual_state){M.visual_state==="working"?l=!0:(M.state==="idle"||M.state==="success"||M.visual_state==="thinking"&&M.state==="thinking")&&(l=!1);return}M.state==="idle"||M.state==="success"?l=!1:(M.state==="searching"||M.state==="writing"||M.state==="working")&&(l=!0)}function p(M){return u(M),M.visual_state??resolveVisualState({state:M.state,firstToolStarted:l})}o.isKrakenBrowser&&a?.remove();function f(){return vesselConfig.rendererType==="component"}function d(){const M=e.getBoundingClientRect();return M.width>0&&M.height>0?{width:M.width,height:M.height}:activeSurface?{width:activeSurface.width,height:activeSurface.height}:{width:activeAspect.width,height:activeAspect.height}}async function m(){if(y("idle"),f()){n.setState("idle");return}if(!cachedIdlePayload)return;const M={...cachedIdlePayload,source:"fallback"};g(M),await t.play(M,vesselConfig)}t.setAutoIdleHandler(()=>m());function g(M){if(!a)return;const{state:A}=M.broadcast;a.textContent=M.source==="socket"?A:`${A} · ${M.source}`}function y(M){if(f()){document.documentElement.style.setProperty("--shrine-bg","#020308");return}if(o.isKrakenBrowser){document.documentElement.style.setProperty("--shrine-bg","#000000");return}const A=shrineColorForState(M);document.documentElement.style.setProperty("--shrine-bg",A)}function c(){return o.isKrakenBrowser||browserAwakened}async function x(M){M.broadcast.engram_id&&r.setEngramId(M.broadcast.engram_id),r.onState(M);const A=s.filter(M);if(!A)return;if(h=A,A.broadcast.state==="idle"&&(cachedIdlePayload=A,t.setIdlePayload(A)),!c())if(pendingAwakenRender&&browserAwakened)pendingAwakenRender=!1;else return;y(A.broadcast.state),g(A);const R=p(A.broadcast),w={semantic:A.broadcast.state,...A.broadcast.tool!==void 0?{tool:A.broadcast.tool}:{}};if(window.eidolaShrine.log(`[renderer] onIncomingState state=${A.broadcast.state} visual=${R} isComponent=${f()} source=${A.source}`),f()){n.setState(R,w);return}const P={...A,broadcast:{...A.broadcast,visual_state:R}};await t.play(P,vesselConfig)}window.eidolaShrine.onVesselConfig(M=>{window.eidolaShrine.log(`[renderer] vesselConfig received rendererType=${M.rendererType} pack=${M.pack}`);const A=f();vesselConfig=M,t.setConfig(M),r.setConfig(M),s.setConfig(M),M.rendererType!=="component"&&A&&n.dispose(),M.rendererType==="component"&&!A&&h&&c()&&x(h)}),window.eidolaShrine.onSurface(M=>{if(!o.isKrakenBrowser&&!M.surface.circularMask){if(!browserAwakened)return;activeSurface=M.surface,document.documentElement.dataset.shrineSurface=M.surface.preset,document.documentElement.dataset.shrineWidth=String(M.surface.width),document.documentElement.dataset.shrineHeight=String(M.surface.height),n.setSurfaceDimensions(d())}window.eidolaShrine.log(`[renderer] active surface ${M.surface.preset} ${M.surface.width}×${M.surface.height}`),y("idle")}),window.addEventListener("shrine-aspect-changed",(()=>{!browserAwakened&&!o.isKrakenBrowser||(n.setSurfaceDimensions(d()),y("idle"))}));function v(){const M=h??cachedIdlePayload;return M?(x(M),!0):!1}window.addEventListener("shrine-awakened",()=>{n.setSurfaceDimensions(d()),v()||(pendingAwakenRender=!0,b())}),window.addEventListener("shrine-return-setup",()=>{n.dispose()}),o.isKrakenBrowser||window.addEventListener("keydown",M=>{M.key!=="Escape"||!browserAwakened||(M.preventDefault(),returnBrowserToSetup())});function _(){shrineReadySent||(shrineReadySent=!0,b())}function b(){window.eidolaShrine.ready()}window.eidolaShrine.onState(M=>{x(M)}),o.isKrakenBrowser&&n.setSurfaceDimensions(d()),_()}
|