You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 MiB

/**
* @license
* Copyright thing.js www.vaps.cc
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("core-js/es/array/includes")):"function"==typeof define&&define.amd?define(["exports","core-js/es/array/includes"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THING={})}(this,(function(t){"use strict";function e(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}const i=navigator.userAgent.toLowerCase(),r=function(t){return t.test(window.navigator?i:"")},n=r(/msie/),s=r(/applewebkit.*chrome*./),o=r(/msie/)||r(/trident/),a=r(/msie 10/),l=r(/edge/),h=r(/firefox/),c=r(/mac/),d=!!window.navigator&&window.navigator.platform.indexOf("Win")>-1,u="ontouchstart"in document.documentElement||!d&&(!!document&&"ontouchend"in document),p=-1!=i.indexOf("mobile")||-1!=i.indexOf("android"),m=/(Android)\s+([\d.]+)/i.test(i),f=/\(i[^;]+;( U;)? cpu.+mac os x/i.test(i),g=/(iPhone|iPad|iPod|iOS|Mac OS X)/i.test(i),v=/(iPhone\sOS)\s([\d_]+)/i.test(i),y=/(iPad).*OS\s([\d_]+)/i.test(i),w=/QQ\/([\d.]+)/i.test(i),x=/wxwork\/.* MicroMessenger/i.test(i),b=/micromessenger/i.test(i)&&!x,_=/WeiBo/i.test(i),A="miniprogram"===window.__wxjs_environment;/AlipayClient/i.test(i);const S=h?"DOMMouseScroll":"mousewheel",T=u?["touchstart","touchmove","touchend","keydown","keyup","keypress","input","contextmenu","compositionstart","compositionupdate","compositionend"]:["keydown","keyup","keypress","input","mousedown","mousemove","mouseup","mouseout",S,"wheel","contextmenu","mouseenter","mouseleave","mouseover","compositionstart","compositionupdate","compositionend"];let E=!1;try{const t=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(Yr){E=!1}const P=E,M=!!E&&{passive:!1,capture:!1},C=!E||{passive:!1,capture:!0};function L(){try{let t=new Array;if(null!=window.screen.deviceXDPI)t[0]=window.screen.deviceXDPI,t[1]=window.screen.deviceYDPI;else{let e=document.createElement("DIV");e.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(e),t[0]=parseInt(e.offsetWidth),t[1]=parseInt(e.offsetHeight),e.parentNode.removeChild(e)}return t[0]||96}catch{}return 96}const R=L();var O=Object.freeze({__proto__:null,navTest:r,browserIsIE:n,browserIsChrome:s,browserIsIEorTrident:o,browserIsIE10:a,browserIsEdge:l,browserIsFirefox:h,browserIsMac:c,isWindowPlatform:d,isTouchable:u,isMobile:p,isAndroid:m,isIOS:f,isApple:g,isIphone:v,isIpad:y,isQQ:w,isWeiXinWork:x,isWeiXin:b,isWeiBo:_,isMiniProgram:A,CS_MSWHEEL_KEY:S,CS_EVENT_LIST:T,passiveSupported:P,eventListenerOptionsFalse:M,eventListenerOptionsTrue:C,getPlatform:function(){let t=navigator.userAgent;const e=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"];let i=!0,r="PC",n=!1;for(let s=0;s<e.length;s++)if(t.indexOf(e[s])>0){i=!1,r=e[s],t.indexOf("MicroMessenger")>0&&(n=!0);break}return{isPC:i,isWeixin:n,platform:r}},getScreenScale:function(){var t=0,e=window.screen;return void 0!==window.devicePixelRatio?t=window.devicePixelRatio:~this.ua.indexOf("msie")?e.deviceXDPI&&e.logicalXDPI&&(t=e.deviceXDPI/e.logicalXDPI):void 0!==window.outerWidth&&void 0!==window.innerWidth&&(t=window.outerWidth/window.innerWidth),t&&(t=Math.round(100*t)),99!==t&&101!==t||(t=100),t},getDPI:L,DPI:R,getPixelPerCentimeter:function(){return L()/2.54}});function F(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:!(!t||"object"!=typeof t||1!==t.nodeType&&9!==t.nodeType||"string"!=typeof t.nodeName)}function N(t,e){let i=t.className.split(/\s+/);for(let t=0;t<i.length;t++)if(i[t]==e)return!0;return!1}function D(t,e){if(N(t,e))return;const i=t.className,r=i+(""!=i?" ":"")+e;t.className=r}function I(t,e){if(!N(t,e))return;let i=" "+t.className+" ";i=i.replace(/(\s+)/gi," ");let r=i.replace(" "+e+" "," ");r=r.replace(/(^\s+)|(\s+$)/g,""),t.className=r}const U=function(t,e,i){const r=window.document.createElement(t);return e&&(r.className=e),i&&i.appendChild(r),r},B=window.document?window.document.documentElement.style:null;function k(t){if(!B)return null;for(let e=0;e<t.length;e++)if(t[e]in B)return t[e];return t[0]}function j(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function V(t){return!!u||0===t.button}function z(t,e){if(!t||!e)return null;const i=t.getBoundingClientRect(),r=e.touches;let n=r?e.touches[0].pageX:e.clientX,s=r?e.touches[0].pageY:e.clientY;return n=(n-i.left)/t.offsetWidth*2-1,s=-(s-i.top)/t.offsetHeight*2+1,{x:n,y:s,clientX:e.clientX,clientY:e.clientY,offsetX:e.clientX-i.left,offsetY:e.clientY-i.top,width:i.width,height:i.height,left:i.left,top:i.top}}function G(t){t.cancelBubble=!0,t.stopPropagation()}k(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),k(["transform","WebkitTransform"]);const H=function(t){return(t=t||{}).circles?function(t){var i=[],r=[];return t.proto?o:s;function n(t,n){for(var s=Object.keys(t),o=new Array(s.length),a=0;a<s.length;a++){var l=s[a],h=t[l];if("object"!=typeof h||null===h)o[l]=h;else if(h instanceof Date)o[l]=new Date(h);else if(ArrayBuffer.isView(h))o[l]=e(h);else{var c=i.indexOf(h);o[l]=-1!==c?r[c]:n(h)}}return o}function s(t){if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return n(t,s);if(t instanceof Map)return new Map(n(Array.from(t),s));if(t instanceof Set)return new Set(n(Array.from(t),s));var o={};for(var a in i.push(t),r.push(o),t)if(!1!==Object.hasOwnProperty.call(t,a)){var l=t[a];if("object"!=typeof l||null===l)o[a]=l;else if(l instanceof Date)o[a]=new Date(l);else if(l instanceof Map)o[a]=new Map(n(Array.from(l),s));else if(l instanceof Set)o[a]=new Set(n(Array.from(l),s));else if(ArrayBuffer.isView(l))o[a]=e(l);else{var h=i.indexOf(l);o[a]=-1!==h?r[h]:s(l)}}return i.pop(),r.pop(),o}function o(t){if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return n(t,o);if(t instanceof Map)return new Map(n(Array.from(t),o));if(t instanceof Set)return new Set(n(Array.from(t),o));var s={};for(var a in i.push(t),r.push(s),t){var l=t[a];if("object"!=typeof l||null===l)s[a]=l;else if(l instanceof Date)s[a]=new Date(l);else if(l instanceof Map)s[a]=new Map(n(Array.from(l),o));else if(l instanceof Set)s[a]=new Set(n(Array.from(l),o));else if(ArrayBuffer.isView(l))s[a]=e(l);else{var h=i.indexOf(l);s[a]=-1!==h?r[h]:o(l)}}return i.pop(),r.pop(),s}}(t):t.proto?function t(r){if("object"!=typeof r||null===r)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return i(r,t);if(r instanceof Map)return new Map(i(Array.from(r),t));if(r instanceof Set)return new Set(i(Array.from(r),t));var n={};for(var s in r){var o=r[s];"object"!=typeof o||null===o?n[s]=o:o instanceof Date?n[s]=new Date(o):o instanceof Map?n[s]=new Map(i(Array.from(o),t)):o instanceof Set?n[s]=new Set(i(Array.from(o),t)):ArrayBuffer.isView(o)?n[s]=e(o):n[s]=t(o)}return n}:function t(r){if("object"!=typeof r||null===r)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return i(r,t);if(r instanceof Map)return new Map(i(Array.from(r),t));if(r instanceof Set)return new Set(i(Array.from(r),t));var n={};for(var s in r)if(!1!==Object.hasOwnProperty.call(r,s)){var o=r[s];"object"!=typeof o||null===o?n[s]=o:o instanceof Date?n[s]=new Date(o):o instanceof Map?n[s]=new Map(i(Array.from(o),t)):o instanceof Set?n[s]=new Set(i(Array.from(o),t)):ArrayBuffer.isView(o)?n[s]=e(o):n[s]=t(o)}return n};function i(t,i){for(var r=Object.keys(t),n=new Array(r.length),s=0;s<r.length;s++){var o=r[s],a=t[o];"object"!=typeof a||null===a?n[o]=a:a instanceof Date?n[o]=new Date(a):ArrayBuffer.isView(a)?n[o]=e(a):n[o]=i(a)}return n}}();function X(t,e){return Object.prototype.toString.call(t)===`[object ${e}]`}function W(t){return X(t,"Array")}function Y(t){return X(t,"Boolean")}function Q(t){return X(t,"String")}function J(t){return X(t,"Number")}function Z(t){return X(t,"Function")}function q(t){return X(t,"Object")}function K(t){return null==t}function $(t){if(!K(t)&&Q(t))for(var e=0;e<t.length;e++)if(" "!=t[e]&&"\t"!=t[e])return!1;return!0}function tt(t){if(!q(t)||K(t))return!1;for(const e in t)return!1;return!0}function et(t){return q(t)?H(t):{}}function it(t){if(!Q(t))return!1;if(""===t||""===t.trim())return!1;try{return btoa(atob(t))==t}catch(t){return!1}}const rt="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function nt(t){return Q(t)?t.trim?t.trim():t.replace(/^\s+|\s+$/g,""):t}function st(t,e,i){if(!t||!e)return[];for(let r=0,n=t.length;r<n;r++)if(void 0!==i&&t[r][e]===i)return t.splice(r,1);return[]}function ot(t,e){const i=[];for(let r=0,n=t.length;r<n;r++){for(let i=r+1;i<n;i++)(e?e(t[r],t[i]):t[r]===t[i])&&(i=++r);i.push(t[r])}return i}function at(t,e,i){return t.replace(new RegExp(e,"gi"),i)}let lt=0;function ht(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e))}))}function ct(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function dt(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;clearTimeout(t.tid),t.tid=window.setTimeout((function(){return t.call(e,i)}),r)}function ut(t,e,i){let r=null,n=!1;function s(){n=!1,r&&(o.apply(i,r),r=!1)}function o(){n?r=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)}return o}function pt(t,e){if(!tt(e))for(const i in e)q(e[i])?(q(t[i])||(t[i]={}),pt(t[i],e[i])):void 0===e[i]||Z(e[i])||(t[i]=null===e[i]||F(e[i])?e[i]:JSON.parse(JSON.stringify(e[i])));return t}function mt(t){if(arguments.length>=2)for(let e=1;e<arguments.length;e++)pt(t,arguments[e]);return t}function ft(t,e){if(q(e))for(const i in e)q(e[i])?(q(t[i])||(t[i]={}),e[i].isMaterial||e[i].isTexture||e[i].isGeometry?t[i]=e[i]:ft(t[i],e[i])):void 0===e[i]||Z(e[i])||(t[i]=e[i]?JSON.parse(JSON.stringify(e[i])):e[i]);return t}function gt(t){if(arguments.length>=2)for(let e=1;e<arguments.length;e++)ft(t,arguments[e]);return t}function vt(t,e){for(let i=0;i<t.length;i++)if(t[i]===e)return i;return-1}function yt(t){return(t=t||"").replace(t[0],t[0].toLowerCase())}function wt(t){return t>0&&0==(t-1&t)}function xt(t,e){return t.toArray().map((t=>ct(t,e||5)))}function bt(t,e,i,r,n){return[i,r,n,`${e}px`,t].join(" ")}function _t(t){return Q(t)&&t.lastIndexOf(".")>0?t.split(".").pop():""}function At(t){if(Q(t)&&t.lastIndexOf("/")>0){var e=t.split("/");return e.pop(),e.join("/")}return t}function St(t){if(Q(t)&&t.lastIndexOf("/")>0){var e=t.split("/"),i=e.pop();return{path:e.join("/")+"/",fileName:i}}return null}function Tt(t){let e=t.split("");return"/"!==e[e.length-1]?t+"/":t}function Et(t,e){if(!W(t)||!W(e))return!1;if(t.length!==e.length)return!1;let i=!0;for(let r=0;r<t.length;r++)if(t[r]!==e[r]){i=!1;break}return i}function Pt(t){if(0===t.length)return-1/0;for(var e=t[0],i=1,r=t.length;i<r;++i)t[i]>e&&(e=t[i]);return e}const Mt=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();const Ct=t=>null==t,Lt=t=>!Ct(t);var Rt=Object.freeze({__proto__:null,cloneDeep:H,isArray:W,isBoolean:Y,isString:Q,isNumber:J,isFunction:Z,isObject:q,isNull:K,isUndefined:function(t){return void 0===t},isBlank:$,isEmptyObject:tt,isJSON:function(t){if(K(t))return!1;if(q(t)&&!tt(t))return t;let e=!0;if(Q(t))try{var i=JSON.parse(t);if(q(i)&&t.indexOf("{")>-1)return i;e=!1}catch(t){e=!1}return console.error("The "+t+" isn't json"),e},cloneJson:et,cloneArray:function(t){return W(t)?t.concat():[]},isEqualNumber:function(t,e){return Math.abs(t-e)<1e-5},isBase64:it,emptyImageUrl:rt,trim:nt,splitWords:function(t){return nt(t).split(/\s+/)},getObjectFromArray:function(t,e,i,r){if(t&&t.length&&e){for(let n=0,s=t.length;n<s;n++)if(t[n]&&t[n][e]&&t[n][e]===i)return r?n:t[n];return r?-1:null}},removeObjectFromArray:st,removeFromArrayLoop:function(t,e,i){let r=0,n=!0,s=t.length;for(;r<s;n?r++:r)t[r]&&t[r][e]==i?(t.splice(r,1),n=!1):n=!0},unique:ot,removeFromArray:function(t,e){for(let i=0;i<t.length;i++)if(t[i]===e)return void t.splice(i,1)},distinct:function(t){if(W(t)){!function e(i){i>=1&&((W(t[i])?Et(t[i],t[i-1]):t[i]===t[i-1])&&t.splice(i,1),e(i-1))}(t.length-1)}return t},replaceAll:at,getQueryStr:function(t){let e,i=String(window.document.location.href);return(e=new RegExp("(^|)"+t+"=([^&]*)(&|$)","gi").exec(i))?e[2]:""},encodeUnicode:function(t){for(var e=[],i=0;i<t.length;i++)e[i]=("00"+t.charCodeAt(i).toString(16)).slice(-4);return"\\u"+e.join("\\u")},decodeUnicode:function(t){return t=t.replace(/\\/g,"%"),unescape(t)},extend:function(t,...e){if(K(t))return{};var i,r,n,s;for(r=1,n=arguments.length;r<n;r++)for(i in s=arguments[r])t[i]=s[i];return t},bind:function(t,e){let i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));let r=i.call(arguments,2);return function(){return t.apply(e,r.length?r.concat(i.call(arguments)):arguments)}},get lastId(){return lt},stamp:function(t){return t.id=t.id||++lt,t.id},bindAll:ht,falseFn:function(){return!1},formatNum:ct,debounce:dt,throttle:ut,mixin:pt,mixins:mt,optionMixin:ft,optionMixins:gt,contain:vt,camel2hyphens:function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},hyphens2camel:function(t){let e=t.split("-"),i=e[0];for(var r=1;r<e.length;r++)i=i+e[r].slice(0,1).toUpperCase()+e[r].slice(1);return i},firstLower:yt,firstUpper:function(t){return(t=t||"").replace(t[0],t[0].toUpperCase())},getNowTicker:function(){return window.performance&&window.performance.now?window.performance.now():Date.now()},cancelTick:function(t,e){e?clearTimeout(t):window.cancelAnimationFrame(t)},isPowerOf2:wt,pow2:function(t){return t*t},getMaxInThree:function(t,e,i){return e>t?e:t>i?i:t},plusOrMinus:function(t){return 0>t?-1:t>0?1:0},vectorToArray:xt,getCSSFont:bt,getFileExt:_t,getFilePath:At,getFileInfoFromUrl:St,safeUrl:function(t){return["/"].forEach((function(e){t=at(t,e,".")})),t=t.replace(/\\/g,"/")},fixUrlSlash:Tt,equalArray:Et,arrayMin:function(t){if(0===t.length)return 1/0;for(var e=t[0],i=1,r=t.length;i<r;++i)t[i]<e&&(e=t[i]);return e},arrayMax:Pt,runAsync:function(t){return new Promise((function(t){return setTimeout(t,10)})).then((function(){t()}))},toMatrixElementsArray:function(t){return{_00:t.elements[0],_01:t.elements[1],_02:t.elements[2],_03:t.elements[3],_10:t.elements[4],_11:t.elements[5],_12:t.elements[6],_13:t.elements[7],_20:t.elements[8],_21:t.elements[9],_22:t.elements[10],_23:t.elements[11],_30:t.elements[12],_31:t.elements[13],_32:t.elements[14],_33:t.elements[15]}},elementsArrayToMatrix:function(t,e){t.elements[0]=e._00,t.elements[1]=e._01,t.elements[2]=e._02,t.elements[3]=e._03,t.elements[4]=e._10,t.elements[5]=e._11,t.elements[6]=e._12,t.elements[7]=e._13,t.elements[8]=e._20,t.elements[9]=e._21,t.elements[10]=e._22,t.elements[11]=e._23,t.elements[12]=e._30,t.elements[13]=e._31,t.elements[14]=e._32,t.elements[15]=e._33},parseValue:function(t,e){return K(t)?e:t},parseNumber3:function(t,e){return W(t)&&3===t.length?t.concat():e||[0,0,0]},createClass:Mt,backupValue:function(t,e,i){if(void 0===t["_prev_"+e]){var r=t[e||tokey];return t["_prev_"+e]=r,r}return null},revertValue:function(t,e,i){var r=t["_prev_"+e];void 0!==r&&(t[i||e]=r,delete t["_prev_"+e])},getValue:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t["_prev_"+e];return i&&delete t["_prev_"+e],r},isNil:Ct,isNotNil:Lt,pendingPromise:function(){let t,e;const i=new Promise(((i,r)=>{t=i,e=r}));return i.reject=e,i.resolve=t,i},getRandomBetween:function(t,e){return Math.random()*(e-t)+t}}),Ot={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-Ot.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*Ot.Bounce.In(2*t):.5*Ot.Bounce.Out(2*t-1)+.5}}},Ft="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},Nt=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=Ft()),void 0===e&&(e=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var n=this._tweens[i[r]],s=!e;n&&!1===n.update(t,s)&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),Dt={Linear:function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r),s=Dt.Utils.Linear;return e<0?s(t[0],t[1],r):e>1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)},Bezier:function(t,e){for(var i=0,r=t.length-1,n=Math.pow,s=Dt.Utils.Bernstein,o=0;o<=r;o++)i+=n(1-e,r-o)*n(e,o)*t[o]*s(r,o);return i},CatmullRom:function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r),s=Dt.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(n=Math.floor(r=i*(1+e))),s(t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i],r-n)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[i]-(s(t[i],t[i],t[i-1],t[i-1],r-i)-t[i]):s(t[n?n-1:0],t[n],t[i<n+1?i:n+1],t[i<n+2?i:n+2],r-n)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=Dt.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:function(){var t=[1];return function(e){var i=1;if(t[e])return t[e];for(var r=e;r>1;r--)i*=r;return t[e]=i,i}}(),CatmullRom:function(t,e,i,r,n){var s=.5*(i-t),o=.5*(r-e),a=n*n;return(2*e-2*i+s+o)*(n*a)+(-3*e+3*i-2*s-o)*a+s*n+e}}},It=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Ut=new Nt,Bt=function(){function t(t,e){void 0===e&&(e=Ut),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ot.Linear.None,this._interpolationFunction=Dt.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=It.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?Ft()+parseFloat(t):t:Ft(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,i,r){for(var n in i){var s=t[n],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(i[n]);if("undefined"!==a&&"function"!==a){if(l){var h=i[n];if(0===h.length)continue;h=h.map(this._handleRelativeValue.bind(this,s)),i[n]=[s].concat(h)}if("object"!==a&&!o||!s||l)void 0===e[n]&&(e[n]=s),o||(e[n]*=1),r[n]=l?i[n].slice().reverse():e[n]||0;else{for(var c in e[n]=o?[]:{},s)e[n][c]=s[c];r[n]=o?[]:{},this._setupProperties(s,e[n],i[n],r[n])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=Ft()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=Ft()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return this._group=t,this},t.prototype.delay=function(t){return this._delayTime=t,this},t.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return this._yoyo=t,this},t.prototype.easing=function(t){return this._easingFunction=t,this},t.prototype.interpolation=function(t){return this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=Ft()),void 0===e&&(e=!0),this._isPaused)return!0;var i,r,n=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>n)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),r=(t-this._startTime)/this._duration,r=0===this._duration||r>1?1:r;var s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),1===r){if(this._repeat>0){for(i in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var o=0,a=this._chainedTweens.length;o<a;o++)this._chainedTweens[o].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,r){for(var n in i)if(void 0!==e[n]){var s=e[n]||0,o=i[n],a=Array.isArray(t[n]),l=Array.isArray(o);!a&&l?t[n]=this._interpolationFunction(o,r):"object"==typeof o&&o?this._updateProperties(t[n],s,o,r):"number"==typeof(o=this._handleRelativeValue(s,o))&&(t[n]=s+(o-s)*r)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),kt=It.nextId,jt=Ut,Vt=jt.getAll.bind(jt),zt=jt.removeAll.bind(jt),Gt=jt.add.bind(jt),Ht=jt.remove.bind(jt),Xt=jt.update.bind(jt),Wt={Easing:Ot,Group:Nt,Interpolation:Dt,now:Ft,Sequence:It,nextId:kt,Tween:Bt,VERSION:"18.6.4",getAll:Vt,removeAll:zt,add:Gt,remove:Ht,update:Xt};const Yt={BOTTOM_LEFT:"bottomleft",BOTTOM:"bottom",BOTTOM_CENTER:"bottom",BOTTOM_RIGHT:"bottomright",TOP_LEFT:"topleft",TOP:"top",TOP_CENTER:"top",TOP_RIGHT:"topright",LEFT:"left",RIGHT:"right",CENTER:"center"},Qt=1,Jt=3,Zt=4,qt=5,Kt={IMAGE:"image",TEXTURE:"texture",SkyBox:"skybox",MODEL:"model",SHADER:"shader",SCRIPT:"script",AUDIO:"audio",VIDEO:"video",MATERAIL:"material",FONT:"font",ANIMATE:"animate",GEOJSON:"geojson",WebView:"webview",Dom:"dom",CubeTexture:"cubeTexture"},$t={POINT:"point",RECTANGLE:"rectangle"},te="sceneSetup",ee="dataChange",ie="propertyChange",re="pick",ne="click",se="contextmenu",oe="mousedown",ae="mouseover",le="dblclick",he="resize";Wt.Easing.Linear.None,Wt.Easing.Quadratic.In,Wt.Easing.Quadratic.Out,Wt.Easing.Quadratic.InOut,Wt.Easing.Cubic.In,Wt.Easing.Cubic.Out,Wt.Easing.Cubic.InOut,Wt.Easing.Quartic.In,Wt.Easing.Quartic.Out,Wt.Easing.Quartic.InOut,Wt.Easing.Quintic.In,Wt.Easing.Quintic.Out,Wt.Easing.Quintic.InOut,Wt.Easing.Sinusoidal.In,Wt.Easing.Sinusoidal.Out,Wt.Easing.Sinusoidal.InOut,Wt.Easing.Exponential.In,Wt.Easing.Exponential.Out,Wt.Easing.Exponential.InOut,Wt.Easing.Circular.In,Wt.Easing.Circular.Out,Wt.Easing.Circular.InOut,Wt.Easing.Elastic.In,Wt.Easing.Elastic.Out,Wt.Easing.Elastic.InOut,Wt.Easing.Back.In,Wt.Easing.Back.Out,Wt.Easing.Back.InOut,Wt.Easing.Bounce.In,Wt.Easing.Bounce.Out,Wt.Easing.Bounce.InOut;const ce="#FFFF00",de="#FFFFFF",ue="#FF0000",pe={ENGINE:1,IGNORE_RAYCAST:20,GIZMOS:21,EDITOR:22,UI3D:23,SCENE_GIZMO:24,UI2D:25,PROFILER:28,DEFAULT:30},me=window.THREE,fe=new me.Matrix4,ge=new me.Object3D,ve=new me.Vector3;class ye extends me.EventDispatcher{constructor(){super(),this.uuid=me.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(t){const e=(new me.Matrix3).getNormalMatrix(t);for(let e=0,i=this.vertices.length;e<i;e++){this.vertices[e].applyMatrix4(t)}for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t];i.normal.applyMatrix3(e).normalize();for(let t=0,r=i.vertexNormals.length;t<r;t++)i.vertexNormals[t].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(t){return fe.makeRotationX(t),this.applyMatrix4(fe),this}rotateY(t){return fe.makeRotationY(t),this.applyMatrix4(fe),this}rotateZ(t){return fe.makeRotationZ(t),this.applyMatrix4(fe),this}translate(t,e,i){return fe.makeTranslation(t,e,i),this.applyMatrix4(fe),this}scale(t,e,i){return fe.makeScale(t,e,i),this.applyMatrix4(fe),this}lookAt(t){return ge.lookAt(t),ge.updateMatrix(),this.applyMatrix4(ge.matrix),this}fromBufferGeometry(t){const e=this,i=null!==t.index?t.index:void 0,r=t.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;const n=r.position,s=r.normal,o=r.color,a=r.uv,l=r.uv2;void 0!==l&&(this.faceVertexUvs[1]=[]);for(let t=0;t<n.count;t++)e.vertices.push((new me.Vector3).fromBufferAttribute(n,t)),void 0!==o&&e.colors.push((new me.Color).fromBufferAttribute(o,t));function h(t,i,r,n){const h=void 0===o?[]:[e.colors[t].clone(),e.colors[i].clone(),e.colors[r].clone()],c=void 0===s?[]:[(new me.Vector3).fromBufferAttribute(s,t),(new me.Vector3).fromBufferAttribute(s,i),(new me.Vector3).fromBufferAttribute(s,r)],d=new xe(t,i,r,c,h,n);e.faces.push(d),void 0!==a&&e.faceVertexUvs[0].push([(new me.Vector2).fromBufferAttribute(a,t),(new me.Vector2).fromBufferAttribute(a,i),(new me.Vector2).fromBufferAttribute(a,r)]),void 0!==l&&e.faceVertexUvs[1].push([(new me.Vector2).fromBufferAttribute(l,t),(new me.Vector2).fromBufferAttribute(l,i),(new me.Vector2).fromBufferAttribute(l,r)])}const c=t.groups;if(c.length>0)for(let t=0;t<c.length;t++){const e=c[t],r=e.start;for(let t=r,n=r+e.count;t<n;t+=3)void 0!==i?h(i.getX(t),i.getX(t+1),i.getX(t+2),e.materialIndex):h(t,t+1,t+2,e.materialIndex)}else if(void 0!==i)for(let t=0;t<i.count;t+=3)h(i.getX(t),i.getX(t+1),i.getX(t+2));else for(let t=0;t<n.count;t+=3)h(t,t+1,t+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ve).negate(),this.translate(ve.x,ve.y,ve.z),this}normalize(){this.computeBoundingSphere();const t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,r=new me.Matrix4;return r.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix4(r),this}computeFaceNormals(){const t=new me.Vector3,e=new me.Vector3;for(let i=0,r=this.faces.length;i<r;i++){const r=this.faces[i],n=this.vertices[r.a],s=this.vertices[r.b],o=this.vertices[r.c];t.subVectors(o,s),e.subVectors(n,s),t.cross(e),t.normalize(),r.normal.copy(t)}}computeVertexNormals(t=!0){const e=new Array(this.vertices.length);for(let t=0,i=this.vertices.length;t<i;t++)e[t]=new me.Vector3;if(t){const t=new me.Vector3,i=new me.Vector3;for(let r=0,n=this.faces.length;r<n;r++){const n=this.faces[r],s=this.vertices[n.a],o=this.vertices[n.b],a=this.vertices[n.c];t.subVectors(a,o),i.subVectors(s,o),t.cross(i),e[n.a].add(t),e[n.b].add(t),e[n.c].add(t)}}else{this.computeFaceNormals();for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t];e[i.a].add(i.normal),e[i.b].add(i.normal),e[i.c].add(i.normal)}}for(let t=0,i=this.vertices.length;t<i;t++)e[t].normalize();for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t],r=i.vertexNormals;3===r.length?(r[0].copy(e[i.a]),r[1].copy(e[i.b]),r[2].copy(e[i.c])):(r[0]=e[i.a].clone(),r[1]=e[i.b].clone(),r[2]=e[i.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],i=e.vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]);for(let t=0,i=e.vertexNormals.length;t<i;t++)e.__originalVertexNormals[t]?e.__originalVertexNormals[t].copy(e.vertexNormals[t]):e.__originalVertexNormals[t]=e.vertexNormals[t].clone()}const t=new ye;t.faces=this.faces;for(let e=0,i=this.morphTargets.length;e<i;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];const t=this.morphNormals[e].faceNormals,i=this.morphNormals[e].vertexNormals;for(let e=0,r=this.faces.length;e<r;e++){const e=new me.Vector3,r={a:new me.Vector3,b:new me.Vector3,c:new me.Vector3};t.push(e),i.push(r)}}const i=this.morphNormals[e];t.vertices=this.morphTargets[e].vertices,t.computeFaceNormals(),t.computeVertexNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],r=i.faceNormals[t],n=i.vertexNormals[t];r.copy(e.normal),n.a.copy(e.vertexNormals[0]),n.b.copy(e.vertexNormals[1]),n.c.copy(e.vertexNormals[2])}}for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t];e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals}}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new me.Box3),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new me.Sphere),this.boundingSphere.setFromPoints(this.vertices)}merge(t,e,i=0){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);let r;const n=this.vertices.length,s=this.vertices,o=t.vertices,a=this.faces,l=t.faces,h=this.colors,c=t.colors;void 0!==e&&(r=(new me.Matrix3).getNormalMatrix(e));for(let t=0,i=o.length;t<i;t++){const i=o[t].clone();void 0!==e&&i.applyMatrix4(e),s.push(i)}for(let t=0,e=c.length;t<e;t++)h.push(c[t].clone());for(let t=0,e=l.length;t<e;t++){const e=l[t];let s,o;const h=e.vertexNormals,c=e.vertexColors,d=new xe(e.a+n,e.b+n,e.c+n);d.normal.copy(e.normal),void 0!==r&&d.normal.applyMatrix3(r).normalize();for(let t=0,e=h.length;t<e;t++)s=h[t].clone(),void 0!==r&&s.applyMatrix3(r).normalize(),d.vertexNormals.push(s);d.color.copy(e.color);for(let t=0,e=c.length;t<e;t++)o=c[t],d.vertexColors.push(o.clone());d.materialIndex=e.materialIndex+i,a.push(d)}for(let e=0,i=t.faceVertexUvs.length;e<i;e++){const i=t.faceVertexUvs[e];void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]);for(let t=0,r=i.length;t<r;t++){const r=i[t],n=[];for(let t=0,e=r.length;t<e;t++)n.push(r[t].clone());this.faceVertexUvs[e].push(n)}}}mergeMesh(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)}mergeVertices(t=4){const e={},i=[],r=[],n=Math.pow(10,t);for(let t=0,s=this.vertices.length;t<s;t++){const s=this.vertices[t],o=Math.round(s.x*n)+"_"+Math.round(s.y*n)+"_"+Math.round(s.z*n);void 0===e[o]?(e[o]=t,i.push(this.vertices[t]),r[t]=i.length-1):r[t]=r[e[o]]}const s=[];for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t];e.a=r[e.a],e.b=r[e.b],e.c=r[e.c];const i=[e.a,e.b,e.c];for(let e=0;e<3;e++)if(i[e]===i[(e+1)%3]){s.push(t);break}}for(let t=s.length-1;t>=0;t--){const e=s[t];this.faces.splice(e,1);for(let t=0,i=this.faceVertexUvs.length;t<i;t++)this.faceVertexUvs[t].splice(e,1)}const o=this.vertices.length-i.length;return this.vertices=i,o}setFromPoints(t){this.vertices=[];for(let e=0,i=t.length;e<i;e++){const i=t[e];this.vertices.push(new me.Vector3(i.x,i.y,i.z||0))}return this}sortFacesByMaterialIndex(){const t=this.faces,e=t.length;for(let i=0;i<e;i++)t[i]._id=i;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));const i=this.faceVertexUvs[0],r=this.faceVertexUvs[1];let n,s;i&&i.length===e&&(n=[]),r&&r.length===e&&(s=[]);for(let o=0;o<e;o++){const e=t[o]._id;n&&n.push(i[e]),s&&s.push(r[e])}n&&(this.faceVertexUvs[0]=n),s&&(this.faceVertexUvs[1]=s)}toJSON(){const t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}const e=[];for(let t=0;t<this.vertices.length;t++){const i=this.vertices[t];e.push(i.x,i.y,i.z)}const i=[],r=[],n={},s=[],o={},a=[],l={};for(let t=0;t<this.faces.length;t++){const e=this.faces[t],r=!0,n=!1,s=void 0!==this.faceVertexUvs[0][t],o=e.normal.length()>0,a=e.vertexNormals.length>0,l=1!==e.color.r||1!==e.color.g||1!==e.color.b,p=e.vertexColors.length>0;let m=0;if(m=h(m,0,0),m=h(m,1,r),m=h(m,2,n),m=h(m,3,s),m=h(m,4,o),m=h(m,5,a),m=h(m,6,l),m=h(m,7,p),i.push(m),i.push(e.a,e.b,e.c),i.push(e.materialIndex),s){const e=this.faceVertexUvs[0][t];i.push(u(e[0]),u(e[1]),u(e[2]))}if(o&&i.push(c(e.normal)),a){const t=e.vertexNormals;i.push(c(t[0]),c(t[1]),c(t[2]))}if(l&&i.push(d(e.color)),p){const t=e.vertexColors;i.push(d(t[0]),d(t[1]),d(t[2]))}}function h(t,e,i){return i?t|1<<e:t&~(1<<e)}function c(t){const e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==n[e]||(n[e]=r.length/3,r.push(t.x,t.y,t.z)),n[e]}function d(t){const e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==o[e]||(o[e]=s.length,s.push(t.getHex())),o[e]}function u(t){const e=t.x.toString()+t.y.toString();return void 0!==l[e]||(l[e]=a.length/2,a.push(t.x,t.y)),l[e]}return t.data={},t.data.vertices=e,t.data.normals=r,s.length>0&&(t.data.colors=s),a.length>0&&(t.data.uvs=[a]),t.data.faces=i,t}clone(){return(new ye).copy(this)}copy(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;const e=t.vertices;for(let t=0,i=e.length;t<i;t++)this.vertices.push(e[t].clone());const i=t.colors;for(let t=0,e=i.length;t<e;t++)this.colors.push(i[t].clone());const r=t.faces;for(let t=0,e=r.length;t<e;t++)this.faces.push(r[t].clone());for(let e=0,i=t.faceVertexUvs.length;e<i;e++){const i=t.faceVertexUvs[e];void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]);for(let t=0,r=i.length;t<r;t++){const r=i[t],n=[];for(let t=0,e=r.length;t<e;t++){const e=r[t];n.push(e.clone())}this.faceVertexUvs[e].push(n)}}const n=t.morphTargets;for(let t=0,e=n.length;t<e;t++){const e={};if(e.name=n[t].name,void 0!==n[t].vertices){e.vertices=[];for(let i=0,r=n[t].vertices.length;i<r;i++)e.vertices.push(n[t].vertices[i].clone())}if(void 0!==n[t].normals){e.normals=[];for(let i=0,r=n[t].normals.length;i<r;i++)e.normals.push(n[t].normals[i].clone())}this.morphTargets.push(e)}const s=t.morphNormals;for(let t=0,e=s.length;t<e;t++){const e={};if(void 0!==s[t].vertexNormals){e.vertexNormals=[];for(let i=0,r=s[t].vertexNormals.length;i<r;i++){const r=s[t].vertexNormals[i],n={};n.a=r.a.clone(),n.b=r.b.clone(),n.c=r.c.clone(),e.vertexNormals.push(n)}}if(void 0!==s[t].faceNormals){e.faceNormals=[];for(let i=0,r=s[t].faceNormals.length;i<r;i++)e.faceNormals.push(s[t].faceNormals[i].clone())}this.morphNormals.push(e)}const o=t.skinWeights;for(let t=0,e=o.length;t<e;t++)this.skinWeights.push(o[t].clone());const a=t.skinIndices;for(let t=0,e=a.length;t<e;t++)this.skinIndices.push(a[t].clone());const l=t.lineDistances;for(let t=0,e=l.length;t<e;t++)this.lineDistances.push(l[t]);const h=t.boundingBox;null!==h&&(this.boundingBox=h.clone());const c=t.boundingSphere;return null!==c&&(this.boundingSphere=c.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}toBufferGeometry(){const t=(new we).fromGeometry(this),e=new me.BufferGeometry,i=new Float32Array(3*t.vertices.length);if(e.setAttribute("position",new me.BufferAttribute(i,3).copyVector3sArray(t.vertices)),t.normals.length>0){const i=new Float32Array(3*t.normals.length);e.setAttribute("normal",new me.BufferAttribute(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const i=new Float32Array(3*t.colors.length);e.setAttribute("color",new me.BufferAttribute(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const i=new Float32Array(2*t.uvs.length);e.setAttribute("uv",new me.BufferAttribute(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const i=new Float32Array(2*t.uvs2.length);e.setAttribute("uv2",new me.BufferAttribute(i,2).copyVector2sArray(t.uvs2))}e.groups=t.groups;for(const i in t.morphTargets){const r=[],n=t.morphTargets[i];for(let t=0,e=n.length;t<e;t++){const e=n[t],i=new me.Float32BufferAttribute(3*e.data.length,3);i.name=e.name,r.push(i.copyVector3sArray(e.data))}e.morphAttributes[i]=r}if(t.skinIndices.length>0){const i=new me.Float32BufferAttribute(4*t.skinIndices.length,4);e.setAttribute("skinIndex",i.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const i=new me.Float32BufferAttribute(4*t.skinWeights.length,4);e.setAttribute("skinWeight",i.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(e.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(e.boundingBox=t.boundingBox.clone()),e}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}applyMatrix(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(t){let e=new me.BufferGeometry;const i=t.geometry;if(t.isPoints||t.isLine){const t=new me.Float32BufferAttribute(3*i.vertices.length,3),r=new me.Float32BufferAttribute(3*i.colors.length,3);if(e.setAttribute("position",t.copyVector3sArray(i.vertices)),e.setAttribute("color",r.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length){const t=new me.Float32BufferAttribute(i.lineDistances.length,1);e.setAttribute("lineDistance",t.copyArray(i.lineDistances))}null!==i.boundingSphere&&(e.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(e.boundingBox=i.boundingBox.clone())}else t.isMesh&&(e=i.toBufferGeometry());return e}}ye.prototype.isGeometry=!0;class we{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(t){const e=[];let i,r,n;const s=t.faces;for(r=0;r<s.length;r++){const t=s[r];t.materialIndex!==n&&(n=t.materialIndex,void 0!==i&&(i.count=3*r-i.start,e.push(i)),i={start:3*r,materialIndex:n})}void 0!==i&&(i.count=3*r-i.start,e.push(i)),this.groups=e}fromGeometry(t){const e=t.faces,i=t.vertices,r=t.faceVertexUvs,n=r[0]&&r[0].length>0,s=r[1]&&r[1].length>0,o=t.morphTargets,a=o.length;let l;if(a>0){l=[];for(let t=0;t<a;t++)l[t]={name:o[t].name,data:[]};this.morphTargets.position=l}const h=t.morphNormals,c=h.length;let d;if(c>0){d=[];for(let t=0;t<c;t++)d[t]={name:h[t].name,data:[]};this.morphTargets.normal=d}const u=t.skinIndices,p=t.skinWeights,m=u.length===i.length,f=p.length===i.length;i.length>0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let t=0;t<e.length;t++){const g=e[t];this.vertices.push(i[g.a],i[g.b],i[g.c]);const v=g.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{const t=g.normal;this.normals.push(t,t,t)}const y=g.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{const t=g.color;this.colors.push(t,t,t)}if(!0===n){const e=r[0][t];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",t),this.uvs.push(new me.Vector2,new me.Vector2,new me.Vector2))}if(!0===s){const e=r[1][t];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",t),this.uvs2.push(new me.Vector2,new me.Vector2,new me.Vector2))}for(let t=0;t<a;t++){const e=o[t].vertices;l[t].data.push(e[g.a],e[g.b],e[g.c])}for(let e=0;e<c;e++){const i=h[e].vertexNormals[t];d[e].data.push(i.a,i.b,i.c)}m&&this.skinIndices.push(u[g.a],u[g.b],u[g.c]),f&&this.skinWeights.push(p[g.a],p[g.b],p[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}}class xe{constructor(t,e,i,r,n,s=0){this.a=t,this.b=e,this.c=i,this.normal=r&&r.isVector3?r:new me.Vector3,this.vertexNormals=Array.isArray(r)?r:[],this.color=n&&n.isColor?n:new me.Color,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=s}clone(){return(new this.constructor).copy(this)}copy(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}me.Face3=xe,me.Geometry=ye;const be=window.THREE;var _e,Ae,Se,Te,Ee,Pe;be.EventDispatcher.prototype.on=be.EventDispatcher.prototype.addEventListener,be.EventDispatcher.prototype.off=be.EventDispatcher.prototype.removeEventListener,be.EventDispatcher.prototype.hasEvent=function(t){return void 0!==this._listeners&&void 0!==this._listeners[t]},be.Layers.prototype.getChannel=function(){return this.mask?Math.log(this.mask)/Math.log(2):1},be.Mesh.prototype.raycastWithID=function(){var t=new be.Vector3,e=new be.Vector3,i=new be.Vector3,r=new be.Matrix4,n=new be.Ray;new be.Triangle;var s=new be.Vector3,o=new be.Vector3;return function(a,l){var h,c,d,u=this.geometry,p=u.attributes;if(r.copy(this.matrixWorld).invert(),n.copy(l.ray).applyMatrix4(r),null!==u.index)console.log("WARNING: raycastWithID does not support indexed vertices");else{var m=p.position,f=3*a;h=f,c=f+1,d=f+2,t.fromBufferAttribute(m,h),e.fromBufferAttribute(m,c),i.fromBufferAttribute(m,d)}var g=function(t,e,i,r,n,o,a){i.intersectTriangle(o,n,r,!1,a);var l=new be.Plane;if(l.setFromCoplanarPoints(r,n,o),null===i.intersectPlane(l,new be.Vector3))return null;s.copy(a),s.applyMatrix4(t.matrixWorld);var h=e.ray.origin.distanceTo(s);return h<e.near||h>e.far?null:{distance:h,point:s.clone(),object:t}}(this,l,n,t,e,i,o);if(null!==g){var v=new be.Face3(h,c,d);return be.Triangle.getNormal(t,e,i,v.normal),g.face=v,g.faceIndex=h,g}console.log("WARNING: intersectionPoint missing")}}(),be.Line.prototype.raycastWithID=(_e=new be.Matrix4,Ae=new be.Ray,Se=new be.Vector3,Te=new be.Vector3,Ee=new be.Vector3,Pe=new be.Vector3,function(t,e){_e.copy(this.matrixWorld).invert(),Ae.copy(e.ray).applyMatrix4(_e);var i=this.geometry;if(i instanceof be.BufferGeometry){var r=i.attributes;if(null===i.index){var n=r.position.array,s=6*t;Se.fromArray(n,s),Te.fromArray(n,s+3),Ae.distanceSqToSegment(Se,Te,Pe,Ee);var o=Ae.origin.distanceTo(Pe);if(o<e.near||o>e.far)return;return{distance:o,point:Ee.clone().applyMatrix4(this.matrixWorld),index:s,face:null,faceIndex:null,object:this}}console.log("WARNING: raycastWithID does not support indexed vertices")}}),be.Points.prototype.raycastWithID=function(){var t=new be.Matrix4,e=new be.Ray;return function(i,r){var n=this,s=n.geometry;t.copy(this.matrixWorld).invert(),e.copy(r.ray).applyMatrix4(t);var o=new be.Vector3,a=s.attributes.position.array;return o.fromArray(a,3*i),function(t,i){var s=e.distanceToPoint(t),o=e.closestPointToPoint(t);o.applyMatrix4(n.matrixWorld);var a=r.ray.origin.distanceTo(o);if(!(a<r.near||a>r.far))return{distance:a,distanceToRay:s,point:o.clone(),index:i,face:null,object:n}}(o,i)}}(),be.Color.prototype.copy=function(t){return t&&(this.r=t.r,this.g=t.g,this.b=t.b),this},be.Color.prototype.toHexString=function(){return"#"+this.getHexString().toUpperCase()},be.Line.prototype.updatePosition=function(t,e){var i=this.geometry.vertices;if(2==i.length){var r=i[0],n=i[1];r.equals(t)&&n.equals(e)||(r.x=t.x,r.y=t.y,r.z=t.z,n.x=e.x,n.y=e.y,n.z=e.z,this.geometry.boundingSphere=null,this.geometry.verticesNeedUpdate=!0,this.computeLineDistances())}},be.Vector3.prototype.toLogString=function(){return"x: "+this.x+", y: "+this.y+", z: "+this.z},be.Vector3.prototype.log=function(){console.log(this.toLogString())},be.Object3D.prototype.show=function(t){if(t)for(var e=this;e;)e.visible=!0,e=e.parent;else this.visible=t},be.Object3D.prototype.ensureVisible=function(t){if(void 0===t)return!!this.visible&&!!this.layers.mask;if(!Utils.isBoolean(t)){for(var e=this;e;){if(!e.visible)return!1;if(t&&!e.layers.test(t.layers))return!1;e=e.parent}return!0}var i=t;i?this.layers.set(0):this.layers.disable(0),this.visible=i},be.Euler.prototype.multiplyMatrix4=function(t){var e=new be.Quaternion;e.setFromEuler(this);var i=new be.Quaternion;i.setFromRotationMatrix(t),e.multiply(i),this.setFromQuaternion(e)},be.Quaternion.prototype.multiplyMatrix4=function(t){var e=new be.Quaternion;e.setFromRotationMatrix(t),this.multiply(e)},be.OrthographicCamera.prototype.resize=function(t,e){if(void 0!==this.userData){var i=this.userData.depth*this.userData.z,r=i*(t/e);this.left=-r/2,this.right=r/2,this.top=i/2,this.bottom=-i/2,this.updateProjectionMatrix()}},be.Mesh.prototype.verticesCount=function(){return this.geometry?this.geometry.isBufferGeometry?this.geometry.attributes.position.count:this.geometry.vertices.length:0},be.Mesh.prototype.getPerimeter=function(){var t=this.geometry.attributes.position;if(t.count<2)return 0;for(var e=0,i=new be.Vector2(t.getX(0),t.getZ(0)),r=1;r<t.count;r++){var n=new be.Vector2(t.getX(r),t.getZ(r));e+=n.distanceTo(i),i=n}return e+=i.distanceTo(new be.Vector2(t.getX(0),t.getZ(0)))},be.Mesh.prototype.getArea=function(){for(var t=this.geometry.attributes.position,e=[],i=0;i<t.count;i++){var r=new be.Vector2(t.getX(i),t.getZ(i));e.push(r)}var n=be.ShapeUtils.area(e);return Math.abs(n)},be.Mesh.prototype.getPoints=function(){var t=[],e=this.geometry.attributes;if(e)for(var i=e.position,r=0;r<i.count;r++)t.push([i.getX(r),i.getY(r),i.getZ(r)]);else{var n=this.geometry.vertices;if(n)for(r=0;r<n.length;r++){var s=n[r].clone();s.applyMatrix4(this.matrixWorld),t.push(s.toArray())}}return t},be.Mesh.prototype.getLabelPosition=function(t,e){var i=[];if(this.geometry.attributes)for(var r=this.geometry.attributes.position,n=0;n<r.count;n++)i.push([r.getX(n),r.getZ(n)]);else for(n=0;n<this.geometry.vertices.length;n++){var s=this.geometry.vertices[n];"xy"==e?i.push([s.x,s.y]):i.push([s.x,s.z])}if(!i.length)return null;var o=[];if(o.push(i),t&&0!=t.length)for(n=0;n<t.length;n++){var a=[t[n][0],t[n][1],t[n][2],t[n][3]];o.push(a)}var l,h=new polylabel(o);return l="xy"==e?this.localToWorld(new be.Vector3(h[0],h[1],0)):this.localToWorld(new be.Vector3(h[0],0,h[1])),this.getRayCastPosition(l)},be.Mesh.prototype.getAvaliableLabelPosition=function(t,e){this.updateMatrixWorld();var i=new be.Matrix4;i.copy(this.matrixWorld).invert();for(var r=[],n=[],s=0;s<t.length;s++){var o=t[s],a=o[0]/2,l=o[1]/2;if(0!=a&&0!=l){var h=this.getLabelPosition(n,e);if(!h)break;r.push(h),(h=h.clone()).applyMatrix4(i);var c=h.x,d="xy"==e?h.y:h.z,u=[c-a,d-l],p=[c+a,d-l],m=[c+a,d+l],f=[c-a,d+l];n.push([u,p,m,f])}}return r},be.Mesh.prototype.getRayCastPosition=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;this.updateMatrixWorld();var i=new be.Vector3,r=new be.Vector3(0,1,0),n=this.position.clone();i.copy(r).applyQuaternion(this.quaternion),n.add(i.multiplyScalar(e)),n.applyMatrix4(this.matrixWorld);var s=new be.Vector3,o=new be.Vector3(0,-1,0),a=this.position.clone();s.copy(o).applyQuaternion(this.quaternion),a.add(s.multiplyScalar(e)),a.applyMatrix4(this.matrixWorld);var l=new be.Vector3;l.subVectors(a,n),l.normalize();var h=t.clone();h.add(l.clone().multiplyScalar(-e));var c=new be.Raycaster;c.ray.origin.copy(h),c.ray.direction.copy(l);var d=c.intersectObjectForcible(this.parent,!0);return d.length?d[0].point:null},be.Box3.prototype.setFromVisibleObject=function(t){this.makeEmpty(),t.updateMatrixWorld(!0);var e=new be.Vector3,i=this;return t.traverseVisible((function(t){if(!t.isLight&&!t.userData.skipBoundingBox){var r=t.geometry;if(void 0!==r)if(r.isGeometry)for(var n=r.vertices,s=0,o=n.length;s<o;s++)e.copy(n[s]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e);else if(r.isBufferGeometry){var a=r.attributes.position;if(void 0!==a)for(s=0,o=a.count;s<o;s++)e.fromBufferAttribute(a,s).applyMatrix4(t.matrixWorld),i.expandByPoint(e)}}})),this},be.AnimationMixer.prototype.isRunning=function(){for(var t=this._actions,e=this._nActiveActions,i=0;i!==e;++i){if(t[i].isRunning())return!0}return!1},be.AnimationMixer.prototype.log=function(){for(var t=this.stats,e=0;e<this._actions.length;e++){var i=this._actions[e],r=i.getClip(),n=i.getEffectiveWeight();0!=n&&console.log("action: [name: "+r.name+", weight: "+n+"]")}console.log("action: "+t.actions.inUse+"/"+t.actions.total),console.log("bindings: "+t.bindings.inUse+"/"+t.bindings.total),console.log("controlInterpolants: "+t.controlInterpolants.inUse+"/"+t.controlInterpolants.total)};class Me{constructor(t){this.prefix="all",this.setExps(t)}isAll(){const t=this.exps;return null==t||0===t.length||1===t.length&&"all"===t[0]}setExps(t){let e=[];t&&W(t)&&(Q(t[0])&&vt(["all","any","none"],t[0])>=0&&(W(t[1])||1===t.length)?(this.prefix=t[0],e=t.slice(1)):e=t),e[0]||(e=null),e&&(e=W(e[0])?e:[e]),this.exps=e&&this._validateExps(e)?e:[]}_validateExps(t){const e=["!=","==","<","<=",">",">=","has","!has","!in","in","like","startWith"];let i=!0;return t.forEach((r=>{vt(e,r[0])<0&&(console.log(t),console.warn("过滤器参数错误: ",r,", 过滤器第一位为运算符, 仅包括: "+e),i=!1)})),i}setPrefix(t){this.prefix=t||"all"}add(t,e,i){this.exps.push([t,e,i])}toArray(){return[this.prefix].concat(this.exps)}validate(t){const e=this.prefix,i=this.exps;let r=[];return i.forEach((e=>{const i=e[0],n=e[1],s=function(t){let e=null;if(W(t))switch(t[0]){case"has":case"!has":e=null;break;case"in":case"!in":e=t.slice(2);break;case"!=":case"==":case">":case">=":case"<":case"<=":case"like":case"startWith":case"endWith":e=t[2]}return e}(e);r.push(function(t,e,i,r){if(!t||tt(t))return!1;const n=t[e];switch(i){case"has":return void 0!==n;case"!has":return void 0===n;case"in":return vt(r,n)>=0;case"!in":return vt(r,n)<0;case"!=":return n!==r;case"==":return n===r;case">":return n>r;case">=":return n>=r;case"<":return n<r;case"<=":return n<=r;case"like":return(n||"").toLowerCase().indexOf(r.toLowerCase())>=0;case"startWith":return 0==(n||"").toLowerCase().indexOf(r.toLowerCase())}return!1}(t,n,i,s))})),"all"===e?r.filter((t=>t)).length===r.length:"any"===e?r.filter((t=>t)).length>=1:"none"===e?r.filter((t=>!t)).length===r.length:void 0}}const Ce=/^[og]\s*(.+)?/,Le=/^mtllib /,Re=/^usemtl /,Oe=/^usemap /,Fe=new be.Vector3,Ne=new be.Vector3,De=new be.Vector3,Ie=new be.Vector3,Ue=new be.Vector3;function Be(){const t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);const i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){const i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);const r={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){const e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){const e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(let t=this.materials.length-1;t>=0;t--)this.materials[t].groupCount<=0&&this.materials.splice(t,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){const t=i.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){const i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){const i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){const i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){const r=this.vertices,n=this.object.geometry.vertices;n.push(r[t+0],r[t+1],r[t+2]),n.push(r[e+0],r[e+1],r[e+2]),n.push(r[i+0],r[i+1],r[i+2])},addVertexPoint:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){const r=this.normals,n=this.object.geometry.normals;n.push(r[t+0],r[t+1],r[t+2]),n.push(r[e+0],r[e+1],r[e+2]),n.push(r[i+0],r[i+1],r[i+2])},addFaceNormal:function(t,e,i){const r=this.vertices,n=this.object.geometry.normals;Fe.fromArray(r,t),Ne.fromArray(r,e),De.fromArray(r,i),Ue.subVectors(De,Ne),Ie.subVectors(Fe,Ne),Ue.cross(Ie),Ue.normalize(),n.push(Ue.x,Ue.y,Ue.z),n.push(Ue.x,Ue.y,Ue.z),n.push(Ue.x,Ue.y,Ue.z)},addColor:function(t,e,i){const r=this.colors,n=this.object.geometry.colors;void 0!==r[t]&&n.push(r[t+0],r[t+1],r[t+2]),void 0!==r[e]&&n.push(r[e+0],r[e+1],r[e+2]),void 0!==r[i]&&n.push(r[i+0],r[i+1],r[i+2])},addUV:function(t,e,i){const r=this.uvs,n=this.object.geometry.uvs;n.push(r[t+0],r[t+1]),n.push(r[e+0],r[e+1]),n.push(r[i+0],r[i+1])},addDefaultUV:function(){const t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,r,n,s,o,a,l){const h=this.vertices.length;let c=this.parseVertexIndex(t,h),d=this.parseVertexIndex(e,h),u=this.parseVertexIndex(i,h);if(this.addVertex(c,d,u),this.addColor(c,d,u),void 0!==o&&""!==o){const t=this.normals.length;c=this.parseNormalIndex(o,t),d=this.parseNormalIndex(a,t),u=this.parseNormalIndex(l,t),this.addNormal(c,d,u)}else this.addFaceNormal(c,d,u);if(void 0!==r&&""!==r){const t=this.uvs.length;c=this.parseUVIndex(r,t),d=this.parseUVIndex(n,t),u=this.parseUVIndex(s,t),this.addUV(c,d,u),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";const e=this.vertices.length;for(let i=0,r=t.length;i<r;i++){const r=this.parseVertexIndex(t[i],e);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";const i=this.vertices.length,r=this.uvs.length;for(let e=0,r=t.length;e<r;e++)this.addVertexLine(this.parseVertexIndex(t[e],i));for(let t=0,i=e.length;t<i;t++)this.addUVLine(this.parseUVIndex(e[t],r))}};return t.startObject("",!1),t}class ke extends be.Loader{constructor(t){super(t),this.materials=null}load(t,e,i,r){const n=this,s=new be.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){try{e(n.parse(i))}catch(e){r?r(e):console.error(e),n.manager.itemError(t)}}),i,r)}setMaterials(t){return this.materials=t,this}parse(t){const e=new Be;-1!==t.indexOf("\r\n")&&(t=t.replace(/\r\n/g,"\n")),-1!==t.indexOf("\\\n")&&(t=t.replace(/\\\n/g,""));const i=t.split("\n");let r="",n="",s=0,o=[];const a="function"==typeof"".trimLeft;for(let t=0,l=i.length;t<l;t++)if(r=i[t],r=a?r.trimLeft():r.trim(),s=r.length,0!==s&&(n=r.charAt(0),"#"!==n))if("v"===n){const t=r.split(/\s+/);switch(t[0]){case"v":e.vertices.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),t.length>=7?e.colors.push(parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]));break;case"vt":e.uvs.push(parseFloat(t[1]),parseFloat(t[2]))}}else if("f"===n){const t=r.substr(1).trim().split(/\s+/),i=[];for(let e=0,r=t.length;e<r;e++){const r=t[e];if(r.length>0){const t=r.split("/");i.push(t)}}const n=i[0];for(let t=1,r=i.length-1;t<r;t++){const r=i[t],s=i[t+1];e.addFace(n[0],r[0],s[0],n[1],r[1],s[1],n[2],r[2],s[2])}}else if("l"===n){const t=r.substring(1).trim().split(" ");let i=[];const n=[];if(-1===r.indexOf("/"))i=t;else for(let e=0,r=t.length;e<r;e++){const r=t[e].split("/");""!==r[0]&&i.push(r[0]),""!==r[1]&&n.push(r[1])}e.addLineGeometry(i,n)}else if("p"===n){const t=r.substr(1).trim().split(" ");e.addPointGeometry(t)}else if(null!==(o=Ce.exec(r))){const t=(" "+o[0].substr(1).trim()).substr(1);e.startObject(t)}else if(Re.test(r))e.object.startMaterial(r.substring(7).trim(),e.materialLibraries);else if(Le.test(r))e.materialLibraries.push(r.substring(7).trim());else if(Oe.test(r))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===n){if(o=r.split(" "),o.length>1){const t=o[1].trim().toLowerCase();e.object.smooth="0"!==t&&"off"!==t}else e.object.smooth=!0;const t=e.object.currentMaterial();t&&(t.smooth=e.object.smooth)}else{if("\0"===r)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+r+'"')}e.finalize();const l=new be.Group;l.materialLibraries=[].concat(e.materialLibraries);if(!0===!(1===e.objects.length&&0===e.objects[0].geometry.vertices.length))for(let t=0,i=e.objects.length;t<i;t++){const i=e.objects[t],r=i.geometry,n=i.materials,s="Line"===r.type,o="Points"===r.type;let a=!1;if(0===r.vertices.length)continue;const h=new be.BufferGeometry;h.setAttribute("position",new be.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&h.setAttribute("normal",new be.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(a=!0,h.setAttribute("color",new be.Float32BufferAttribute(r.colors,3))),!0===r.hasUVIndices&&h.setAttribute("uv",new be.Float32BufferAttribute(r.uvs,2));const c=[];for(let t=0,i=n.length;t<i;t++){const i=n[t],r=i.name+"_"+i.smooth+"_"+a;let l=e.materials[r];if(null!==this.materials)if(l=this.materials.create(i.name),!s||!l||l instanceof be.LineBasicMaterial){if(o&&l&&!(l instanceof be.PointsMaterial)){const t=new be.PointsMaterial({size:10,sizeAttenuation:!1});be.Material.prototype.copy.call(t,l),t.color.copy(l.color),t.map=l.map,l=t}}else{const t=new be.LineBasicMaterial;be.Material.prototype.copy.call(t,l),t.color.copy(l.color),l=t}void 0===l&&(l=s?new be.LineBasicMaterial:o?new be.PointsMaterial({size:1,sizeAttenuation:!1}):new be.MeshPhongMaterial,l.name=i.name,l.flatShading=!i.smooth,l.vertexColors=a,e.materials[r]=l),c.push(l)}let d;if(c.length>1){for(let t=0,e=n.length;t<e;t++){const e=n[t];h.addGroup(e.groupStart,e.groupCount,t)}d=s?new be.LineSegments(h,c):o?new be.Points(h,c):new be.Mesh(h,c)}else d=s?new be.LineSegments(h,c[0]):o?new be.Points(h,c[0]):new be.Mesh(h,c[0]);d.name=i.name,l.add(d)}else if(e.vertices.length>0){const t=new be.PointsMaterial({size:1,sizeAttenuation:!1}),i=new be.BufferGeometry;i.setAttribute("position",new be.Float32BufferAttribute(e.vertices,3)),e.colors.length>0&&void 0!==e.colors[0]&&(i.setAttribute("color",new be.Float32BufferAttribute(e.colors,3)),t.vertexColors=!0);const r=new be.Points(i,t);l.add(r)}return l}}class je extends be.Loader{constructor(t){super(t)}load(t,e,i,r){const n=this,s=""===this.path?be.LoaderUtils.extractUrlBase(t):this.path,o=new be.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(i){try{e(n.parse(i,s))}catch(e){r?r(e):console.error(e),n.manager.itemError(t)}}),i,r)}setMaterialOptions(t){return this.materialOptions=t,this}parse(t,e){const i=t.split("\n");let r={};const n=/\s+/,s={};for(let t=0;t<i.length;t++){let e=i[t];if(e=e.trim(),0===e.length||"#"===e.charAt(0))continue;const o=e.indexOf(" ");let a=o>=0?e.substring(0,o):e;a=a.toLowerCase();let l=o>=0?e.substring(o+1):"";if(l=l.trim(),"newmtl"===a)r={name:l},s[l]=r;else if("ka"===a||"kd"===a||"ks"===a||"ke"===a){const t=l.split(n,3);r[a]=[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}else r[a]=l}const o=new Ve(this.resourcePath||e,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(s),o}}class Ve{constructor(t="",e={}){this.baseUrl=t,this.options=e,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:be.FrontSide,this.wrap=void 0!==this.options.wrap?this.options.wrap:be.RepeatWrapping}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;const e={};for(const i in t){const r=t[i],n={};e[i]=n;for(const t in r){let e=!0,i=r[t];const s=t.toLowerCase();switch(s){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(i=[i[0]/255,i[1]/255,i[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===i[0]&&0===i[1]&&0===i[2]&&(e=!1)}e&&(n[s]=i)}}return e}preload(){for(const t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(const e in this.materialsInfo)this.materialsArray[t]=this.create(e),this.nameLookup[e]=t,t++;return this.materialsArray}create(t){return void 0===this.materials[t]&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){const e=this,i=this.materialsInfo[t],r={name:t,side:this.side};function n(t,n){if(r[t])return;const s=e.getTextureParams(n,r),o=e.loadTexture((a=e.baseUrl,"string"!=typeof(l=s.url)||""===l?"":/^https?:\/\//i.test(l)?l:a+l),null,(function(t){const e=t.image;e&&(wt(e.width)&&wt(e.height)?(t.wrapS=be.RepeatWrapping,t.wrapT=be.RepeatWrapping,t.minFilter=be.LinearMipmapLinearFilter):(t.wrapS=be.ClampToEdgeWrapping,t.wrapT=be.ClampToEdgeWrapping,t.minFilter=be.LinearFilter,t.magFilter=be.LinearFilter),t.needsUpdate=!0,i.loaded=!0)}));var a,l;o.repeat.copy(s.scale),o.offset.copy(s.offset),o.wrapS=e.wrap,o.wrapT=e.wrap,"map"!==t&&"emissiveMap"!==t||(o.encoding=be.sRGBEncoding),r[t]=o}for(const t in i){const e=i[t];let s;if(""!==e)switch(t.toLowerCase()){case"kd":r.color=(new be.Color).fromArray(e).convertSRGBToLinear();break;case"ks":r.specular=(new be.Color).fromArray(e).convertSRGBToLinear();break;case"ke":r.emissive=(new be.Color).fromArray(e).convertSRGBToLinear();break;case"map_kd":n("map",e);break;case"map_ks":n("specularMap",e);break;case"map_ke":n("emissiveMap",e);break;case"norm":n("normalMap",e);break;case"map_bump":case"bump":n("bumpMap",e);break;case"map_d":n("alphaMap",e),r.transparent=!0;break;case"ns":r.shininess=parseFloat(e);break;case"d":s=parseFloat(e),s<1&&(r.opacity=s,r.transparent=!0);break;case"tr":s=parseFloat(e),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(r.opacity=1-s,r.transparent=!0)}}return this.materials[t]=new be.MeshPhongMaterial(r),this.materials[t]}getTextureParams(t,e){const i={scale:new be.Vector2(1,1),offset:new be.Vector2(0,0)},r=t.split(/\s+/);let n;return n=r.indexOf("-bm"),n>=0&&(e.bumpScale=parseFloat(r[n+1]),r.splice(n,2)),n=r.indexOf("-s"),n>=0&&(i.scale.set(parseFloat(r[n+1]),parseFloat(r[n+2])),r.splice(n,4)),n=r.indexOf("-o"),n>=0&&(i.offset.set(parseFloat(r[n+1]),parseFloat(r[n+2])),r.splice(n,4)),i.url=r.join(" ").trim(),i}loadTexture(t,e,i,r,n){const s=void 0!==this.manager?this.manager:be.DefaultLoadingManager;let o=s.getHandler(t);null===o&&(o=new be.TextureLoader(s)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const a=o.load(t,i,r,n);return void 0!==e&&(a.mapping=e),a}}const ze=new be.Vector3,Ge=new be.Quaternion,He=new be.Vector3;class Xe extends be.Object3D{constructor(t=document.createElement("div")){super(),this.element=t,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this}}Xe.prototype.isCSS3DObject=!0;class We extends Xe{constructor(t){super(t),this.rotation2D=0}copy(t,e){return super.copy(t,e),this.rotation2D=t.rotation2D,this}}We.prototype.isCSS3DSprite=!0;const Ye=new be.Matrix4,Qe=new be.Matrix4;class Je{constructor(t={}){const e=this;let i,r,n,s;const o={camera:{fov:0,style:""},objects:new WeakMap},a=void 0!==t.element?t.element:document.createElement("div");a.style.overflow="hidden",this.domElement=a;const l=document.createElement("div");function h(t){return Math.abs(t)<1e-10?0:t}function c(t){const e=t.elements;return"matrix3d("+h(e[0])+","+h(-e[1])+","+h(e[2])+","+h(e[3])+","+h(e[4])+","+h(-e[5])+","+h(e[6])+","+h(e[7])+","+h(e[8])+","+h(-e[9])+","+h(e[10])+","+h(e[11])+","+h(e[12])+","+h(-e[13])+","+h(e[14])+","+h(e[15])+")"}function d(t){const e=t.elements;return"translate(-50%,-50%)"+("matrix3d("+h(e[0])+","+h(e[1])+","+h(e[2])+","+h(e[3])+","+h(-e[4])+","+h(-e[5])+","+h(-e[6])+","+h(-e[7])+","+h(e[8])+","+h(e[9])+","+h(e[10])+","+h(e[11])+","+h(e[12])+","+h(e[13])+","+h(e[14])+","+h(e[15])+")")}function u(t,i,r,n){if(t.isCSS3DObject){const n=!0===t.visible&&!0===t.layers.test(r.layers);if(t.element.style.display=!0===n?"":"none",!0===n){let n;t.onBeforeRender(e,i,r),t.isCSS3DSprite?(Ye.copy(r.matrixWorldInverse),Ye.transpose(),0!==t.rotation2D&&Ye.multiply(Qe.makeRotationZ(t.rotation2D)),t.matrixWorld.decompose(ze,Ge,He),Ye.setPosition(ze),Ye.scale(He),Ye.elements[3]=0,Ye.elements[7]=0,Ye.elements[11]=0,Ye.elements[15]=1,n=d(Ye)):n=d(t.matrixWorld);const s=t.element,a=o.objects.get(t);if(void 0===a||a.style!==n){s.style.transform=n;const e={style:n};o.objects.set(t,e)}s.parentNode!==l&&l.appendChild(s),t.onAfterRender(e,i,r)}}for(let e=0,n=t.children.length;e<n;e++)u(t.children[e],i,r)}l.style.transformStyle="preserve-3d",l.style.pointerEvents="none",a.appendChild(l),this.getSize=function(){return{width:i,height:r}},this.render=function(t,e){const i=e.projectionMatrix.elements[5]*s;let r,d;o.camera.fov!==i&&(a.style.perspective=e.isPerspectiveCamera?i+"px":"",o.camera.fov=i),!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.isOrthographicCamera&&(r=-(e.right+e.left)/2,d=(e.top+e.bottom)/2);const p=(e.isOrthographicCamera?"scale("+i+")translate("+h(r)+"px,"+h(d)+"px)"+c(e.matrixWorldInverse):"translateZ("+i+"px)"+c(e.matrixWorldInverse))+"translate("+n+"px,"+s+"px)";o.camera.style!==p&&(l.style.transform=p,o.camera.style=p),u(t,t,e)},this.setSize=function(t,e){i=t,r=e,n=i/2,s=r/2,a.style.width=t+"px",a.style.height=e+"px",l.style.width=t+"px",l.style.height=e+"px"}}}const Ze={};function qe(t){return t&&t.name&&t.name.indexOf("vaps_unaffected_object_")>=0}function Ke({obj:t,mtl:e,path:i,loadedCallback:r,errorCallback:n,progressCallback:s,loadingManager:o}){if(!t)return;const a=i||At(t)+"/"||"",l=new ke(o),h=()=>{l.load(a+t,r,s,n)};if(e){const t=new je(o);t.setPath(a),t.load(e,(t=>{h(),l.setMaterials(t)}),null,(()=>{n()}))}else h()}function $e(t,e){if(t){if(t.isVector2)return t;if(W(t)){var i=Number(t[0]),r=t.length>1?Number(t[1]):0;return new be.Vector2(i,r)}return Q(t)?(t.split(","),null):t}return e||new be.Vector2}function ti(t,e){if(t){if(t.isVector3)return t;if(q(t)&&void 0!==t.x&&void 0!==t.y&&void 0!==t.y)return new be.Vector3(t.x,t.y,t.z);if(W(t))return 1===t.length?new be.Vector3(Number(t[0]),0,0):2===t.length?new be.Vector3(Number(t[0]),0,Number(t[1])):new be.Vector3(Number(t[0]),Number(t[1]),Number(t[2]));if(Q(t)){for(var i=t.split(/,| /),r=0;r<i.length;r++)$(i[r])&&i.splice(r--,1),i[r]=Number(i[r]);return ti(i,e)}}return e}function ei(t){if(t.isEuler)return t;if(W(t)){(t.length<3||t.length>4)&&console.log("parseEuler not impl");var e=Math.degToRad(t[0]%360),i=Math.degToRad(t[1]%360),r=Math.degToRad(t[2]%360);if(3==t.length)return new be.Euler(e,i,r);if(4==t.length)return new be.Euler(e,i,r,t[3])}else{if(t instanceof be.Quaternion){var n=new be.Euler;return n.setFromQuaternion(t),n}console.log("parseEuler not impl")}}function ii(t){var e=ei(t),i=new be.Quaternion;return i.setFromEuler(e),i}function ri(t){return t instanceof be.Euler?[be.Math.radToDeg(t._x),be.Math.radToDeg(t._y),be.Math.radToDeg(t._z)]:t instanceof be.Quaternion?ri((new be.Euler).setFromQuaternion(t)):t}function ni(t,e){return t?Q(t)?new be.Color(t):(t.isColor,t):new be.Color.set(e||"rgb(0, 0, 0)")}function si(t,e,i){return new Ze.HtmlMixer.Plane(t,e,{elementW:i.domWidth,elementH:i.domHeight,planeW:i.planeWidth,planeH:i.planeHeight})}function oi(t){return!!t&&(t.isScene||t.isMesh||t.isSprite||t.isPoints||t.isLine||t.isImmediateRenderObject)}function ai(t){let e=t.parent;if(!e)return t;for(;e.parent;)e=e.parent;return e}function li(t,e){for(var i=[];t.parent;){var r=t.parent,n=getChildIndex(r,t);if(-1==n)break;if(i.push(n),r==e)break;t=r}return i}function hi(t){if(t){t.computeFaceNormals(),t.computeVertexNormals(),t.computeBoundingBox();for(var e=t.boundingBox.max,i=t.boundingBox.min,r=new be.Vector2(0-i.x,0-i.y),n=new be.Vector2(e.x-i.x,e.y-i.y),s=t.faces,o=[],a=0;a<s.length;a++){var l=t.vertices[s[a].a],h=t.vertices[s[a].b],c=t.vertices[s[a].c],d=new be.Vector2((l.x+r.x)/n.x,(l.y+r.y)/n.y),u=new be.Vector2((h.x+r.x)/n.x,(h.y+r.y)/n.y),p=new be.Vector2((c.x+r.x)/n.x,(c.y+r.y)/n.y);o.push([d,u,p])}for(a=0;a<t.faceVertexUvs.length;a++)t.faceVertexUvs[a]=o.concat();t.uvsNeedUpdate=!0,t.elementsNeedUpdate=!0}}function ci(t,e,i){let r=t.distanceTo(e);return t.lerp(e,i/r)}function di(t,e){const{faces:i}=t,r=[],n=[],s=[];for(var o=0;o<i.length;o++){var a=i[o];r.push(t.vertices[a.a],t.vertices[a.b],t.vertices[a.c]);var l=a.vertexNormals;if(3===l.length)n.push(l[0],l[1],l[2]);else{var h=a.normal;n.push(h,h,h)}var c=a.vertexColors;if(3===c.length)s.push(c[0],c[1],c[2]);else{var d=a.color;s.push(d,d,d)}}var u=new Float32Array(3*r.length);if(e.setAttribute("position",new be.BufferAttribute(u,3).copyVector3sArray(r)),n.length>0){var p=new Float32Array(3*n.length);e.setAttribute("normal",new be.BufferAttribute(p,3).copyVector3sArray(n))}if(s.length>0){var m=new Float32Array(3*s.length);e.setAttribute("color",new be.BufferAttribute(m,3).copyColorsArray(s))}}Ze.HtmlMixer=Ze.HtmlMixer||{},Ze.HtmlMixer.Context=function(t,e,i){var r=[];this.update=function(){r.forEach((function(t){t()}))};var n=1e3;this.cssFactor=n;var s=new Je;this.rendererCss=s,this.rendererWebgl=t;var o=new be.PerspectiveCamera(i.fov,i.aspect,i.near*n,i.far*n);r.push((function(){o.quaternion.copy(i.quaternion),o.position.copy(i.position).multiplyScalar(n)}));var a=new be.Scene;this.cssScene=a,this.autoUpdateObjects=!0,r.push(function(){!0===this.autoUpdateObjects&&a.traverse((function(t){if(t instanceof be.Scene!=!0){var e=t.userData.mixerPlane;void 0!==e&&e.update()}}))}.bind(this)),r.push((function(t,e){s.render(a,o)}))},Ze.HtmlMixer.Plane=function(t,e,i){(i=i||{}).elementW=i.elementW||768,i.planeW=i.planeW||1,i.planeH=i.planeH||3/4,i.object3d=i.object3d||null,this.domElement=e;var r=[];this.update=function(){r.forEach((function(t){t()}))};var n=i.planeW,s=i.planeH,o=null;if(null===i.object3d){const t=void 0!==i.side?i.side:be.DoubleSide;var a=new be.MeshBasicMaterial({opacity:0,color:new be.Color("black"),blending:be.NoBlending,side:t}),l=new be.PlaneGeometry(i.planeW,i.planeH);o=new be.Mesh(l,a)}else o=i.object3d;this.object3d=o;var h=s/n,c=i.elementW,d=i.elementH||c*h;function u(){e.style.width=c+"px",e.style.height=d+"px"}this.setDomElement=function(t){var i=e;i.parentNode&&i.parentNode.removeChild(i),this.domElement=e=t,p.element=e,u()},u();var p=new Xe(e);this.cssObject=p,p.scale.set(1,1,1).multiplyScalar(t.cssFactor/(c/n)),p.userData.mixerPlane=this,o.addEventListener("added",(function(e){t.cssScene.add(p)})),o.addEventListener("removed",(function(e){t.cssScene.remove(p)})),r.push((function(){o.updateMatrixWorld();var e=o.matrixWorld,i=new be.Vector3,r=new be.Vector3,n=new be.Quaternion;e.decompose(i,n,r),p.quaternion.copy(n),p.position.copy(i).multiplyScalar(t.cssFactor);var s=c/(o.geometry.parameters.width*r.x);p.scale.set(1,1,1).multiplyScalar(t.cssFactor/s)}))};class ui extends be.EventDispatcher{once(t,e){this._listeners||(this._listeners={}),e._once=!0,be.EventDispatcher.prototype.addEventListener.call(this,t,e)}on(t,e){this._listeners||(this._listeners={}),be.EventDispatcher.prototype.addEventListener.call(this,t,e)}dispatchEvent(t){if(this._listeners||(this._listeners={}),void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;var i=e.slice(0);let s=null;for(var r=0,n=i.length;r<n;r++)i[r]._pause||i[r].call(this,t),i[r]._once&&(s=i[r]);s&&this.removeEventListener(t.type,s)}}}removeEventListener(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var r=i.indexOf(e);-1!==r&&i.splice(r,1),0===i.length&&delete this._listeners[t]}}}hasEvent(t){return void 0!==this._listeners&&void 0!==this._listeners[t]}resumeEvent(t,e){this._listeners||(this._listeners={});var i=this._listeners[t];if(i)if(e)for(let t=0,r=i.length;t<r;t++)e&&i[t]===e&&delete i[t]._pause;else for(let t=0,e=i.length;t<e;t++)delete i[t]._pause}pauseEvent(t,e){this._listeners||(this._listeners={});var i=this._listeners[t];if(i)if(e)for(let t=0,r=i.length;t<r;t++)e&&i[t]===e&&(i[t]._pause=!0);else for(let t=0,e=i.length;t<e;t++)i[t]._pause=!0}}function pi(t){if(!t||!t.prototype)return;["dispatchEvent","removeEventListener","fire","off","pauseEvent","resumeEvent","hasEvent","on","once"].forEach((function(e){t.prototype[e]||(ui.prototype[e]?t.prototype[e]=ui.prototype[e]:ui.__proto__[e]&&(t.prototype[e]=ui.__proto__[e]))}))}ui.prototype.fire=ui.prototype.dispatchEvent,ui.prototype.off=ui.prototype.removeEventListener;class mi extends be.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new xi(t)})),this.register((function(t){return new Ei(t)})),this.register((function(t){return new Pi(t)})),this.register((function(t){return new bi(t)})),this.register((function(t){return new _i(t)})),this.register((function(t){return new Ai(t)})),this.register((function(t){return new Si(t)})),this.register((function(t){return new wi(t)})),this.register((function(t){return new Ti(t)})),this.register((function(t){return new vi(t)})),this.register((function(t){return new Mi(t)}))}load(t,e,i,r){const n=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:be.LoaderUtils.extractUrlBase(t),this.manager.itemStart(t);const o=function(e){r?r(e):console.error(e),n.manager.itemError(t),n.manager.itemEnd(t)},a=new be.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,(function(i){try{n.parse(i,s,(function(i){e(i),n.manager.itemEnd(t)}),o)}catch(t){o(t)}}),i,o)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this}unregister(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,r){let n;const s={},o={};if("string"==typeof t)n=t;else{if(be.LoaderUtils.decodeText(new Uint8Array(t,0,4))===Ci){try{s[gi.KHR_BINARY_GLTF]=new Oi(t)}catch(t){return void(r&&r(t))}n=s[gi.KHR_BINARY_GLTF].content}else n=be.LoaderUtils.decodeText(new Uint8Array(t))}const a=JSON.parse(n);if(void 0===a.asset||a.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new cr(a,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t<this.pluginCallbacks.length;t++){const e=this.pluginCallbacks[t](l);o[e.name]=e,s[e.name]=!0}if(a.extensionsUsed)for(let t=0;t<a.extensionsUsed.length;++t){const e=a.extensionsUsed[t],i=a.extensionsRequired||[];switch(e){case gi.KHR_MATERIALS_UNLIT:s[e]=new yi;break;case gi.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:s[e]=new Ii;break;case gi.KHR_DRACO_MESH_COMPRESSION:s[e]=new Fi(a,this.dracoLoader);break;case gi.KHR_TEXTURE_TRANSFORM:s[e]=new Ni;break;case gi.KHR_MESH_QUANTIZATION:s[e]=new Ui;break;default:i.indexOf(e)>=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(i,r)}parseAsync(t,e){const i=this;return new Promise((function(r,n){i.parse(t,e,r,n)}))}}function fi(){let t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const gi={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class vi{constructor(t){this.parser=t,this.name=gi.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,r=e.length;i<r;i++){const r=e[i];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&t._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let r=e.cache.get(i);if(r)return r;const n=e.json,s=((n.extensions&&n.extensions[this.name]||{}).lights||[])[t];let o;const a=new be.Color(16777215);void 0!==s.color&&a.fromArray(s.color);const l=void 0!==s.range?s.range:0;switch(s.type){case"directional":o=new be.DirectionalLight(a),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new be.PointLight(a),o.distance=l;break;case"spot":o=new be.SpotLight(a),o.distance=l,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,o.angle=s.spot.outerConeAngle,o.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return o.position.set(0,0,0),o.decay=2,void 0!==s.intensity&&(o.intensity=s.intensity),o.name=e.createUniqueName(s.name||"light_"+t),r=Promise.resolve(o),e.cache.add(i,r),r}createNodeAttachment(t){const e=this,i=this.parser,r=i.json.nodes[t],n=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===n?null:this._loadLight(n).then((function(t){return i._getNodeRef(e.cache,n,t)}))}}class yi{constructor(){this.name=gi.KHR_MATERIALS_UNLIT}getMaterialType(){return be.MeshBasicMaterial}extendParams(t,e,i){const r=[];t.color=new be.Color(1,1,1),t.opacity=1;const n=e.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;t.color.fromArray(e),t.opacity=e[3]}void 0!==n.baseColorTexture&&r.push(i.assignTexture(t,"map",n.baseColorTexture,be.sRGBEncoding))}return Promise.all(r)}}class wi{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const i=this.parser.json.materials[t];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=i.extensions[this.name].emissiveStrength;return void 0!==r&&(e.emissiveIntensity=r),Promise.resolve()}}class xi{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?be.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(e.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&n.push(i.assignTexture(e,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(e.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&n.push(i.assignTexture(e,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(n.push(i.assignTexture(e,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const t=s.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new be.Vector2(t,t)}return Promise.all(n)}}class bi{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_SHEEN}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?be.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=[];e.sheenColor=new be.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const s=r.extensions[this.name];return void 0!==s.sheenColorFactor&&e.sheenColor.fromArray(s.sheenColorFactor),void 0!==s.sheenRoughnessFactor&&(e.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&n.push(i.assignTexture(e,"sheenColorMap",s.sheenColorTexture,be.sRGBEncoding)),void 0!==s.sheenRoughnessTexture&&n.push(i.assignTexture(e,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(n)}}class _i{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?be.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=[],s=r.extensions[this.name];return void 0!==s.transmissionFactor&&(e.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&n.push(i.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(n)}}class Ai{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_VOLUME}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?be.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=[],s=r.extensions[this.name];e.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&n.push(i.assignTexture(e,"thicknessMap",s.thicknessTexture)),e.attenuationDistance=s.attenuationDistance||0;const o=s.attenuationColor||[1,1,1];return e.attenuationColor=new be.Color(o[0],o[1],o[2]),Promise.all(n)}}class Si{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_IOR}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?be.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser.json.materials[t];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const r=i.extensions[this.name];return e.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class Ti{constructor(t){this.parser=t,this.name=gi.KHR_MATERIALS_SPECULAR}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?be.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const n=[],s=r.extensions[this.name];e.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&n.push(i.assignTexture(e,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return e.specularColor=new be.Color(o[0],o[1],o[2]),void 0!==s.specularColorTexture&&n.push(i.assignTexture(e,"specularColorMap",s.specularColorTexture,be.sRGBEncoding)),Promise.all(n)}}class Ei{constructor(t){this.parser=t,this.name=gi.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,r=i.textures[t];if(!r.extensions||!r.extensions[this.name])return null;const n=r.extensions[this.name],s=e.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,n.source,s)}}class Pi{constructor(t){this.parser=t,this.name=gi.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,r=i.json,n=r.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=r.images[s.source];let a=i.textureLoader;if(o.uri){const t=i.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return i.loadTextureImage(t,s.source,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class Mi{constructor(t){this.name=gi.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const t=i.extensions[this.name],r=this.parser.getDependency("buffer",t.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,n.ready]).then((function(e){const i=t.byteOffset||0,r=t.byteLength||0,s=t.count,o=t.byteStride,a=new ArrayBuffer(s*o),l=new Uint8Array(e[0],i,r);return n.decodeGltfBuffer(new Uint8Array(a),s,o,l,t.mode,t.filter),a}))}return null}}const Ci="glTF",Li=1313821514,Ri=5130562;class Oi{constructor(t){this.name=gi.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,12);if(this.header={magic:be.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Ci)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-12,r=new DataView(t,12);let n=0;for(;n<i;){const e=r.getUint32(n,!0);n+=4;const i=r.getUint32(n,!0);if(n+=4,i===Li){const i=new Uint8Array(t,12+n,e);this.content=be.LoaderUtils.decodeText(i)}else if(i===Ri){const i=12+n;this.body=t.slice(i,i+e)}n+=e}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Fi{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=gi.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,r=this.dracoLoader,n=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,o={},a={},l={};for(const t in s){const e=Ki[t]||t.toLowerCase();o[e]=s[t]}for(const e in t.attributes){const r=Ki[e]||e.toLowerCase();if(void 0!==s[e]){const n=i.accessors[t.attributes[e]],s=Qi[n.componentType];l[r]=s,a[r]=!0===n.normalized}}return e.getDependency("bufferView",n).then((function(t){return new Promise((function(e){r.decodeDracoFile(t,(function(t){for(const e in t.attributes){const i=t.attributes[e],r=a[e];void 0!==r&&(i.normalized=r)}e(t)}),o,l)}))}))}}class Ni{constructor(){this.name=gi.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===e.offset&&void 0===e.rotation&&void 0===e.scale||(t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Di extends be.MeshStandardMaterial{constructor(t){super(),this.isGLTFSpecularGlossinessMaterial=!0;const e=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),i=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),n=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),o={specular:{value:(new be.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(t){for(const e in o)t.uniforms[e]=o[e];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",e).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",n).replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(t){o.specular.value=t}},specularMap:{get:function(){return o.specularMap.value},set:function(t){o.specularMap.value=t,t?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(t){o.glossiness.value=t}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(t){o.glossinessMap.value=t,t?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}copy(t){return super.copy(t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class Ii{constructor(){this.name=gi.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return Di}extendParams(t,e,i){const r=e.extensions[this.name];t.color=new be.Color(1,1,1),t.opacity=1;const n=[];if(Array.isArray(r.diffuseFactor)){const e=r.diffuseFactor;t.color.fromArray(e),t.opacity=e[3]}if(void 0!==r.diffuseTexture&&n.push(i.assignTexture(t,"map",r.diffuseTexture,be.sRGBEncoding)),t.emissive=new be.Color(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new be.Color(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const e=r.specularGlossinessTexture;n.push(i.assignTexture(t,"glossinessMap",e)),n.push(i.assignTexture(t,"specularMap",e,be.sRGBEncoding))}return Promise.all(n)}createMaterial(t){const e=new Di(t);return e.fog=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=void 0===t.emissiveIntensity?1:t.emissiveIntensity,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalMapType=be.TangentSpaceNormalMap,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e}}class Ui{constructor(){this.name=gi.KHR_MESH_QUANTIZATION}}class Bi extends be.Interpolant{constructor(t,e,i,r){super(t,e,i,r)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=t*r*3+r;for(let t=0;t!==r;t++)e[t]=i[n+t];return e}}Bi.prototype.beforeStart_=Bi.prototype.copySampleValue_,Bi.prototype.afterEnd_=Bi.prototype.copySampleValue_,Bi.prototype.interpolate_=function(t,e,i,r){const n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,l=3*o,h=r-e,c=(i-e)/h,d=c*c,u=d*c,p=t*l,m=p-l,f=-2*u+3*d,g=u-d,v=1-f,y=g-d+c;for(let t=0;t!==o;t++){const e=s[m+t+o],i=s[m+t+a]*h,r=s[p+t+o],l=s[p+t]*h;n[t]=v*e+y*i+f*r+g*l}return n};const ki=new be.Quaternion;class ji extends Bi{interpolate_(t,e,i,r){const n=super.interpolate_(t,e,i,r);return ki.fromArray(n).normalize().toArray(n),n}}const Vi=0,zi=1,Gi=2,Hi=3,Xi=4,Wi=5,Yi=6,Qi={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Ji={9728:be.NearestFilter,9729:be.LinearFilter,9984:be.NearestMipmapNearestFilter,9985:be.LinearMipmapNearestFilter,9986:be.NearestMipmapLinearFilter,9987:be.LinearMipmapLinearFilter},Zi={33071:be.ClampToEdgeWrapping,33648:be.MirroredRepeatWrapping,10497:be.RepeatWrapping},qi={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ki={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},$i={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},tr={CUBICSPLINE:void 0,LINEAR:be.InterpolateLinear,STEP:be.InterpolateDiscrete},er="OPAQUE",ir="MASK",rr="BLEND";function nr(t,e,i){for(const r in i.extensions)void 0===t[r]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[r]=i.extensions[r])}function sr(t,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function or(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(let i=0,r=e.weights.length;i<r;i++)t.morphTargetInfluences[i]=e.weights[i];if(e.extras&&Array.isArray(e.extras.targetNames)){const i=e.extras.targetNames;if(t.morphTargetInfluences.length===i.length){t.morphTargetDictionary={};for(let e=0,r=i.length;e<r;e++)t.morphTargetDictionary[i[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function ar(t){const e=t.extensions&&t.extensions[gi.KHR_DRACO_MESH_COMPRESSION];let i;return i=e?"draco:"+e.bufferView+":"+e.indices+":"+lr(e.attributes):t.indices+":"+lr(t.attributes)+":"+t.mode,i}function lr(t){let e="";const i=Object.keys(t).sort();for(let r=0,n=i.length;r<n;r++)e+=i[r]+":"+t[i[r]]+";";return e}function hr(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class cr{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new fi,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const i=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=navigator.userAgent.indexOf("Firefox")>-1,n=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||i||r&&n<98?this.textureLoader=new be.TextureLoader(this.options.manager):this.textureLoader=new be.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new be.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,r=this.json,n=this.extensions;this.cache.removeAll(),this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])})).then((function(e){const s={scene:e[0][r.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:r.asset,parser:i,userData:{}};nr(n,s,r),sr(s,r),Promise.all(i._invokeAll((function(t){return t.afterRoot&&t.afterRoot(s)}))).then((function(){t(s)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let i=0,r=e.length;i<r;i++){const r=e[i].joints;for(let e=0,i=r.length;e<i;e++)t[r[e]].isBone=!0}for(let e=0,r=t.length;e<r;e++){const r=t[e];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(i[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(t,e){void 0!==e&&(void 0===t.refs[e]&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const r=i.clone(),n=(t,e)=>{const i=this.associations.get(t);null!=i&&this.associations.set(e,i);for(const[i,r]of t.children.entries())n(r,e.children[i])};return n(i,r),r.name+="_instance_"+t.uses[e]++,r}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const r=t(e[i]);if(r)return r}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let r=0;r<e.length;r++){const n=t(e[r]);n&&i.push(n)}return i}getDependency(t,e){const i=t+":"+e;let r=this.cache.get(i);if(!r){switch(t){case"scene":r=this.loadScene(e);break;case"node":r=this.loadNode(e);break;case"mesh":r=this._invokeOne((function(t){return t.loadMesh&&t.loadMesh(e)}));break;case"accessor":r=this.loadAccessor(e);break;case"bufferView":r=this._invokeOne((function(t){return t.loadBufferView&&t.loadBufferView(e)}));break;case"buffer":r=this.loadBuffer(e);break;case"material":r=this._invokeOne((function(t){return t.loadMaterial&&t.loadMaterial(e)}));break;case"texture":r=this._invokeOne((function(t){return t.loadTexture&&t.loadTexture(e)}));break;case"skin":r=this.loadSkin(e);break;case"animation":r=this._invokeOne((function(t){return t.loadAnimation&&t.loadAnimation(e)}));break;case"camera":r=this.loadCamera(e);break;default:throw new Error("Unknown type: "+t)}this.cache.add(i,r)}return r}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,r=this.json[t+("mesh"===t?"es":"s")]||[];e=Promise.all(r.map((function(e,r){return i.getDependency(t,r)}))),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[gi.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(t,n){i.load(be.LoaderUtils.resolveURL(e.uri,r.path),t,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))}))}))}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then((function(t){const i=e.byteLength||0,r=e.byteOffset||0;return t.slice(r,r+i)}))}loadAccessor(t){const e=this,i=this.json,r=this.json.accessors[t];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const n=[];return void 0!==r.bufferView?n.push(this.getDependency("bufferView",r.bufferView)):n.push(null),void 0!==r.sparse&&(n.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(n).then((function(t){const n=t[0],s=qi[r.type],o=Qi[r.componentType],a=o.BYTES_PER_ELEMENT,l=a*s,h=r.byteOffset||0,c=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let u,p;if(c&&c!==l){const t=Math.floor(h/c),i="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+t+":"+r.count;let l=e.cache.get(i);l||(u=new o(n,t*c,r.count*c/a),l=new be.InterleavedBuffer(u,c/a),e.cache.add(i,l)),p=new be.InterleavedBufferAttribute(l,s,h%c/a,d)}else u=null===n?new o(r.count*s):new o(n,h,r.count*s),p=new be.BufferAttribute(u,s,d);if(void 0!==r.sparse){const e=qi.SCALAR,i=Qi[r.sparse.indices.componentType],a=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,h=new i(t[1],a,r.sparse.count*e),c=new o(t[2],l,r.sparse.count*s);null!==n&&(p=new be.BufferAttribute(p.array.slice(),p.itemSize,p.normalized));for(let t=0,e=h.length;t<e;t++){const e=h[t];if(p.setX(e,c[t*s]),s>=2&&p.setY(e,c[t*s+1]),s>=3&&p.setZ(e,c[t*s+2]),s>=4&&p.setW(e,c[t*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse THREE.BufferAttribute.")}}return p}))}loadTexture(t){const e=this.json,i=this.options,r=e.textures[t].source,n=e.images[r];let s=this.textureLoader;if(n.uri){const t=i.manager.getHandler(n.uri);null!==t&&(s=t)}return this.loadTextureImage(t,r,s)}loadTextureImage(t,e,i){const r=this,n=this.json,s=n.textures[t],o=n.images[e],a=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(e,i).then((function(e){e.flipY=!1,s.name&&(e.name=s.name);const i=(n.samplers||{})[s.sampler]||{};return e.magFilter=Ji[i.magFilter]||be.LinearFilter,e.minFilter=Ji[i.minFilter]||be.LinearMipmapLinearFilter,e.wrapS=Zi[i.wrapS]||be.RepeatWrapping,e.wrapT=Zi[i.wrapT]||be.RepeatWrapping,r.associations.set(e,{textures:t}),e})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(t,e){const i=this,r=this.json,n=this.options;if(void 0!==this.sourceCache[t])return this.sourceCache[t].then((t=>t.clone()));const s=r.images[t],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=i.getDependency("bufferView",s.bufferView).then((function(t){l=!0;const e=new Blob([t],{type:s.mimeType});return a=o.createObjectURL(e),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const h=Promise.resolve(a).then((function(t){return new Promise((function(i,r){let s=i;!0===e.isImageBitmapLoader&&(s=function(t){const e=new be.Texture(t);e.needsUpdate=!0,i(e)}),e.load(be.LoaderUtils.resolveURL(t,n.path),s,void 0,r)}))})).then((function(t){var e;return!0===l&&o.revokeObjectURL(a),t.userData.mimeType=s.mimeType||((e=s.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),t})).catch((function(t){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),t}));return this.sourceCache[t]=h,h}assignTexture(t,e,i,r){const n=this;return this.getDependency("texture",i.index).then((function(s){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===e&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+e+" not yet supported."),n.extensions[gi.KHR_TEXTURE_TRANSFORM]){const t=void 0!==i.extensions?i.extensions[gi.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=n.associations.get(s);s=n.extensions[gi.KHR_TEXTURE_TRANSFORM].extendTexture(s,t),n.associations.set(s,e)}}return void 0!==r&&(s.encoding=r),t[e]=s,s}))}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const r=void 0===e.attributes.tangent,n=void 0!==e.attributes.color,s=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+i.uuid;let e=this.cache.get(t);e||(e=new be.PointsMaterial,be.Material.prototype.copy.call(e,i),e.color.copy(i.color),e.map=i.map,e.sizeAttenuation=!1,this.cache.add(t,e)),i=e}else if(t.isLine){const t="LineBasicMaterial:"+i.uuid;let e=this.cache.get(t);e||(e=new be.LineBasicMaterial,be.Material.prototype.copy.call(e,i),e.color.copy(i.color),this.cache.add(t,e)),i=e}if(r||n||s){let t="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(t+="specular-glossiness:"),r&&(t+="derivative-tangents:"),n&&(t+="vertex-colors:"),s&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=i.clone(),n&&(e.vertexColors=!0),s&&(e.flatShading=!0),r&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(i))),i=e}i.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=i}getMaterialType(){return be.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,r=this.extensions,n=i.materials[t];let s;const o={},a=n.extensions||{},l=[];if(a[gi.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const t=r[gi.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];s=t.getMaterialType(),l.push(t.extendParams(o,n,e))}else if(a[gi.KHR_MATERIALS_UNLIT]){const t=r[gi.KHR_MATERIALS_UNLIT];s=t.getMaterialType(),l.push(t.extendParams(o,n,e))}else{const i=n.pbrMetallicRoughness||{};if(o.color=new be.Color(1,1,1),o.opacity=1,Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;o.color.fromArray(t),o.opacity=t[3]}void 0!==i.baseColorTexture&&l.push(e.assignTexture(o,"map",i.baseColorTexture,be.sRGBEncoding)),o.metalness=void 0!==i.metallicFactor?i.metallicFactor:1,o.roughness=void 0!==i.roughnessFactor?i.roughnessFactor:1,void 0!==i.metallicRoughnessTexture&&(l.push(e.assignTexture(o,"metalnessMap",i.metallicRoughnessTexture)),l.push(e.assignTexture(o,"roughnessMap",i.metallicRoughnessTexture))),s=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),l.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,o)}))))}!0===n.doubleSided&&(o.side=be.DoubleSide);const h=n.alphaMode||er;if(h===rr?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,h===ir&&(o.alphaTest=void 0!==n.alphaCutoff?n.alphaCutoff:.5)),void 0!==n.normalTexture&&s!==be.MeshBasicMaterial&&(l.push(e.assignTexture(o,"normalMap",n.normalTexture)),o.normalScale=new be.Vector2(1,1),void 0!==n.normalTexture.scale)){const t=n.normalTexture.scale;o.normalScale.set(t,t)}return void 0!==n.occlusionTexture&&s!==be.MeshBasicMaterial&&(l.push(e.assignTexture(o,"aoMap",n.occlusionTexture)),void 0!==n.occlusionTexture.strength&&(o.aoMapIntensity=n.occlusionTexture.strength)),void 0!==n.emissiveFactor&&s!==be.MeshBasicMaterial&&(o.emissive=(new be.Color).fromArray(n.emissiveFactor)),void 0!==n.emissiveTexture&&s!==be.MeshBasicMaterial&&l.push(e.assignTexture(o,"emissiveMap",n.emissiveTexture,be.sRGBEncoding)),Promise.all(l).then((function(){let i;return i=s===Di?r[gi.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new s(o),n.name&&(i.name=n.name),sr(i,n),e.associations.set(i,{materials:t}),n.extensions&&nr(r,i,n),i}))}createUniqueName(t){const e=be.PropertyBinding.sanitizeNodeName(t||"");let i=e;for(let t=1;this.nodeNamesUsed[i];++t)i=e+"_"+t;return this.nodeNamesUsed[i]=!0,i}loadGeometries(t){const e=this,i=this.extensions,r=this.primitiveCache;function n(t){return i[gi.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return ur(i,t,e)}))}const s=[];for(let i=0,o=t.length;i<o;i++){const o=t[i],a=ar(o),l=r[a];if(l)s.push(l.promise);else{let t;t=o.extensions&&o.extensions[gi.KHR_DRACO_MESH_COMPRESSION]?n(o):ur(new be.BufferGeometry,o,e),r[a]={primitive:o,promise:t},s.push(t)}}return Promise.all(s)}loadMesh(t){const e=this,i=this.json,r=this.extensions,n=i.meshes[t],s=n.primitives,o=[];for(let t=0,e=s.length;t<e;t++){const e=void 0===s[t].material?(void 0===(a=this.cache).DefaultMaterial&&(a.DefaultMaterial=new be.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:be.FrontSide})),a.DefaultMaterial):this.getDependency("material",s[t].material);o.push(e)}var a;return o.push(e.loadGeometries(s)),Promise.all(o).then((function(i){const o=i.slice(0,i.length-1),a=i[i.length-1],l=[];for(let i=0,h=a.length;i<h;i++){const h=a[i],c=s[i];let d;const u=o[i];if(c.mode===Xi||c.mode===Wi||c.mode===Yi||void 0===c.mode)d=!0===n.isSkinnedMesh?new be.SkinnedMesh(h,u):new be.Mesh(h,u),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),c.mode===Wi?d.geometry=pr(d.geometry,be.TriangleStripDrawMode):c.mode===Yi&&(d.geometry=pr(d.geometry,be.TriangleFanDrawMode));else if(c.mode===zi)d=new be.LineSegments(h,u);else if(c.mode===Hi)d=new be.Line(h,u);else if(c.mode===Gi)d=new be.LineLoop(h,u);else{if(c.mode!==Vi)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);d=new be.Points(h,u)}Object.keys(d.geometry.morphAttributes).length>0&&or(d,n),d.name=e.createUniqueName(n.name||"mesh_"+t),sr(d,n),c.extensions&&nr(r,d,c),e.assignFinalMaterial(d),l.push(d)}for(let i=0,r=l.length;i<r;i++)e.associations.set(l[i],{meshes:t,primitives:i});if(1===l.length)return l[0];const h=new be.Group;e.associations.set(h,{meshes:t});for(let t=0,e=l.length;t<e;t++)h.add(l[t]);return h}))}loadCamera(t){let e;const i=this.json.cameras[t],r=i[i.type];if(r)return"perspective"===i.type?e=new be.PerspectiveCamera(be.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.type&&(e=new be.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),sr(e,i),Promise.resolve(e);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(t){const e=this.json.skins[t],i={joints:e.joints};return void 0===e.inverseBindMatrices?Promise.resolve(i):this.getDependency("accessor",e.inverseBindMatrices).then((function(t){return i.inverseBindMatrices=t,i}))}loadAnimation(t){const e=this.json.animations[t],i=[],r=[],n=[],s=[],o=[];for(let t=0,a=e.channels.length;t<a;t++){const a=e.channels[t],l=e.samplers[a.sampler],h=a.target,c=void 0!==h.node?h.node:h.id,d=void 0!==e.parameters?e.parameters[l.input]:l.input,u=void 0!==e.parameters?e.parameters[l.output]:l.output;i.push(this.getDependency("node",c)),r.push(this.getDependency("accessor",d)),n.push(this.getDependency("accessor",u)),s.push(l),o.push(h)}return Promise.all([Promise.all(i),Promise.all(r),Promise.all(n),Promise.all(s),Promise.all(o)]).then((function(i){const r=i[0],n=i[1],s=i[2],o=i[3],a=i[4],l=[];for(let t=0,e=r.length;t<e;t++){const e=r[t],i=n[t],h=s[t],c=o[t],d=a[t];if(void 0===e)continue;let u;switch(e.updateMatrix(),e.matrixAutoUpdate=!0,$i[d.path]){case $i.weights:u=be.NumberKeyframeTrack;break;case $i.rotation:u=be.QuaternionKeyframeTrack;break;default:u=be.VectorKeyframeTrack}const p=e.name?e.name:e.uuid,m=void 0!==c.interpolation?tr[c.interpolation]:be.InterpolateLinear,f=[];$i[d.path]===$i.weights?e.traverse((function(t){t.morphTargetInfluences&&f.push(t.name?t.name:t.uuid)})):f.push(p);let g=h.array;if(h.normalized){const t=hr(g.constructor),e=new Float32Array(g.length);for(let i=0,r=g.length;i<r;i++)e[i]=g[i]*t;g=e}for(let t=0,e=f.length;t<e;t++){const e=new u(f[t]+"."+$i[d.path],i.array,g,m);"CUBICSPLINE"===c.interpolation&&(e.createInterpolant=function(t){return new(this instanceof be.QuaternionKeyframeTrack?ji:Bi)(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(e)}}const h=e.name?e.name:"animation_"+t;return new be.AnimationClip(h,void 0,l)}))}createNodeMesh(t){const e=this.json,i=this,r=e.nodes[t];return void 0===r.mesh?null:i.getDependency("mesh",r.mesh).then((function(t){const e=i._getNodeRef(i.meshCache,r.mesh,t);return void 0!==r.weights&&e.traverse((function(t){if(t.isMesh)for(let e=0,i=r.weights.length;e<i;e++)t.morphTargetInfluences[e]=r.weights[e]})),e}))}loadNode(t){const e=this.json,i=this.extensions,r=this,n=e.nodes[t],s=n.name?r.createUniqueName(n.name):"";return function(){const e=[],i=r._invokeOne((function(e){return e.createNodeMesh&&e.createNodeMesh(t)}));return i&&e.push(i),void 0!==n.camera&&e.push(r.getDependency("camera",n.camera).then((function(t){return r._getNodeRef(r.cameraCache,n.camera,t)}))),r._invokeAll((function(e){return e.createNodeAttachment&&e.createNodeAttachment(t)})).forEach((function(t){e.push(t)})),Promise.all(e)}().then((function(e){let o;if(o=!0===n.isBone?new be.Bone:e.length>1?new be.Group:1===e.length?e[0]:new be.Object3D,o!==e[0])for(let t=0,i=e.length;t<i;t++)o.add(e[t]);if(n.name&&(o.userData.name=n.name,o.name=s),sr(o,n),n.extensions&&nr(i,o,n),void 0!==n.matrix){const t=new be.Matrix4;t.fromArray(n.matrix),o.applyMatrix4(t)}else void 0!==n.translation&&o.position.fromArray(n.translation),void 0!==n.rotation&&o.quaternion.fromArray(n.rotation),void 0!==n.scale&&o.scale.fromArray(n.scale);return r.associations.has(o)||r.associations.set(o,{}),r.associations.get(o).nodes=t,o}))}loadScene(t){const e=this.json,i=this.extensions,r=this.json.scenes[t],n=this,s=new be.Group;r.name&&(s.name=n.createUniqueName(r.name)),sr(s,r),r.extensions&&nr(i,s,r);const o=r.nodes||[],a=[];for(let t=0,i=o.length;t<i;t++)a.push(dr(o[t],s,e,n));return Promise.all(a).then((function(){return n.associations=(t=>{const e=new Map;for(const[t,i]of n.associations)(t instanceof be.Material||t instanceof be.Texture)&&e.set(t,i);return t.traverse((t=>{const i=n.associations.get(t);null!=i&&e.set(t,i)})),e})(s),s}))}}function dr(t,e,i,r){const n=i.nodes[t];return r.getDependency("node",t).then((function(t){if(void 0===n.skin)return t;let e;return r.getDependency("skin",n.skin).then((function(t){e=t;const i=[];for(let t=0,n=e.joints.length;t<n;t++)i.push(r.getDependency("node",e.joints[t]));return Promise.all(i)})).then((function(i){return t.traverse((function(t){if(!t.isMesh)return;const r=[],n=[];for(let t=0,s=i.length;t<s;t++){const s=i[t];if(s){r.push(s);const i=new be.Matrix4;void 0!==e.inverseBindMatrices&&i.fromArray(e.inverseBindMatrices.array,16*t),n.push(i)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[t])}t.bind(new be.Skeleton(r,n),t.matrixWorld)})),t}))})).then((function(t){e.add(t);const s=[];if(n.children){const e=n.children;for(let n=0,o=e.length;n<o;n++){const o=e[n];s.push(dr(o,t,i,r))}}return Promise.all(s)}))}function ur(t,e,i){const r=e.attributes,n=[];function s(e,r){return i.getDependency("accessor",e).then((function(e){t.setAttribute(r,e)}))}for(const e in r){const i=Ki[e]||e.toLowerCase();i in t.attributes||n.push(s(r[e],i))}if(void 0!==e.indices&&!t.index){const r=i.getDependency("accessor",e.indices).then((function(e){t.setIndex(e)}));n.push(r)}return sr(t,e),function(t,e,i){const r=e.attributes,n=new be.Box3;if(void 0===r.POSITION)return;{const t=i.json.accessors[r.POSITION],e=t.min,s=t.max;if(void 0===e||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(n.set(new be.Vector3(e[0],e[1],e[2]),new be.Vector3(s[0],s[1],s[2])),t.normalized){const e=hr(Qi[t.componentType]);n.min.multiplyScalar(e),n.max.multiplyScalar(e)}}const s=e.targets;if(void 0!==s){const t=new be.Vector3,e=new be.Vector3;for(let r=0,n=s.length;r<n;r++){const n=s[r];if(void 0!==n.POSITION){const r=i.json.accessors[n.POSITION],s=r.min,o=r.max;if(void 0!==s&&void 0!==o){if(e.setX(Math.max(Math.abs(s[0]),Math.abs(o[0]))),e.setY(Math.max(Math.abs(s[1]),Math.abs(o[1]))),e.setZ(Math.max(Math.abs(s[2]),Math.abs(o[2]))),r.normalized){const t=hr(Qi[r.componentType]);e.multiplyScalar(t)}t.max(e)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(t)}t.boundingBox=n;const o=new be.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,t.boundingSphere=o}(t,e,i),Promise.all(n).then((function(){return void 0!==e.targets?function(t,e,i){let r=!1,n=!1,s=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t];if(void 0!==i.POSITION&&(r=!0),void 0!==i.NORMAL&&(n=!0),void 0!==i.COLOR_0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(t);const o=[],a=[],l=[];for(let h=0,c=e.length;h<c;h++){const c=e[h];if(r){const e=void 0!==c.POSITION?i.getDependency("accessor",c.POSITION):t.attributes.position;o.push(e)}if(n){const e=void 0!==c.NORMAL?i.getDependency("accessor",c.NORMAL):t.attributes.normal;a.push(e)}if(s){const e=void 0!==c.COLOR_0?i.getDependency("accessor",c.COLOR_0):t.attributes.color;l.push(e)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then((function(e){const i=e[0],o=e[1],a=e[2];return r&&(t.morphAttributes.position=i),n&&(t.morphAttributes.normal=o),s&&(t.morphAttributes.color=a),t.morphTargetsRelative=!0,t}))}(t,e.targets,i):t}))}function pr(t,e){let i=t.getIndex();if(null===i){const e=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),i=t.getIndex()}const r=i.count-2,n=[];if(e===be.TriangleFanDrawMode)for(let t=1;t<=r;t++)n.push(i.getX(0)),n.push(i.getX(t)),n.push(i.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(n.push(i.getX(t)),n.push(i.getX(t+1)),n.push(i.getX(t+2))):(n.push(i.getX(t+2)),n.push(i.getX(t+1)),n.push(i.getX(t)));n.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=t.clone();return s.setIndex(n),s}const mr=new WeakMap;class fr extends be.Loader{constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,i,r){const n=new be.FileLoader(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(t,(t=>{const i={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(t,i).then(e).catch(r)}),i,r)}decodeDracoFile(t,e,i,r){const n={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(t,n).then(e)}decodeGeometry(t,e){for(const t in e.attributeTypes){const i=e.attributeTypes[t];void 0!==i.BYTES_PER_ELEMENT&&(e.attributeTypes[t]=i.name)}const i=JSON.stringify(e);if(mr.has(t)){const e=mr.get(t);if(e.key===i)return e.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const n=this.workerNextTaskID++,s=t.byteLength,o=this._getWorker(n,s).then((i=>(r=i,new Promise(((i,s)=>{r._callbacks[n]={resolve:i,reject:s},r.postMessage({type:"decode",id:n,taskConfig:e,buffer:t},[t])}))))).then((t=>this._createGeometry(t.geometry)));return o.catch((()=>!0)).then((()=>{r&&n&&this._releaseTask(r,n)})),mr.set(t,{key:i,promise:o}),o}_createGeometry(t){const e=new be.BufferGeometry;t.index&&e.setIndex(new be.BufferAttribute(t.index.array,1));for(let i=0;i<t.attributes.length;i++){const r=t.attributes[i],n=r.name,s=r.array,o=r.itemSize;e.setAttribute(n,new be.BufferAttribute(s,o))}return e}_loadLibrary(t,e){const i=new be.FileLoader(this.manager);return i.setPath(this.decoderPath),i.setResponseType(e),i.setWithCredentials(this.withCredentials),new Promise(((e,r)=>{i.load(t,e,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const i=e[0];t||(this.decoderConfig.wasmBinary=e[1]);const r=gr.toString(),n=["/* draco decoder */",i,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(t,e){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const t=new Worker(this.workerSourceURL);t._callbacks={},t._taskCosts={},t._taskLoad=0,t.postMessage({type:"init",decoderConfig:this.decoderConfig}),t.onmessage=function(e){const i=e.data;switch(i.type){case"decode":t._callbacks[i.id].resolve(i);break;case"error":t._callbacks[i.id].reject(i);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+i.type+'"')}},this.workerPool.push(t)}else this.workerPool.sort((function(t,e){return t._taskLoad>e._taskLoad?-1:1}));const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[t]=e,i._taskLoad+=e,i}))}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((t=>t._taskLoad)))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this}}function gr(){let t,e;function i(t,e,i,r,n,s){const o=s.num_components(),a=i.num_points()*o,l=a*n.BYTES_PER_ELEMENT,h=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32}}(t,n),c=t._malloc(l);e.GetAttributeDataArrayForAllPoints(i,s,h,l,c);const d=new n(t.HEAPF32.buffer,c,a).slice();return t._free(c),{name:r,array:d,itemSize:o}}onmessage=function(r){const n=r.data;switch(n.type){case"init":t=n.decoderConfig,e=new Promise((function(e){t.onModuleLoaded=function(t){e({draco:t})},DracoDecoderModule(t)}));break;case"decode":const r=n.buffer,s=n.taskConfig;e.then((t=>{const e=t.draco,o=new e.Decoder,a=new e.DecoderBuffer;a.Init(new Int8Array(r),r.byteLength);try{const t=function(t,e,r,n){const s=n.attributeIDs,o=n.attributeTypes;let a,l;const h=e.GetEncodedGeometryType(r);if(h===t.TRIANGULAR_MESH)a=new t.Mesh,l=e.DecodeBufferToMesh(r,a);else{if(h!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new t.PointCloud,l=e.DecodeBufferToPointCloud(r,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const c={index:null,attributes:[]};for(const r in s){const l=self[o[r]];let h,d;if(n.useUniqueIDs)d=s[r],h=e.GetAttributeByUniqueId(a,d);else{if(d=e.GetAttributeId(a,t[s[r]]),-1===d)continue;h=e.GetAttribute(a,d)}c.attributes.push(i(t,e,a,r,l,h))}h===t.TRIANGULAR_MESH&&(c.index=function(t,e,i){const r=3*i.num_faces(),n=4*r,s=t._malloc(n);e.GetTrianglesUInt32Array(i,n,s);const o=new Uint32Array(t.HEAPF32.buffer,s,r).slice();return t._free(s),{array:o,itemSize:1}}(t,e,a));return t.destroy(a),c}(e,o,a,s),r=t.attributes.map((t=>t.array.buffer));t.index&&r.push(t.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:t},r)}catch(t){console.error(t),self.postMessage({type:"error",id:n.id,error:t.message})}finally{e.destroy(a),e.destroy(o)}}))}}}var vr={},yr=Uint8Array,wr=Uint16Array,xr=Uint32Array,br=new yr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_r=new yr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ar=new yr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Sr=function(t,e){for(var i=new wr(31),r=0;r<31;++r)i[r]=e+=1<<t[r-1];var n=new xr(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)n[s]=s-i[r]<<5|r;return[i,n]},Tr=Sr(br,2),Er=Tr[0],Pr=Tr[1];Er[28]=258,Pr[258]=28;for(var Mr=Sr(_r,0),Cr=Mr[0],Lr=Mr[1],Rr=new wr(32768),Or=0;Or<32768;++Or){var Fr=(43690&Or)>>>1|(21845&Or)<<1;Fr=(61680&(Fr=(52428&Fr)>>>2|(13107&Fr)<<2))>>>4|(3855&Fr)<<4,Rr[Or]=((65280&Fr)>>>8|(255&Fr)<<8)>>>1}var Nr=function(t,e,i){for(var r=t.length,n=0,s=new wr(e);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new wr(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new wr(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var h=n<<4|t[n],c=e-t[n],d=a[t[n]-1]++<<c,u=d|(1<<c)-1;d<=u;++d)o[Rr[d]>>>l]=h}else for(o=new wr(r),n=0;n<r;++n)t[n]&&(o[n]=Rr[a[t[n]-1]++]>>>15-t[n]);return o},Dr=new yr(288);for(Or=0;Or<144;++Or)Dr[Or]=8;for(Or=144;Or<256;++Or)Dr[Or]=9;for(Or=256;Or<280;++Or)Dr[Or]=7;for(Or=280;Or<288;++Or)Dr[Or]=8;var Ir=new yr(32);for(Or=0;Or<32;++Or)Ir[Or]=5;var Ur=Nr(Dr,9,0),Br=Nr(Dr,9,1),kr=Nr(Ir,5,0),jr=Nr(Ir,5,1),Vr=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},zr=function(t,e,i){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&i},Gr=function(t,e){var i=e/8|0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>(7&e)},Hr=function(t){return(t+7)/8|0},Xr=function(t,e,i){(null==e||e<0)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(2==t.BYTES_PER_ELEMENT?wr:4==t.BYTES_PER_ELEMENT?xr:yr)(i-e);return r.set(t.subarray(e,i)),r},Wr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Yr=function(t,e,i){var r=new Error(e||Wr[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Yr),!i)throw r;return r},Qr=function(t,e,i){var r=t.length;if(!r||i&&i.f&&!i.l)return e||new yr(0);var n=!e||i,s=!i||i.i;i||(i={}),e||(e=new yr(3*r));var o=function(t){var i=e.length;if(t>i){var r=new yr(Math.max(2*i,t));r.set(e),e=r}},a=i.f||0,l=i.p||0,h=i.b||0,c=i.l,d=i.d,u=i.m,p=i.n,m=8*r;do{if(!c){a=zr(t,l,1);var f=zr(t,l+1,3);if(l+=3,!f){var g=t[(P=Hr(l)+4)-4]|t[P-3]<<8,v=P+g;if(v>r){s&&Yr(0);break}n&&o(h+g),e.set(t.subarray(P,v),h),i.b=h+=g,i.p=l=8*v,i.f=a;continue}if(1==f)c=Br,d=jr,u=9,p=5;else if(2==f){var y=zr(t,l,31)+257,w=zr(t,l+10,15)+4,x=y+zr(t,l+5,31)+1;l+=14;for(var b=new yr(x),_=new yr(19),A=0;A<w;++A)_[Ar[A]]=zr(t,l+3*A,7);l+=3*w;var S=Vr(_),T=(1<<S)-1,E=Nr(_,S,1);for(A=0;A<x;){var P,M=E[zr(t,l,T)];if(l+=15&M,(P=M>>>4)<16)b[A++]=P;else{var C=0,L=0;for(16==P?(L=3+zr(t,l,3),l+=2,C=b[A-1]):17==P?(L=3+zr(t,l,7),l+=3):18==P&&(L=11+zr(t,l,127),l+=7);L--;)b[A++]=C}}var R=b.subarray(0,y),O=b.subarray(y);u=Vr(R),p=Vr(O),c=Nr(R,u,1),d=Nr(O,p,1)}else Yr(1);if(l>m){s&&Yr(0);break}}n&&o(h+131072);for(var F=(1<<u)-1,N=(1<<p)-1,D=l;;D=l){var I=(C=c[Gr(t,l)&F])>>>4;if((l+=15&C)>m){s&&Yr(0);break}if(C||Yr(2),I<256)e[h++]=I;else{if(256==I){D=l,c=null;break}var U=I-254;if(I>264){var B=br[A=I-257];U=zr(t,l,(1<<B)-1)+Er[A],l+=B}var k=d[Gr(t,l)&N],j=k>>>4;k||Yr(3),l+=15&k;O=Cr[j];if(j>3){B=_r[j];O+=Gr(t,l)&(1<<B)-1,l+=B}if(l>m){s&&Yr(0);break}n&&o(h+131072);for(var V=h+U;h<V;h+=4)e[h]=e[h-O],e[h+1]=e[h+1-O],e[h+2]=e[h+2-O],e[h+3]=e[h+3-O];h=V}}i.l=c,i.p=D,i.b=h,i.f=a,c&&(a=1,i.m=u,i.d=d,i.n=p)}while(!a);return h==e.length?e:Xr(e,0,h)},Jr=function(t,e,i){i<<=7&e;var r=e/8|0;t[r]|=i,t[r+1]|=i>>>8},Zr=function(t,e,i){i<<=7&e;var r=e/8|0;t[r]|=i,t[r+1]|=i>>>8,t[r+2]|=i>>>16},qr=function(t,e){for(var i=[],r=0;r<t.length;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[sn,0];if(1==n){var o=new yr(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],h=0,c=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=i[i[h].f<i[d].f?h++:d++],l=i[h!=c&&i[h].f<i[d].f?h++:d++],i[c++]={s:-1,f:a.f+l.f,l:a,r:l};var u=s[0].s;for(r=1;r<n;++r)s[r].s>u&&(u=s[r].s);var p=new wr(u+1),m=Kr(i[c-1],p,0);if(m>e){r=0;var f=0,g=m-e,v=1<<g;for(s.sort((function(t,e){return p[e.s]-p[t.s]||t.f-e.f}));r<n;++r){var y=s[r].s;if(!(p[y]>e))break;f+=v-(1<<m-p[y]),p[y]=e}for(f>>>=g;f>0;){var w=s[r].s;p[w]<e?f-=1<<e-p[w]++-1:++r}for(;r>=0&&f;--r){var x=s[r].s;p[x]==e&&(--p[x],++f)}m=e}return[new yr(p),m]},Kr=function(t,e,i){return-1==t.s?Math.max(Kr(t.l,e,i+1),Kr(t.r,e,i+1)):e[t.s]=i},$r=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new wr(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},tn=function(t,e){for(var i=0,r=0;r<e.length;++r)i+=t[r]*e[r];return i},en=function(t,e,i){var r=i.length,n=Hr(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=i[s];return 8*(n+4+r)},rn=function(t,e,i,r,n,s,o,a,l,h,c){Jr(e,c++,i),++n[256];for(var d=qr(n,15),u=d[0],p=d[1],m=qr(s,15),f=m[0],g=m[1],v=$r(u),y=v[0],w=v[1],x=$r(f),b=x[0],_=x[1],A=new wr(19),S=0;S<y.length;++S)A[31&y[S]]++;for(S=0;S<b.length;++S)A[31&b[S]]++;for(var T=qr(A,7),E=T[0],P=T[1],M=19;M>4&&!E[Ar[M-1]];--M);var C,L,R,O,F=h+5<<3,N=tn(n,Dr)+tn(s,Ir)+o,D=tn(n,u)+tn(s,f)+o+14+3*M+tn(A,E)+(2*A[16]+3*A[17]+7*A[18]);if(F<=N&&F<=D)return en(e,c,t.subarray(l,l+h));if(Jr(e,c,1+(D<N)),c+=2,D<N){C=Nr(u,p,0),L=u,R=Nr(f,g,0),O=f;var I=Nr(E,P,0);Jr(e,c,w-257),Jr(e,c+5,_-1),Jr(e,c+10,M-4),c+=14;for(S=0;S<M;++S)Jr(e,c+3*S,E[Ar[S]]);c+=3*M;for(var U=[y,b],B=0;B<2;++B){var k=U[B];for(S=0;S<k.length;++S){var j=31&k[S];Jr(e,c,I[j]),c+=E[j],j>15&&(Jr(e,c,k[S]>>>5&127),c+=k[S]>>>12)}}}else C=Ur,L=Dr,R=kr,O=Ir;for(S=0;S<a;++S)if(r[S]>255){j=r[S]>>>18&31;Zr(e,c,C[j+257]),c+=L[j+257],j>7&&(Jr(e,c,r[S]>>>23&31),c+=br[j]);var V=31&r[S];Zr(e,c,R[V]),c+=O[V],V>3&&(Zr(e,c,r[S]>>>5&8191),c+=_r[V])}else Zr(e,c,C[r[S]]),c+=L[r[S]];return Zr(e,c,C[256]),c+L[256]},nn=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sn=new yr(0),on=function(t,e,i,r,n,s){var o=t.length,a=new yr(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),h=0;if(!e||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d>=o&&(l[h>>3]=s),h=en(l,h+1,t.subarray(c,d))}else{for(var u=nn[e-1],p=u>>>13,m=8191&u,f=(1<<i)-1,g=new wr(32768),v=new wr(f+1),y=Math.ceil(i/3),w=2*y,x=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<w)&f},b=new xr(25e3),_=new wr(288),A=new wr(32),S=0,T=0,E=(c=0,0),P=0,M=0;c<o;++c){var C=x(c),L=32767&c,R=v[C];if(g[L]=R,v[C]=L,P<=c){var O=o-c;if((S>7e3||E>24576)&&O>423){h=rn(t,l,0,b,_,A,T,E,M,c-M,h),E=S=T=0,M=c;for(var F=0;F<286;++F)_[F]=0;for(F=0;F<30;++F)A[F]=0}var N=2,D=0,I=m,U=L-R&32767;if(O>2&&C==x(c-U))for(var B=Math.min(p,O)-1,k=Math.min(32767,c),j=Math.min(258,O);U<=k&&--I&&L!=R;){if(t[c+N]==t[c+N-U]){for(var V=0;V<j&&t[c+V]==t[c+V-U];++V);if(V>N){if(N=V,D=U,V>B)break;var z=Math.min(U,V-2),G=0;for(F=0;F<z;++F){var H=c-U+F+32768&32767,X=H-g[H]+32768&32767;X>G&&(G=X,R=H)}}}U+=(L=R)-(R=g[L])+32768&32767}if(D){b[E++]=268435456|Pr[N]<<18|Lr[D];var W=31&Pr[N],Y=31&Lr[D];T+=br[W]+_r[Y],++_[257+W],++A[Y],P=c+N,++S}else b[E++]=t[c],++_[t[c]]}}h=rn(t,l,s,b,_,A,T,E,M,c-M,h),!s&&7&h&&(h=en(l,h+1,sn))}return Xr(a,0,r+Hr(h)+n)},an=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var i=e,r=9;--r;)i=(1&i&&-306674912)^i>>>1;t[e]=i}return t}(),ln=function(){var t=-1;return{p:function(e){for(var i=t,r=0;r<e.length;++r)i=an[255&i^e[r]]^i>>>8;t=i},d:function(){return~t}}},hn=function(){var t=1,e=0;return{p:function(i){for(var r=t,n=e,s=0|i.length,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)n+=r+=i[o];r=(65535&r)+15*(r>>16),n=(65535&n)+15*(n>>16)}t=r,e=n},d:function(){return(255&(t%=65521))<<24|t>>>8<<16|(255&(e%=65521))<<8|e>>>8}}},cn=function(t,e,i,r,n){return on(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r,!n)},dn=function(t,e){var i={};for(var r in t)i[r]=t[r];for(var r in e)i[r]=e[r];return i},un=function(t,e,i){for(var r=t(),n=t.toString(),s=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var a=r[o],l=s[o];if("function"==typeof a){e+=";"+l+"=";var h=a.toString();if(a.prototype)if(-1!=h.indexOf("[native code]")){var c=h.indexOf(" ",8)+1;e+=h.slice(c,h.indexOf("(",c))}else for(var d in e+=h,a.prototype)e+=";"+l+".prototype."+d+"="+a.prototype[d].toString();else e+=h}else i[l]=a}return[e,i]},pn=[],mn=function(t,e,i,r){var n;if(!pn[i]){for(var s="",o={},a=t.length-1,l=0;l<a;++l)s=(n=un(t[l],s,o))[0],o=n[1];pn[i]=un(t[a],s,o)}var h=dn({},pn[i][1]);return function(t,e,i,r,n){var s=new Worker(vr[e]||(vr[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(t){var e=t.data,i=e.$e$;if(i){var r=new Error(i[0]);r.code=i[1],r.stack=i[2],n(r,null)}else n(null,e)},s.postMessage(i,r),s}(pn[i][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",i,h,function(t){var e=[];for(var i in t)t[i].buffer&&e.push((t[i]=new t[i].constructor(t[i])).buffer);return e}(h),r)},fn=function(){return[yr,wr,xr,br,_r,Ar,Er,Cr,Br,jr,Rr,Wr,Nr,Vr,zr,Gr,Hr,Xr,Yr,Qr,Hn,bn,_n]},gn=function(){return[yr,wr,xr,br,_r,Ar,Pr,Lr,Ur,Dr,kr,Ir,Rr,nn,sn,Nr,Jr,Zr,qr,Kr,$r,tn,en,rn,Hr,Xr,on,cn,jn,bn]},vn=function(){return[Ln,Fn,Cn,ln,an]},yn=function(){return[Rn,On]},wn=function(){return[Nn,Cn,hn]},xn=function(){return[Dn]},bn=function(t){return postMessage(t,[t.buffer])},_n=function(t){return t&&t.size&&new yr(t.size)},An=function(t,e,i,r,n,s){var o=mn(i,r,n,(function(t,e){o.terminate(),s(t,e)}));return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},Sn=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},Tn=function(t,e,i,r,n){var s,o=mn(t,r,n,(function(t,i){t?(o.terminate(),e.ondata.call(e,t)):(i[1]&&o.terminate(),e.ondata.call(e,t,i[0],i[1]))}));o.postMessage(i),e.push=function(t,i){e.ondata||Yr(5),s&&e.ondata(Yr(4,0,1),null,!!i),o.postMessage([t,s=i],[t.buffer])},e.terminate=function(){o.terminate()}},En=function(t,e){return t[e]|t[e+1]<<8},Pn=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Mn=function(t,e){return Pn(t,e)+4294967296*Pn(t,e+4)},Cn=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},Ln=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Cn(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;r<=i.length;++r)t[r+10]=i.charCodeAt(r)}},Rn=function(t){31==t[0]&&139==t[1]&&8==t[2]||Yr(6,"invalid gzip data");var e=t[3],i=10;4&e&&(i+=t[10]|2+(t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[i++]);return i+(2&e)},On=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Fn=function(t){return 10+(t.filename&&t.filename.length+1||0)},Nn=function(t,e){var i=e.level,r=0==i?0:i<6?1:9==i?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)},Dn=function(t){(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)&&Yr(6,"invalid zlib data"),32&t[1]&&Yr(6,"invalid zlib data: preset dictionaries not supported")};function In(t,e){return e||"function"!=typeof t||(e=t,t={}),this.ondata=e,t}var Un=function(){function t(t,e){e||"function"!=typeof t||(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(cn(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){this.ondata||Yr(5),this.d&&Yr(4),this.d=e,this.p(t,e||!1)},t}(),Bn=function(){return function(t,e){Tn([gn,function(){return[Sn,Un]}],this,In.call(this,t,e),(function(t){var e=new Un(t.data);onmessage=Sn(e)}),6)}}();function kn(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),An(t,e,[gn],(function(t){return bn(jn(t.data[0],t.data[1]))}),0,i)}function jn(t,e){return cn(t,e||{},0,0)}var Vn=function(){function t(t){this.s={},this.p=new yr(0),this.ondata=t}return t.prototype.e=function(t){this.ondata||Yr(5),this.d&&Yr(4);var e=this.p.length,i=new yr(e+t.length);i.set(this.p),i.set(t,e),this.p=i},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,i=Qr(this.p,this.o,this.s);this.ondata(Xr(i,e,this.s.b),this.d),this.o=Xr(i,this.s.b-32768),this.s.b=this.o.length,this.p=Xr(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),zn=function(){return function(t){this.ondata=t,Tn([fn,function(){return[Sn,Vn]}],this,0,(function(){var t=new Vn;onmessage=Sn(t)}),7)}}();function Gn(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),An(t,e,[fn],(function(t){return bn(Hn(t.data[0],_n(t.data[1])))}),1,i)}function Hn(t,e){return Qr(t,e)}var Xn=function(){function t(t,e){this.c=ln(),this.l=0,this.v=1,Un.call(this,t,e)}return t.prototype.push=function(t,e){Un.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var i=cn(t,this.o,this.v&&Fn(this.o),e&&8,!e);this.v&&(Ln(i,this.o),this.v=0),e&&(Cn(i,i.length-8,this.c.d()),Cn(i,i.length-4,this.l)),this.ondata(i,e)},t}(),Wn=function(){return function(t,e){Tn([gn,vn,function(){return[Sn,Un,Xn]}],this,In.call(this,t,e),(function(t){var e=new Xn(t.data);onmessage=Sn(e)}),8)}}();function Yn(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),An(t,e,[gn,vn,function(){return[Qn]}],(function(t){return bn(Qn(t.data[0],t.data[1]))}),2,i)}function Qn(t,e){e||(e={});var i=ln(),r=t.length;i.p(t);var n=cn(t,e,Fn(e),8),s=n.length;return Ln(n,e),Cn(n,s-8,i.d()),Cn(n,s-4,r),n}var Jn=function(){function t(t){this.v=1,Vn.call(this,t)}return t.prototype.push=function(t,e){if(Vn.prototype.e.call(this,t),this.v){var i=this.p.length>3?Rn(this.p):4;if(i>=this.p.length&&!e)return;this.p=this.p.subarray(i),this.v=0}e&&(this.p.length<8&&Yr(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),Vn.prototype.c.call(this,e)},t}(),Zn=function(){return function(t){this.ondata=t,Tn([fn,yn,function(){return[Sn,Vn,Jn]}],this,0,(function(){var t=new Jn;onmessage=Sn(t)}),9)}}();function qn(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),An(t,e,[fn,yn,function(){return[Kn]}],(function(t){return bn(Kn(t.data[0]))}),3,i)}function Kn(t,e){return Qr(t.subarray(Rn(t),-8),e||new yr(On(t)))}var $n=function(){function t(t,e){this.c=hn(),this.v=1,Un.call(this,t,e)}return t.prototype.push=function(t,e){Un.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var i=cn(t,this.o,this.v&&2,e&&4,!e);this.v&&(Nn(i,this.o),this.v=0),e&&Cn(i,i.length-4,this.c.d()),this.ondata(i,e)},t}(),ts=function(){return function(t,e){Tn([gn,wn,function(){return[Sn,Un,$n]}],this,In.call(this,t,e),(function(t){var e=new $n(t.data);onmessage=Sn(e)}),10)}}();function es(t,e){e||(e={});var i=hn();i.p(t);var r=cn(t,e,2,4);return Nn(r,e),Cn(r,r.length-4,i.d()),r}var is=function(){function t(t){this.v=1,Vn.call(this,t)}return t.prototype.push=function(t,e){if(Vn.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}e&&(this.p.length<4&&Yr(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Vn.prototype.c.call(this,e)},t}(),rs=function(){return function(t){this.ondata=t,Tn([fn,xn,function(){return[Sn,Vn,is]}],this,0,(function(){var t=new is;onmessage=Sn(t)}),11)}}();function ns(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),An(t,e,[fn,xn,function(){return[ss]}],(function(t){return bn(ss(t.data[0],_n(t.data[1])))}),5,i)}function ss(t,e){return Qr((Dn(t),t.subarray(2,-4)),e)}var os=function(){function t(t){this.G=Jn,this.I=Vn,this.Z=is,this.ondata=t}return t.prototype.push=function(t,e){if(this.ondata||Yr(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var i=new yr(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var r=this,n=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(n):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(n):new this.Z(n),this.s.push(this.p,e),this.p=null}}},t}(),as=function(){function t(t){this.G=Zn,this.I=zn,this.Z=rs,this.ondata=t}return t.prototype.push=function(t,e){os.prototype.push.call(this,t,e)},t}();var ls=function(t,e,i,r){for(var n in t){var s=t[n],o=e+n,a=r;Array.isArray(s)&&(a=dn(r,s[1]),s=s[0]),s instanceof yr?i[o]=[s,a]:(i[o+="/"]=[new yr(0),a],ls(s,o,i,r))}},hs="undefined"!=typeof TextEncoder&&new TextEncoder,cs="undefined"!=typeof TextDecoder&&new TextDecoder,ds=0;try{cs.decode(sn,{stream:!0}),ds=1}catch(t){}var us=function(t){for(var e="",i=0;;){var r=t[i++],n=(r>127)+(r>223)+(r>239);if(i+n>t.length)return[e,Xr(t,i-1)];n?3==n?(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&n?String.fromCharCode((31&r)<<6|63&t[i++]):String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):e+=String.fromCharCode(r)}},ps=function(){function t(t){this.ondata=t,ds?this.t=new TextDecoder:this.p=sn}return t.prototype.push=function(t,e){if(this.ondata||Yr(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&Yr(8),this.t=null));this.p||Yr(4);var i=new yr(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length);var r=us(i),n=r[0],s=r[1];e?(s.length&&Yr(8),this.p=null):this.p=s,this.ondata(n,e)},t}(),ms=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||Yr(5),this.d&&Yr(4),this.ondata(fs(t),this.d=e||!1)},t}();function fs(t,e){if(e){for(var i=new yr(t.length),r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}if(hs)return hs.encode(t);var n=t.length,s=new yr(t.length+(t.length>>1)),o=0,a=function(t){s[o++]=t};for(r=0;r<n;++r){if(o+5>s.length){var l=new yr(o+8+(n-r<<1));l.set(s),s=l}var h=t.charCodeAt(r);h<128||e?a(h):h<2048?(a(192|h>>6),a(128|63&h)):h>55295&&h<57344?(a(240|(h=65536+(1047552&h)|1023&t.charCodeAt(++r))>>18),a(128|h>>12&63),a(128|h>>6&63),a(128|63&h)):(a(224|h>>12),a(128|h>>6&63),a(128|63&h))}return Xr(s,0,o)}function gs(t,e){if(e){for(var i="",r=0;r<t.length;r+=16384)i+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return i}if(cs)return cs.decode(t);var n=us(t),s=n[0];return n[1].length&&Yr(8),s}var vs=function(t){return 1==t?3:t<6?2:9==t?1:0},ys=function(t,e){return e+30+En(t,e+26)+En(t,e+28)},ws=function(t,e,i){var r=En(t,e+28),n=gs(t.subarray(e+46,e+46+r),!(2048&En(t,e+8))),s=e+46+r,o=Pn(t,e+20),a=i&&4294967295==o?xs(t,s):[o,Pn(t,e+24),Pn(t,e+42)],l=a[0],h=a[1],c=a[2];return[En(t,e+10),l,h,n,s+En(t,e+30)+En(t,e+32),c]},xs=function(t,e){for(;1!=En(t,e);e+=4+En(t,e+2));return[Mn(t,e+12),Mn(t,e+4),Mn(t,e+20)]},bs=function(t){var e=0;if(t)for(var i in t){var r=t[i].length;r>65535&&Yr(9),e+=r+4}return e},_s=function(t,e,i,r,n,s,o,a){var l=r.length,h=i.extra,c=a&&a.length,d=bs(h);Cn(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=i.os),t[e]=20,e+=2,t[e++]=i.flag<<1|(null==s&&8),t[e++]=n&&8,t[e++]=255&i.compression,t[e++]=i.compression>>8;var u=new Date(null==i.mtime?Date.now():i.mtime),p=u.getFullYear()-1980;if((p<0||p>119)&&Yr(10),Cn(t,e,p<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>>1),e+=4,null!=s&&(Cn(t,e,i.crc),Cn(t,e+4,s),Cn(t,e+8,i.size)),Cn(t,e+12,l),Cn(t,e+14,d),e+=16,null!=o&&(Cn(t,e,c),Cn(t,e+6,i.attrs),Cn(t,e+10,o),e+=14),t.set(r,e),e+=l,d)for(var m in h){var f=h[m],g=f.length;Cn(t,e,+m),Cn(t,e+2,g),t.set(f,e+4),e+=4+g}return c&&(t.set(a,e),e+=c),e},As=function(t,e,i,r,n){Cn(t,e,101010256),Cn(t,e+8,i),Cn(t,e+10,i),Cn(t,e+12,r),Cn(t,e+16,n)},Ss=function(){function t(t){this.filename=t,this.c=ln(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||Yr(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),Ts=function(){function t(t,e){var i=this;e||(e={}),Ss.call(this,t),this.d=new Un(e,(function(t,e){i.ondata(null,t,e)})),this.compression=8,this.flag=vs(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){Ss.prototype.push.call(this,t,e)},t}(),Es=function(){function t(t,e){var i=this;e||(e={}),Ss.call(this,t),this.d=new Bn(e,(function(t,e,r){i.ondata(t,e,r)})),this.compression=8,this.flag=vs(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){Ss.prototype.push.call(this,t,e)},t}(),Ps=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||Yr(5),2&this.d)this.ondata(Yr(4+8*(1&this.d),0,1),null,!1);else{var i=fs(t.filename),r=i.length,n=t.comment,s=n&&fs(n),o=r!=t.filename.length||s&&n.length!=s.length,a=r+bs(t.extra)+30;r>65535&&this.ondata(Yr(11,0,1),null,!1);var l=new yr(a);_s(l,0,t,i,o);var h=[l],c=function(){for(var t=0,i=h;t<i.length;t++){var r=i[t];e.ondata(null,r,!1)}h=[]},d=this.d;this.d=0;var u=this.u.length,p=dn(t,{f:i,u:o,o:s,t:function(){t.terminate&&t.terminate()},r:function(){if(c(),d){var t=e.u[u+1];t?t.r():e.d=1}d=1}}),m=0;t.ondata=function(i,r,n){if(i)e.ondata(i,r,n),e.terminate();else if(m+=r.length,h.push(r),n){var s=new yr(16);Cn(s,0,134695760),Cn(s,4,t.crc),Cn(s,8,m),Cn(s,12,t.size),h.push(s),p.c=m,p.b=a+m+16,p.crc=t.crc,p.size=t.size,d&&p.r(),d=1}else d&&c()},this.u.push(p)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(Yr(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,i=0,r=0,n=this.u;r<n.length;r++){i+=46+(l=n[r]).f.length+bs(l.extra)+(l.o?l.o.length:0)}for(var s=new yr(i+22),o=0,a=this.u;o<a.length;o++){var l=a[o];_s(s,t,l,l.f,l.u,l.c,e,l.o),t+=46+l.f.length+bs(l.extra)+(l.o?l.o.length:0),e+=l.b}As(s,t,this.u.length,i,e),this.ondata(null,s,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++){e[t].t()}this.d=2},t}();var Ms=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),Cs=function(){function t(){var t=this;this.i=new Vn((function(e,i){t.ondata(null,e,i)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}(),Ls=function(){function t(t,e){var i=this;e<32e4?this.i=new Vn((function(t,e){i.ondata(null,t,e)})):(this.i=new zn((function(t,e,r){i.ondata(t,e,r)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=Xr(t,0)),this.i.push(t,e)},t.compression=8,t}(),Rs=function(){function t(t){this.onfile=t,this.k=[],this.o={0:Ms},this.p=sn}return t.prototype.push=function(t,e){var i=this;if(this.onfile||Yr(5),this.p||Yr(4),this.c>0){var r=Math.min(this.c,t.length),n=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(n,!this.c):this.k[0].push(n),(t=t.subarray(r)).length)return this.push(t,e)}else{var s=0,o=0,a=void 0,l=void 0;this.p.length?t.length?((l=new yr(this.p.length+t.length)).set(this.p),l.set(t,this.p.length)):l=this.p:l=t;for(var h=l.length,c=this.c,d=c&&this.d,u=function(){var t,e=Pn(l,o);if(67324752==e){s=1,a=o,p.d=null,p.c=0;var r=En(l,o+6),n=En(l,o+8),d=2048&r,u=8&r,m=En(l,o+26),f=En(l,o+28);if(h>o+30+m+f){var g=[];p.k.unshift(g),s=2;var v,y=Pn(l,o+18),w=Pn(l,o+22),x=gs(l.subarray(o+30,o+=30+m),!d);4294967295==y?(t=u?[-2]:xs(l,o),y=t[0],w=t[1]):u&&(y=-1),o+=f,p.c=y;var b={name:x,compression:n,start:function(){if(b.ondata||Yr(5),y){var t=i.o[n];t||b.ondata(Yr(14,"unknown compression type "+n,1),null,!1),(v=y<0?new t(x):new t(x,y,w)).ondata=function(t,e,i){b.ondata(t,e,i)};for(var e=0,r=g;e<r.length;e++){var s=r[e];v.push(s,!1)}i.k[0]==g&&i.c?i.d=v:v.push(sn,!0)}else b.ondata(null,sn,!0)},terminate:function(){v&&v.terminate&&v.terminate()}};y>=0&&(b.size=y,b.originalSize=w),p.onfile(b)}return"break"}if(c){if(134695760==e)return a=o+=12+(-2==c&&8),s=3,p.c=0,"break";if(33639248==e)return a=o-=4,s=3,p.c=0,"break"}},p=this;o<h-4;++o){if("break"===u())break}if(this.p=sn,c<0){var m=s?l.subarray(0,a-12-(-2==c&&8)-(134695760==Pn(l,a-16)&&4)):l.subarray(0,o);d?d.push(m,!!s):this.k[+(2==s)].push(m)}if(2&s)return this.push(l.subarray(o),e);this.p=l.subarray(o)}e&&(this.c&&Yr(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}(),Os="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};var Fs=Object.freeze({__proto__:null,FlateErrorCode:{UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Deflate:Un,AsyncDeflate:Bn,deflate:kn,deflateSync:jn,Inflate:Vn,AsyncInflate:zn,inflate:Gn,inflateSync:Hn,Gzip:Xn,AsyncGzip:Wn,gzip:Yn,gzipSync:Qn,Gunzip:Jn,AsyncGunzip:Zn,gunzip:qn,gunzipSync:Kn,Zlib:$n,AsyncZlib:ts,zlib:function(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),An(t,e,[gn,wn,function(){return[es]}],(function(t){return bn(es(t.data[0],t.data[1]))}),4,i)},zlibSync:es,Unzlib:is,AsyncUnzlib:rs,unzlib:ns,unzlibSync:ss,compress:Yn,AsyncCompress:Wn,compressSync:Qn,Compress:Xn,Decompress:os,AsyncDecompress:as,decompress:function(t,e,i){return i||(i=e,e={}),"function"!=typeof i&&Yr(7),31==t[0]&&139==t[1]&&8==t[2]?qn(t,e,i):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Gn(t,e,i):ns(t,e,i)},decompressSync:function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Kn(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Hn(t,e):ss(t,e)},DecodeUTF8:ps,EncodeUTF8:ms,strToU8:fs,strFromU8:gs,ZipPassThrough:Ss,ZipDeflate:Ts,AsyncZipDeflate:Es,Zip:Ps,zip:function(t,e,i){i||(i=e,e={}),"function"!=typeof i&&Yr(7);var r={};ls(t,"",r,e);var n=Object.keys(r),s=n.length,o=0,a=0,l=s,h=new Array(s),c=[],d=function(){for(var t=0;t<c.length;++t)c[t]()},u=function(t,e){Os((function(){i(t,e)}))};Os((function(){u=i}));var p=function(){var t=new yr(a+22),e=o,i=a-o;a=0;for(var r=0;r<l;++r){var n=h[r];try{var s=n.c.length;_s(t,a,n,n.f,n.u,s);var c=30+n.f.length+bs(n.extra),d=a+c;t.set(n.c,d),_s(t,o,n,n.f,n.u,s,a,n.m),o+=16+c+(n.m?n.m.length:0),a=d+s}catch(t){return u(t,null)}}As(t,o,h.length,i,e),u(null,t)};s||p();for(var m=function(t){var e=n[t],i=r[e],l=i[0],m=i[1],f=ln(),g=l.length;f.p(l);var v=fs(e),y=v.length,w=m.comment,x=w&&fs(w),b=x&&x.length,_=bs(m.extra),A=0==m.level?0:8,S=function(i,r){if(i)d(),u(i,null);else{var n=r.length;h[t]=dn(m,{size:g,crc:f.d(),c:r,f:v,m:x,u:y!=e.length||x&&w.length!=b,compression:A}),o+=30+y+_+n,a+=76+2*(y+_)+(b||0)+n,--s||p()}};if(y>65535&&S(Yr(11,0,1),null),A)if(g<16e4)try{S(null,jn(l,m))}catch(t){S(t,null)}else c.push(kn(l,m,S));else S(null,l)},f=0;f<l;++f)m(f);return d},zipSync:function(t,e){e||(e={});var i={},r=[];ls(t,"",i,e);var n=0,s=0;for(var o in i){var a=i[o],l=a[0],h=a[1],c=0==h.level?0:8,d=(A=fs(o)).length,u=h.comment,p=u&&fs(u),m=p&&p.length,f=bs(h.extra);d>65535&&Yr(11);var g=c?jn(l,h):l,v=g.length,y=ln();y.p(l),r.push(dn(h,{size:l.length,crc:y.d(),c:g,f:A,m:p,u:d!=o.length||p&&u.length!=m,o:n,compression:c})),n+=30+d+f+v,s+=76+2*(d+f)+(m||0)+v}for(var w=new yr(s+22),x=n,b=s-n,_=0;_<r.length;++_){var A=r[_];_s(w,A.o,A,A.f,A.u,A.c.length);var S=30+A.f.length+bs(A.extra);w.set(A.c,A.o+S),_s(w,n,A,A.f,A.u,A.c.length,A.o,A.m),n+=16+S+(A.m?A.m.length:0)}return As(w,n,r.length,b,x),w},UnzipPassThrough:Ms,UnzipInflate:Cs,AsyncUnzipInflate:Ls,Unzip:Rs,unzip:function(t,e,i){i||(i=e,e={}),"function"!=typeof i&&Yr(7);var r=[],n=function(){for(var t=0;t<r.length;++t)r[t]()},s={},o=function(t,e){Os((function(){i(t,e)}))};Os((function(){o=i}));for(var a=t.length-22;101010256!=Pn(t,a);--a)if(!a||t.length-a>65558)return o(Yr(13,0,1),null),n;var l=En(t,a+8);if(l){var h=l,c=Pn(t,a+16),d=4294967295==c;if(d){if(a=Pn(t,a-12),101075792!=Pn(t,a))return o(Yr(13,0,1),null),n;h=l=Pn(t,a+32),c=Pn(t,a+48)}for(var u=e&&e.filter,p=function(e){var i=ws(t,c,d),a=i[0],h=i[1],p=i[2],m=i[3],f=i[4],g=i[5],v=ys(t,g);c=f;var y=function(t,e){t?(n(),o(t,null)):(e&&(s[m]=e),--l||o(null,s))};if(!u||u({name:m,size:h,originalSize:p,compression:a}))if(a)if(8==a){var w=t.subarray(v,v+h);if(h<32e4)try{y(null,Hn(w,new yr(p)))}catch(t){y(t,null)}else r.push(Gn(w,{size:p},y))}else y(Yr(14,"unknown compression type "+a,1),null);else y(null,Xr(t,v,v+h));else y(null,null)},m=0;m<h;++m)p()}else o(null,{});return n},unzipSync:function(t,e){for(var i={},r=t.length-22;101010256!=Pn(t,r);--r)(!r||t.length-r>65558)&&Yr(13);var n=En(t,r+8);if(!n)return{};var s=Pn(t,r+16),o=4294967295==s;o&&(r=Pn(t,r-12),101075792!=Pn(t,r)&&Yr(13),n=Pn(t,r+32),s=Pn(t,r+48));for(var a=e&&e.filter,l=0;l<n;++l){var h=ws(t,s,o),c=h[0],d=h[1],u=h[2],p=h[3],m=h[4],f=h[5],g=ys(t,f);s=m,a&&!a({name:p,size:d,originalSize:u,compression:c})||(c?8==c?i[p]=Hn(t.subarray(g,g+d),new yr(u)):Yr(14,"unknown compression type "+c):i[p]=Xr(t,g,g+d))}return i}});let Ns,Ds,Is;class Us extends be.Loader{constructor(t){super(t)}load(t,e,i,r){const n=this,s=""===n.path?be.LoaderUtils.extractUrlBase(t):n.path,o=new be.FileLoader(this.manager);o.setPath(n.path),o.setResponseType("arraybuffer"),o.setRequestHeader(n.requestHeader),o.setWithCredentials(n.withCredentials),o.load(t,(function(i){try{e(n.parse(i,s))}catch(e){r?r(e):console.error(e),n.manager.itemError(t)}}),i,r)}parse(t,e){if(function(t){const e="Kaydara FBX Binary \0";return t.byteLength>=e.length&&e===to(t,0,e.length)}(t))Ns=(new zs).parse(t);else{const e=to(t);if(!function(t){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let i=0;function r(e){const r=t[e-1];return t=t.slice(i+e),i++,r}for(let t=0;t<e.length;++t){if(r(1)===e[t])return!1}return!0}(e))throw new Error("THREE.FBXLoader: Unknown format.");if(Xs(e)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Xs(e));Ns=(new Vs).parse(e)}const i=new be.TextureLoader(this.manager).setPath(this.resourcePath||e).setCrossOrigin(this.crossOrigin);return new Bs(i,this.manager).parse(Ns)}}class Bs{constructor(t,e){this.textureLoader=t,this.manager=e}parse(){Ds=this.parseConnections();const t=this.parseImages(),e=this.parseTextures(t),i=this.parseMaterials(e),r=this.parseDeformers(),n=(new ks).parse(r);return this.parseScene(r,n,i),Is}parseConnections(){const t=new Map;if("Connections"in Ns){Ns.Connections.connections.forEach((function(e){const i=e[0],r=e[1],n=e[2];t.has(i)||t.set(i,{parents:[],children:[]});const s={ID:r,relationship:n};t.get(i).parents.push(s),t.has(r)||t.set(r,{parents:[],children:[]});const o={ID:i,relationship:n};t.get(r).children.push(o)}))}return t}parseImages(){const t={},e={};if("Video"in Ns.Objects){const i=Ns.Objects.Video;for(const r in i){const n=i[r];if(t[parseInt(r)]=n.RelativeFilename||n.Filename,"Content"in n){const t=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,s="string"==typeof n.Content&&""!==n.Content;if(t||s){const t=this.parseImage(i[r]);e[n.RelativeFilename||n.Filename]=t}}}}for(const i in t){const r=t[i];void 0!==e[r]?t[i]=e[r]:t[i]=t[i].split("\\").pop()}return t}parseImage(t){const e=t.Content,i=t.RelativeFilename||t.Filename,r=i.slice(i.lastIndexOf(".")+1).toLowerCase();let n;switch(r){case"bmp":n="image/bmp";break;case"jpg":case"jpeg":n="image/jpeg";break;case"png":n="image/png";break;case"tif":n="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",i),n="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof e)return"data:"+n+";base64,"+e;{const t=new Uint8Array(e);return window.URL.createObjectURL(new Blob([t],{type:n}))}}parseTextures(t){const e=new Map;if("Texture"in Ns.Objects){const i=Ns.Objects.Texture;for(const r in i){const n=this.parseTexture(i[r],t);e.set(parseInt(r),n)}}return e}parseTexture(t,e){const i=this.loadTexture(t,e);i.ID=t.id,i.name=t.attrName;const r=t.WrapModeU,n=t.WrapModeV,s=void 0!==r?r.value:0,o=void 0!==n?n.value:0;if(i.wrapS=0===s?be.RepeatWrapping:be.ClampToEdgeWrapping,i.wrapT=0===o?be.RepeatWrapping:be.ClampToEdgeWrapping,"Scaling"in t){const e=t.Scaling.value;i.repeat.x=e[0],i.repeat.y=e[1]}if("Translation"in t){const e=t.Translation.value;i.offset.x=e[0],i.offset.y=e[1]}return i}loadTexture(t,e){let i;const r=this.textureLoader.path,n=Ds.get(t.id).children;let s;void 0!==n&&n.length>0&&void 0!==e[n[0].ID]&&(i=e[n[0].ID],0!==i.indexOf("blob:")&&0!==i.indexOf("data:")||this.textureLoader.setPath(void 0));const o=t.FileName.slice(-3).toLowerCase();if("tga"===o){const e=this.manager.getHandler(".tga");null===e?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),s=new be.Texture):(e.setPath(this.textureLoader.path),s=e.load(i))}else"psd"===o?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),s=new be.Texture):s=this.textureLoader.load(i);return this.textureLoader.setPath(r),s}parseMaterials(t){const e=new Map;if("Material"in Ns.Objects){const i=Ns.Objects.Material;for(const r in i){const n=this.parseMaterial(i[r],t);null!==n&&e.set(parseInt(r),n)}}return e}parseMaterial(t,e){const i=t.id,r=t.attrName;let n=t.ShadingModel;if("object"==typeof n&&(n=n.value),!Ds.has(i))return null;const s=this.parseParameters(t,e,i);let o;switch(n.toLowerCase()){case"phong":o=new be.MeshPhongMaterial;break;case"lambert":o=new be.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to THREE.MeshPhongMaterial.',n),o=new be.MeshPhongMaterial}return o.setValues(s),o.name=r,o}parseParameters(t,e,i){const r={};t.BumpFactor&&(r.bumpScale=t.BumpFactor.value),t.Diffuse?r.color=(new be.Color).fromArray(t.Diffuse.value):!t.DiffuseColor||"Color"!==t.DiffuseColor.type&&"ColorRGB"!==t.DiffuseColor.type||(r.color=(new be.Color).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(r.displacementScale=t.DisplacementFactor.value),t.Emissive?r.emissive=(new be.Color).fromArray(t.Emissive.value):!t.EmissiveColor||"Color"!==t.EmissiveColor.type&&"ColorRGB"!==t.EmissiveColor.type||(r.emissive=(new be.Color).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(r.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(r.opacity=parseFloat(t.Opacity.value)),r.opacity<1&&(r.transparent=!0),t.ReflectionFactor&&(r.reflectivity=t.ReflectionFactor.value),t.Shininess&&(r.shininess=t.Shininess.value),t.Specular?r.specular=(new be.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(r.specular=(new be.Color).fromArray(t.SpecularColor.value));const n=this;return Ds.get(i).children.forEach((function(t){const i=t.relationship;switch(i){case"Bump":r.bumpMap=n.getTexture(e,t.ID);break;case"Maya|TEX_ao_map":r.aoMap=n.getTexture(e,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":r.map=n.getTexture(e,t.ID),void 0!==r.map&&(r.map.encoding=be.sRGBEncoding);break;case"DisplacementColor":r.displacementMap=n.getTexture(e,t.ID);break;case"EmissiveColor":r.emissiveMap=n.getTexture(e,t.ID),void 0!==r.emissiveMap&&(r.emissiveMap.encoding=be.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":r.normalMap=n.getTexture(e,t.ID);break;case"ReflectionColor":r.envMap=n.getTexture(e,t.ID),void 0!==r.envMap&&(r.envMap.mapping=be.EquirectangularReflectionMapping,r.envMap.encoding=be.sRGBEncoding);break;case"SpecularColor":r.specularMap=n.getTexture(e,t.ID),void 0!==r.specularMap&&(r.specularMap.encoding=be.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":r.alphaMap=n.getTexture(e,t.ID),r.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",i)}})),r}getTexture(t,e){return"LayeredTexture"in Ns.Objects&&e in Ns.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),e=Ds.get(e).children[0].ID),t.get(e)}parseDeformers(){const t={},e={};if("Deformer"in Ns.Objects){const i=Ns.Objects.Deformer;for(const r in i){const n=i[r],s=Ds.get(parseInt(r));if("Skin"===n.attrType){const e=this.parseSkeleton(s,i);e.ID=r,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),e.geometryID=s.parents[0].ID,t[r]=e}else if("BlendShape"===n.attrType){const t={id:r};t.rawTargets=this.parseMorphTargets(s,i),t.id=r,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),e[r]=t}}}return{skeletons:t,morphTargets:e}}parseSkeleton(t,e){const i=[];return t.children.forEach((function(t){const r=e[t.ID];if("Cluster"!==r.attrType)return;const n={ID:t.ID,indices:[],weights:[],transformLink:(new be.Matrix4).fromArray(r.TransformLink.a)};"Indexes"in r&&(n.indices=r.Indexes.a,n.weights=r.Weights.a),i.push(n)})),{rawBones:i,bones:[]}}parseMorphTargets(t,e){const i=[];for(let r=0;r<t.children.length;r++){const n=t.children[r],s=e[n.ID],o={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a};if("BlendShapeChannel"!==s.attrType)return;o.geoID=Ds.get(parseInt(n.ID)).children.filter((function(t){return void 0===t.relationship}))[0].ID,i.push(o)}return i}parseScene(t,e,i){Is=new be.Group;const r=this.parseModels(t.skeletons,e,i),n=Ns.Objects.Model,s=this;r.forEach((function(t){const e=n[t.ID];s.setLookAtProperties(t,e);Ds.get(t.ID).parents.forEach((function(e){const i=r.get(e.ID);void 0!==i&&i.add(t)})),null===t.parent&&Is.add(t)})),this.bindSkeleton(t.skeletons,e,r),this.createAmbientLight(),Is.traverse((function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrix=t.parent.matrix,t.userData.transformData.parentMatrixWorld=t.parent.matrixWorld);const e=qs(t.userData.transformData);t.applyMatrix4(e),t.updateWorldMatrix()}}));const o=(new js).parse();1===Is.children.length&&Is.children[0].isGroup&&(Is.children[0].animations=o,Is=Is.children[0]),Is.animations=o}parseModels(t,e,i){const r=new Map,n=Ns.Objects.Model;for(const s in n){const o=parseInt(s),a=n[s],l=Ds.get(o);let h=this.buildSkeleton(l,t,o,a.attrName);if(!h){switch(a.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,e,i);break;case"NurbsCurve":h=this.createCurve(l,e);break;case"LimbNode":case"Root":h=new be.Bone;break;default:h=new be.Group}h.name=a.attrName?be.PropertyBinding.sanitizeNodeName(a.attrName):"",h.ID=o}this.getTransformData(h,a),r.set(o,h)}return r}buildSkeleton(t,e,i,r){let n=null;return t.parents.forEach((function(t){for(const s in e){const o=e[s];o.rawBones.forEach((function(e,s){if(e.ID===t.ID){const t=n;n=new be.Bone,n.matrixWorld.copy(e.transformLink),n.name=r?be.PropertyBinding.sanitizeNodeName(r):"",n.ID=i,o.bones[s]=n,null!==t&&n.add(t)}}))}})),n}createCamera(t){let e,i;if(t.children.forEach((function(t){const e=Ns.Objects.NodeAttribute[t.ID];void 0!==e&&(i=e)})),void 0===i)e=new be.Object3D;else{let t=0;void 0!==i.CameraProjectionType&&1===i.CameraProjectionType.value&&(t=1);let r=1;void 0!==i.NearPlane&&(r=i.NearPlane.value/1e3);let n=1e3;void 0!==i.FarPlane&&(n=i.FarPlane.value/1e3);let s=window.innerWidth,o=window.innerHeight;void 0!==i.AspectWidth&&void 0!==i.AspectHeight&&(s=i.AspectWidth.value,o=i.AspectHeight.value);const a=s/o;let l=45;void 0!==i.FieldOfView&&(l=i.FieldOfView.value);const h=i.FocalLength?i.FocalLength.value:null;switch(t){case 0:e=new be.PerspectiveCamera(l,a,r,n),null!==h&&e.setFocalLength(h);break;case 1:e=new be.OrthographicCamera(-s/2,s/2,o/2,-o/2,r,n);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+t+"."),e=new be.Object3D}}return e}createLight(t){let e,i;if(t.children.forEach((function(t){const e=Ns.Objects.NodeAttribute[t.ID];void 0!==e&&(i=e)})),void 0===i)e=new be.Object3D;else{let t;t=void 0===i.LightType?0:i.LightType.value;let r=16777215;void 0!==i.Color&&(r=(new be.Color).fromArray(i.Color.value));let n=void 0===i.Intensity?1:i.Intensity.value/100;void 0!==i.CastLightOnObject&&0===i.CastLightOnObject.value&&(n=0);let s=0;void 0!==i.FarAttenuationEnd&&(s=void 0!==i.EnableFarAttenuation&&0===i.EnableFarAttenuation.value?0:i.FarAttenuationEnd.value);const o=1;switch(t){case 0:e=new be.PointLight(r,n,s,o);break;case 1:e=new be.DirectionalLight(r,n);break;case 2:let t=Math.PI/3;void 0!==i.InnerAngle&&(t=be.MathUtils.degToRad(i.InnerAngle.value));let a=0;void 0!==i.OuterAngle&&(a=be.MathUtils.degToRad(i.OuterAngle.value),a=Math.max(a,1)),e=new be.SpotLight(r,n,s,t,a,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a THREE.PointLight."),e=new be.PointLight(r,n)}void 0!==i.CastShadows&&1===i.CastShadows.value&&(e.castShadow=!0)}return e}createMesh(t,e,i){let r,n=null,s=null;const o=[];return t.children.forEach((function(t){e.has(t.ID)&&(n=e.get(t.ID)),i.has(t.ID)&&o.push(i.get(t.ID))})),o.length>1?s=o:o.length>0?s=o[0]:(s=new be.MeshPhongMaterial({color:13421772}),o.push(s)),"color"in n.attributes&&o.forEach((function(t){t.vertexColors=!0})),n.FBX_Deformer?(r=new be.SkinnedMesh(n,s),r.normalizeSkinWeights()):r=new be.Mesh(n,s),r}createCurve(t,e){const i=t.children.reduce((function(t,i){return e.has(i.ID)&&(t=e.get(i.ID)),t}),null),r=new be.LineBasicMaterial({color:3342591,linewidth:1});return new be.Line(i,r)}getTransformData(t,e){const i={};"InheritType"in e&&(i.inheritType=parseInt(e.InheritType.value)),i.eulerOrder="RotationOrder"in e?Ks(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(i.translation=e.Lcl_Translation.value),"PreRotation"in e&&(i.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(i.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(i.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(i.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(i.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(i.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(i.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(i.rotationPivot=e.RotationPivot.value),t.userData.transformData=i}setLookAtProperties(t,e){if("LookAtProperty"in e){Ds.get(t.ID).children.forEach((function(e){if("LookAtProperty"===e.relationship){const i=Ns.Objects.Model[e.ID];if("Lcl_Translation"in i){const e=i.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(e),Is.add(t.target)):t.lookAt((new be.Vector3).fromArray(e))}}}))}}bindSkeleton(t,e,i){const r=this.parsePoseNodes();for(const n in t){const s=t[n];Ds.get(parseInt(s.ID)).parents.forEach((function(t){if(e.has(t.ID)){const e=t.ID;Ds.get(e).parents.forEach((function(t){if(i.has(t.ID)){i.get(t.ID).bind(new be.Skeleton(s.bones),r[t.ID])}}))}}))}}parsePoseNodes(){const t={};if("Pose"in Ns.Objects){const e=Ns.Objects.Pose;for(const i in e)if("BindPose"===e[i].attrType&&e[i].NbPoseNodes>0){const r=e[i].PoseNode;Array.isArray(r)?r.forEach((function(e){t[e.Node]=(new be.Matrix4).fromArray(e.Matrix.a)})):t[r.Node]=(new be.Matrix4).fromArray(r.Matrix.a)}}return t}createAmbientLight(){if("GlobalSettings"in Ns&&"AmbientColor"in Ns.GlobalSettings){const t=Ns.GlobalSettings.AmbientColor.value,e=t[0],i=t[1],r=t[2];if(0!==e||0!==i||0!==r){const t=new be.Color(e,i,r);Is.add(new be.AmbientLight(t,1))}}}}class ks{parse(t){const e=new Map;if("Geometry"in Ns.Objects){const i=Ns.Objects.Geometry;for(const r in i){const n=Ds.get(parseInt(r)),s=this.parseGeometry(n,i[r],t);e.set(parseInt(r),s)}}return e}parseGeometry(t,e,i){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,i);case"NurbsCurve":return this.parseNurbsGeometry(e)}}parseMeshGeometry(t,e,i){const r=i.skeletons,n=[],s=t.parents.map((function(t){return Ns.Objects.Model[t.ID]}));if(0===s.length)return;const o=t.children.reduce((function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t}),null);t.children.forEach((function(t){void 0!==i.morphTargets[t.ID]&&n.push(i.morphTargets[t.ID])}));const a=s[0],l={};"RotationOrder"in a&&(l.eulerOrder=Ks(a.RotationOrder.value)),"InheritType"in a&&(l.inheritType=parseInt(a.InheritType.value)),"GeometricTranslation"in a&&(l.translation=a.GeometricTranslation.value),"GeometricRotation"in a&&(l.rotation=a.GeometricRotation.value),"GeometricScaling"in a&&(l.scale=a.GeometricScaling.value);const h=qs(l);return this.genGeometry(e,o,n,h)}genGeometry(t,e,i,r){const n=new be.BufferGeometry;t.attrName&&(n.name=t.attrName);const s=this.parseGeoNode(t,e),o=this.genBuffers(s),a=new be.Float32BufferAttribute(o.vertex,3);if(a.applyMatrix4(r),n.setAttribute("position",a),o.colors.length>0&&n.setAttribute("color",new be.Float32BufferAttribute(o.colors,3)),e&&(n.setAttribute("skinIndex",new be.Uint16BufferAttribute(o.weightsIndices,4)),n.setAttribute("skinWeight",new be.Float32BufferAttribute(o.vertexWeights,4)),n.FBX_Deformer=e),o.normal.length>0){const t=(new be.Matrix3).getNormalMatrix(r),e=new be.Float32BufferAttribute(o.normal,3);e.applyNormalMatrix(t),n.setAttribute("normal",e)}if(o.uvs.forEach((function(t,e){let i="uv"+(e+1).toString();0===e&&(i="uv"),n.setAttribute(i,new be.Float32BufferAttribute(o.uvs[e],2))})),s.material&&"AllSame"!==s.material.mappingType){let t=o.materialIndex[0],e=0;if(o.materialIndex.forEach((function(i,r){i!==t&&(n.addGroup(e,r-e,t),t=i,e=r)})),n.groups.length>0){const e=n.groups[n.groups.length-1],i=e.start+e.count;i!==o.materialIndex.length&&n.addGroup(i,o.materialIndex.length-i,t)}0===n.groups.length&&n.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(n,t,i,r),n}parseGeoNode(t,e){const i={};if(i.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],i.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(i.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(i.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(i.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){i.uv=[];let e=0;for(;t.LayerElementUV[e];)t.LayerElementUV[e].UV&&i.uv.push(this.parseUVs(t.LayerElementUV[e])),e++}return i.weightTable={},null!==e&&(i.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(r,n){void 0===i.weightTable[r]&&(i.weightTable[r]=[]),i.weightTable[r].push({id:e,weight:t.weights[n]})}))}))),i}genBuffers(t){const e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,r=0,n=!1,s=[],o=[],a=[],l=[],h=[],c=[];const d=this;return t.vertexIndices.forEach((function(u,p){let m,f=!1;u<0&&(u^=-1,f=!0);let g=[],v=[];if(s.push(3*u,3*u+1,3*u+2),t.color){const e=Qs(p,i,u,t.color);a.push(e[0],e[1],e[2])}if(t.skeleton){if(void 0!==t.weightTable[u]&&t.weightTable[u].forEach((function(t){v.push(t.weight),g.push(t.id)})),v.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);const t=[0,0,0,0],e=[0,0,0,0];v.forEach((function(i,r){let n=i,s=g[r];e.forEach((function(e,i,r){if(n>e){r[i]=n,n=e;const o=t[i];t[i]=s,s=o}}))})),g=t,v=e}for(;v.length<4;)v.push(0),g.push(0);for(let t=0;t<4;++t)h.push(v[t]),c.push(g[t])}if(t.normal){const e=Qs(p,i,u,t.normal);o.push(e[0],e[1],e[2])}t.material&&"AllSame"!==t.material.mappingType&&(m=Qs(p,i,u,t.material)[0]),t.uv&&t.uv.forEach((function(t,e){const r=Qs(p,i,u,t);void 0===l[e]&&(l[e]=[]),l[e].push(r[0]),l[e].push(r[1])})),r++,f&&(d.genFace(e,t,s,m,o,a,l,h,c,r),i++,r=0,s=[],o=[],a=[],l=[],h=[],c=[])})),e}genFace(t,e,i,r,n,s,o,a,l,h){for(let c=2;c<h;c++)t.vertex.push(e.vertexPositions[i[0]]),t.vertex.push(e.vertexPositions[i[1]]),t.vertex.push(e.vertexPositions[i[2]]),t.vertex.push(e.vertexPositions[i[3*(c-1)]]),t.vertex.push(e.vertexPositions[i[3*(c-1)+1]]),t.vertex.push(e.vertexPositions[i[3*(c-1)+2]]),t.vertex.push(e.vertexPositions[i[3*c]]),t.vertex.push(e.vertexPositions[i[3*c+1]]),t.vertex.push(e.vertexPositions[i[3*c+2]]),e.skeleton&&(t.vertexWeights.push(a[0]),t.vertexWeights.push(a[1]),t.vertexWeights.push(a[2]),t.vertexWeights.push(a[3]),t.vertexWeights.push(a[4*(c-1)]),t.vertexWeights.push(a[4*(c-1)+1]),t.vertexWeights.push(a[4*(c-1)+2]),t.vertexWeights.push(a[4*(c-1)+3]),t.vertexWeights.push(a[4*c]),t.vertexWeights.push(a[4*c+1]),t.vertexWeights.push(a[4*c+2]),t.vertexWeights.push(a[4*c+3]),t.weightsIndices.push(l[0]),t.weightsIndices.push(l[1]),t.weightsIndices.push(l[2]),t.weightsIndices.push(l[3]),t.weightsIndices.push(l[4*(c-1)]),t.weightsIndices.push(l[4*(c-1)+1]),t.weightsIndices.push(l[4*(c-1)+2]),t.weightsIndices.push(l[4*(c-1)+3]),t.weightsIndices.push(l[4*c]),t.weightsIndices.push(l[4*c+1]),t.weightsIndices.push(l[4*c+2]),t.weightsIndices.push(l[4*c+3])),e.color&&(t.colors.push(s[0]),t.colors.push(s[1]),t.colors.push(s[2]),t.colors.push(s[3*(c-1)]),t.colors.push(s[3*(c-1)+1]),t.colors.push(s[3*(c-1)+2]),t.colors.push(s[3*c]),t.colors.push(s[3*c+1]),t.colors.push(s[3*c+2])),e.material&&"AllSame"!==e.material.mappingType&&(t.materialIndex.push(r),t.materialIndex.push(r),t.materialIndex.push(r)),e.normal&&(t.normal.push(n[0]),t.normal.push(n[1]),t.normal.push(n[2]),t.normal.push(n[3*(c-1)]),t.normal.push(n[3*(c-1)+1]),t.normal.push(n[3*(c-1)+2]),t.normal.push(n[3*c]),t.normal.push(n[3*c+1]),t.normal.push(n[3*c+2])),e.uv&&e.uv.forEach((function(e,i){void 0===t.uvs[i]&&(t.uvs[i]=[]),t.uvs[i].push(o[i][0]),t.uvs[i].push(o[i][1]),t.uvs[i].push(o[i][2*(c-1)]),t.uvs[i].push(o[i][2*(c-1)+1]),t.uvs[i].push(o[i][2*c]),t.uvs[i].push(o[i][2*c+1])}))}addMorphTargets(t,e,i,r){if(0===i.length)return;t.morphTargetsRelative=!0,t.morphAttributes.position=[];const n=this;i.forEach((function(i){i.rawTargets.forEach((function(i){const s=Ns.Objects.Geometry[i.geoID];void 0!==s&&n.genMorphGeometry(t,e,s,r,i.name)}))}))}genMorphGeometry(t,e,i,r,n){const s=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],o=void 0!==i.Vertices?i.Vertices.a:[],a=void 0!==i.Indexes?i.Indexes.a:[],l=3*t.attributes.position.count,h=new Float32Array(l);for(let t=0;t<a.length;t++){const e=3*a[t];h[e]=o[3*t],h[e+1]=o[3*t+1],h[e+2]=o[3*t+2]}const c={vertexIndices:s,vertexPositions:h},d=this.genBuffers(c),u=new be.Float32BufferAttribute(d.vertex,3);u.name=n||i.attrName,u.applyMatrix4(r),t.morphAttributes.position.push(u)}parseNormals(t){const e=t.MappingInformationType,i=t.ReferenceInformationType,r=t.Normals.a;let n=[];return"IndexToDirect"===i&&("NormalIndex"in t?n=t.NormalIndex.a:"NormalsIndex"in t&&(n=t.NormalsIndex.a)),{dataSize:3,buffer:r,indices:n,mappingType:e,referenceType:i}}parseUVs(t){const e=t.MappingInformationType,i=t.ReferenceInformationType,r=t.UV.a;let n=[];return"IndexToDirect"===i&&(n=t.UVIndex.a),{dataSize:2,buffer:r,indices:n,mappingType:e,referenceType:i}}parseVertexColors(t){const e=t.MappingInformationType,i=t.ReferenceInformationType,r=t.Colors.a;let n=[];return"IndexToDirect"===i&&(n=t.ColorIndex.a),{dataSize:4,buffer:r,indices:n,mappingType:e,referenceType:i}}parseMaterialIndices(t){const e=t.MappingInformationType,i=t.ReferenceInformationType;if("NoMappingInformation"===e)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const r=t.Materials.a,n=[];for(let t=0;t<r.length;++t)n.push(t);return{dataSize:1,buffer:r,indices:n,mappingType:e,referenceType:i}}parseNurbsGeometry(t){if(void 0===be.NURBSCurve)return console.error("THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new be.BufferGeometry;const e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new be.BufferGeometry;const i=e-1,r=t.KnotVector.a,n=[],s=t.Points.a;for(let t=0,e=s.length;t<e;t+=4)n.push((new be.Vector4).fromArray(s,t));let o,a;if("Closed"===t.Form)n.push(n[0]);else if("Periodic"===t.Form){o=i,a=r.length-1-o;for(let t=0;t<i;++t)n.push(n[t])}const l=new be.NURBSCurve(i,r,n,o,a).getPoints(12*n.length);return(new be.BufferGeometry).setFromPoints(l)}}class js{parse(){const t=[],e=this.parseClips();if(void 0!==e)for(const i in e){const r=e[i],n=this.addClip(r);t.push(n)}return t}parseClips(){if(void 0===Ns.Objects.AnimationCurve)return;const t=this.parseAnimationCurveNodes();this.parseAnimationCurves(t);const e=this.parseAnimationLayers(t);return this.parseAnimStacks(e)}parseAnimationCurveNodes(){const t=Ns.Objects.AnimationCurveNode,e=new Map;for(const i in t){const r=t[i];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){const t={id:r.id,attr:r.attrName,curves:{}};e.set(t.id,t)}}return e}parseAnimationCurves(t){const e=Ns.Objects.AnimationCurve;for(const i in e){const r={id:e[i].id,times:e[i].KeyTime.a.map(Ws),values:e[i].KeyValueFloat.a},n=Ds.get(r.id);if(void 0!==n){const e=n.parents[0].ID,i=n.parents[0].relationship;i.match(/X/)?t.get(e).curves.x=r:i.match(/Y/)?t.get(e).curves.y=r:i.match(/Z/)?t.get(e).curves.z=r:i.match(/d|DeformPercent/)&&t.has(e)&&(t.get(e).curves.morph=r)}}}parseAnimationLayers(t){const e=Ns.Objects.AnimationLayer,i=new Map;for(const r in e){const e=[],n=Ds.get(parseInt(r));if(void 0!==n){n.children.forEach((function(i,r){if(t.has(i.ID)){const n=t.get(i.ID);if(void 0!==n.curves.x||void 0!==n.curves.y||void 0!==n.curves.z){if(void 0===e[r]){const t=Ds.get(i.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID;if(void 0!==t){const n=Ns.Objects.Model[t.toString()];if(void 0===n)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",i);const s={modelName:n.attrName?be.PropertyBinding.sanitizeNodeName(n.attrName):"",ID:n.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Is.traverse((function(t){t.ID===n.id&&(s.transform=t.matrix,t.userData.transformData&&(s.eulerOrder=t.userData.transformData.eulerOrder))})),s.transform||(s.transform=new be.Matrix4),"PreRotation"in n&&(s.preRotation=n.PreRotation.value),"PostRotation"in n&&(s.postRotation=n.PostRotation.value),e[r]=s}}e[r]&&(e[r][n.attr]=n)}else if(void 0!==n.curves.morph){if(void 0===e[r]){const t=Ds.get(i.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID,n=Ds.get(t).parents[0].ID,s=Ds.get(n).parents[0].ID,o=Ds.get(s).parents[0].ID,a=Ns.Objects.Model[o],l={modelName:a.attrName?be.PropertyBinding.sanitizeNodeName(a.attrName):"",morphName:Ns.Objects.Deformer[t].attrName};e[r]=l}e[r][n.attr]=n}}})),i.set(parseInt(r),e)}}return i}parseAnimStacks(t){const e=Ns.Objects.AnimationStack,i={};for(const r in e){const n=Ds.get(parseInt(r)).children;n.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=t.get(n[0].ID);i[r]={name:e[r].attrName,layer:s}}return i}addClip(t){let e=[];const i=this;return t.layer.forEach((function(t){e=e.concat(i.generateTracks(t))})),new be.AnimationClip(t.name,-1,e)}generateTracks(t){const e=[];let i=new be.Vector3,r=new be.Quaternion,n=new be.Vector3;if(t.transform&&t.transform.decompose(i,r,n),i=i.toArray(),r=(new be.Euler).setFromQuaternion(r,t.eulerOrder).toArray(),n=n.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){const r=this.generateVectorTrack(t.modelName,t.T.curves,i,"position");void 0!==r&&e.push(r)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){const i=this.generateRotationTrack(t.modelName,t.R.curves,r,t.preRotation,t.postRotation,t.eulerOrder);void 0!==i&&e.push(i)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){const i=this.generateVectorTrack(t.modelName,t.S.curves,n,"scale");void 0!==i&&e.push(i)}if(void 0!==t.DeformPercent){const i=this.generateMorphTrack(t);void 0!==i&&e.push(i)}return e}generateVectorTrack(t,e,i,r){const n=this.getTimesForAllAxes(e),s=this.getKeyframeTrackValues(n,e,i);return new be.VectorKeyframeTrack(t+"."+r,n,s)}generateRotationTrack(t,e,i,r,n,s){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(be.MathUtils.degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(be.MathUtils.degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(be.MathUtils.degToRad));const o=this.getTimesForAllAxes(e),a=this.getKeyframeTrackValues(o,e,i);void 0!==r&&((r=r.map(be.MathUtils.degToRad)).push(s),r=(new be.Euler).fromArray(r),r=(new be.Quaternion).setFromEuler(r)),void 0!==n&&((n=n.map(be.MathUtils.degToRad)).push(s),n=(new be.Euler).fromArray(n),n=(new be.Quaternion).setFromEuler(n).invert());const l=new be.Quaternion,h=new be.Euler,c=[];for(let t=0;t<a.length;t+=3)h.set(a[t],a[t+1],a[t+2],s),l.setFromEuler(h),void 0!==r&&l.premultiply(r),void 0!==n&&l.multiply(n),l.toArray(c,t/3*4);return new be.QuaternionKeyframeTrack(t+".quaternion",o,c)}generateMorphTrack(t){const e=t.DeformPercent.curves.morph,i=e.values.map((function(t){return t/100})),r=Is.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new be.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+r+"]",e.times,i)}getTimesForAllAxes(t){let e=[];if(void 0!==t.x&&(e=e.concat(t.x.times)),void 0!==t.y&&(e=e.concat(t.y.times)),void 0!==t.z&&(e=e.concat(t.z.times)),e=e.sort((function(t,e){return t-e})),e.length>1){let t=1,i=e[0];for(let r=1;r<e.length;r++){const n=e[r];n!==i&&(e[t]=n,i=n,t++)}e=e.slice(0,t)}return e}getKeyframeTrackValues(t,e,i){const r=i,n=[];let s=-1,o=-1,a=-1;return t.forEach((function(t){if(e.x&&(s=e.x.times.indexOf(t)),e.y&&(o=e.y.times.indexOf(t)),e.z&&(a=e.z.times.indexOf(t)),-1!==s){const t=e.x.values[s];n.push(t),r[0]=t}else n.push(r[0]);if(-1!==o){const t=e.y.values[o];n.push(t),r[1]=t}else n.push(r[1]);if(-1!==a){const t=e.z.values[a];n.push(t),r[2]=t}else n.push(r[2])})),n}interpolateRotations(t){for(let e=1;e<t.values.length;e++){const i=t.values[e-1],r=t.values[e]-i,n=Math.abs(r);if(n>=180){const s=n/180,o=r/s;let a=i+o;const l=t.times[e-1],h=(t.times[e]-l)/s;let c=l+h;const d=[],u=[];for(;c<t.times[e];)d.push(c),c+=h,u.push(a),a+=o;t.times=eo(t.times,e,d),t.values=eo(t.values,e,u)}}}}class Vs{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(t){this.nodeStack.push(t),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(t,e){this.currentProp=t,this.currentPropName=e}parse(t){this.currentIndent=0,this.allNodes=new Hs,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const e=this,i=t.split(/[\r\n]+/);return i.forEach((function(t,r){const n=t.match(/^[\s\t]*;/),s=t.match(/^[\s\t]*$/);if(n||s)return;const o=t.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){",""),a=t.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=t.match("^\\t{"+(e.currentIndent-1)+"}}");o?e.parseNodeBegin(t,o):a?e.parseNodeProperty(t,a,i[++r]):l?e.popStack():t.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(t)})),this.allNodes}parseNodeBegin(t,e){const i=e[1].trim().replace(/^"/,"").replace(/"$/,""),r=e[2].split(",").map((function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")})),n={name:i},s=this.parseNodeAttr(r),o=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,n):i in o?("PoseNode"===i?o.PoseNode.push(n):void 0!==o[i].id&&(o[i]={},o[i][o[i].id]=o[i]),""!==s.id&&(o[i][s.id]=n)):"number"==typeof s.id?(o[i]={},o[i][s.id]=n):"Properties70"!==i&&(o[i]="PoseNode"===i?[n]:n),"number"==typeof s.id&&(n.id=s.id),""!==s.name&&(n.attrName=s.name),""!==s.type&&(n.attrType=s.type),this.pushStack(n)}parseNodeAttr(t){let e=t[0];""!==t[0]&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));let i="",r="";return t.length>1&&(i=t[1].replace(/^(\w+)::/,""),r=t[2]),{id:e,name:i,type:r}}parseNodeProperty(t,e,i){let r=e[1].replace(/^"/,"").replace(/"$/,"").trim(),n=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===n&&(n=i.replace(/"/g,"").replace(/,$/,"").trim());const s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===r){const t=n.split(",").slice(1),e=parseInt(t[0]),i=parseInt(t[1]);let o=n.split(",").slice(3);o=o.map((function(t){return t.trim().replace(/^"/,"")})),r="connections",n=[e,i],function(t,e){for(let i=0,r=t.length,n=e.length;i<n;i++,r++)t[r]=e[i]}(n,o),void 0===s[r]&&(s[r]=[])}"Node"===r&&(s.id=n),r in s&&Array.isArray(s[r])?s[r].push(n):"a"!==r?s[r]=n:s.a=n,this.setCurrentProp(s,r),"a"===r&&","!==n.slice(-1)&&(s.a=$s(n))}else this.parseNodeSpecialProperty(t,r,n)}parseNodePropertyContinued(t){const e=this.getCurrentNode();e.a+=t,","!==t.slice(-1)&&(e.a=$s(e.a))}parseNodeSpecialProperty(t,e,i){const r=i.split('",').map((function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")})),n=r[0],s=r[1],o=r[2],a=r[3];let l=r[4];switch(s){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=$s(l)}this.getPrevNode()[n]={type:s,type2:o,flag:a,value:l},this.setCurrentProp(this.getPrevNode(),n)}}class zs{parse(t){const e=new Gs(t);e.skip(23);const i=e.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const r=new Hs;for(;!this.endOfContent(e);){const t=this.parseNode(e,i);null!==t&&r.add(t.name,t)}return r}endOfContent(t){return t.size()%16==0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()}parseNode(t,e){const i={},r=e>=7500?t.getUint64():t.getUint32(),n=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();const s=t.getUint8(),o=t.getString(s);if(0===r)return null;const a=[];for(let e=0;e<n;e++)a.push(this.parseProperty(t));const l=a.length>0?a[0]:"",h=a.length>1?a[1]:"",c=a.length>2?a[2]:"";for(i.singleProperty=1===n&&t.getOffset()===r;r>t.getOffset();){const r=this.parseNode(t,e);null!==r&&this.parseSubNode(o,i,r)}return i.propertyList=a,"number"==typeof l&&(i.id=l),""!==h&&(i.attrName=h),""!==c&&(i.attrType=c),""!==o&&(i.name=o),i}parseSubNode(t,e,i){if(!0===i.singleProperty){const t=i.propertyList[0];Array.isArray(t)?(e[i.name]=i,i.a=t):e[i.name]=t}else if("Connections"===t&&"C"===i.name){const t=[];i.propertyList.forEach((function(e,i){0!==i&&t.push(e)})),void 0===e.connections&&(e.connections=[]),e.connections.push(t)}else if("Properties70"===i.name){Object.keys(i).forEach((function(t){e[t]=i[t]}))}else if("Properties70"===t&&"P"===i.name){let t=i.propertyList[0],r=i.propertyList[1];const n=i.propertyList[2],s=i.propertyList[3];let o;0===t.indexOf("Lcl ")&&(t=t.replace("Lcl ","Lcl_")),0===r.indexOf("Lcl ")&&(r=r.replace("Lcl ","Lcl_")),o="Color"===r||"ColorRGB"===r||"Vector"===r||"Vector3D"===r||0===r.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],e[t]={type:r,type2:n,flag:s,value:o}}else void 0===e[i.name]?"number"==typeof i.id?(e[i.name]={},e[i.name][i.id]=i):e[i.name]=i:"PoseNode"===i.name?(Array.isArray(e[i.name])||(e[i.name]=[e[i.name]]),e[i.name].push(i)):void 0===e[i.name][i.id]&&(e[i.name][i.id]=i)}parseProperty(t){const e=t.getString(1);let i;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return i=t.getUint32(),t.getArrayBuffer(i);case"S":return i=t.getUint32(),t.getString(i);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=t.getUint32(),n=t.getUint32(),s=t.getUint32();if(0===n)switch(e){case"b":case"c":return t.getBooleanArray(r);case"d":return t.getFloat64Array(r);case"f":return t.getFloat32Array(r);case"i":return t.getInt32Array(r);case"l":return t.getInt64Array(r)}void 0===Fs&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const o=ss(new Uint8Array(t.getArrayBuffer(s))),a=new Gs(o.buffer);switch(e){case"b":case"c":return a.getBooleanArray(r);case"d":return a.getFloat64Array(r);case"f":return a.getFloat32Array(r);case"i":return a.getInt32Array(r);case"l":return a.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}}class Gs{constructor(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===e||e}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(t){this.offset+=t}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(t){const e=[];for(let i=0;i<t;i++)e.push(this.getBoolean());return e}getUint8(){const t=this.dv.getUint8(this.offset);return this.offset+=1,t}getInt16(){const t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}getInt32(){const t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}getInt32Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getInt32());return e}getUint32(){const t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}getInt64(){let t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),2147483648&e?(e=4294967295&~e,t=4294967295&~t,4294967295===t&&(e=e+1&4294967295),t=t+1&4294967295,-(4294967296*e+t)):4294967296*e+t}getInt64Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getInt64());return e}getUint64(){let t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),4294967296*e+t}getFloat32(){const t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}getFloat32Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getFloat32());return e}getFloat64(){const t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}getFloat64Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getFloat64());return e}getArrayBuffer(t){const e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}getString(t){let e=[];for(let i=0;i<t;i++)e[i]=this.getUint8();const i=e.indexOf(0);return i>=0&&(e=e.slice(0,i)),be.LoaderUtils.decodeText(new Uint8Array(e))}}class Hs{add(t,e){this[t]=e}}function Xs(t){const e=t.match(/FBXVersion: (\d+)/);if(e){return parseInt(e[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Ws(t){return t/46186158e3}const Ys=[];function Qs(t,e,i,r){let n;switch(r.mappingType){case"ByPolygonVertex":n=t;break;case"ByPolygon":n=e;break;case"ByVertice":n=i;break;case"AllSame":n=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(n=r.indices[n]);const s=n*r.dataSize,o=s+r.dataSize;return function(t,e,i,r){for(let n=i,s=0;n<r;n++,s++)t[s]=e[n];return t}(Ys,r.buffer,s,o)}const Js=new be.Euler,Zs=new be.Vector3;function qs(t){const e=new be.Matrix4,i=new be.Matrix4,r=new be.Matrix4,n=new be.Matrix4,s=new be.Matrix4,o=new be.Matrix4,a=new be.Matrix4,l=new be.Matrix4,h=new be.Matrix4,c=new be.Matrix4,d=new be.Matrix4,u=new be.Matrix4,p=t.inheritType?t.inheritType:0;if(t.translation&&e.setPosition(Zs.fromArray(t.translation)),t.preRotation){const e=t.preRotation.map(be.MathUtils.degToRad);e.push(t.eulerOrder),i.makeRotationFromEuler(Js.fromArray(e))}if(t.rotation){const e=t.rotation.map(be.MathUtils.degToRad);e.push(t.eulerOrder),r.makeRotationFromEuler(Js.fromArray(e))}if(t.postRotation){const e=t.postRotation.map(be.MathUtils.degToRad);e.push(t.eulerOrder),n.makeRotationFromEuler(Js.fromArray(e)),n.invert()}t.scale&&s.scale(Zs.fromArray(t.scale)),t.scalingOffset&&a.setPosition(Zs.fromArray(t.scalingOffset)),t.scalingPivot&&o.setPosition(Zs.fromArray(t.scalingPivot)),t.rotationOffset&&l.setPosition(Zs.fromArray(t.rotationOffset)),t.rotationPivot&&h.setPosition(Zs.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(d.copy(t.parentMatrix),c.copy(t.parentMatrixWorld));const m=i.clone().multiply(r).multiply(n),f=new be.Matrix4;f.extractRotation(c);const g=new be.Matrix4;g.copyPosition(c);const v=g.clone().invert().multiply(c),y=f.clone().invert().multiply(v),w=s,x=new be.Matrix4;if(0===p)x.copy(f).multiply(m).multiply(y).multiply(w);else if(1===p)x.copy(f).multiply(y).multiply(m).multiply(w);else{const t=(new be.Matrix4).scale((new be.Vector3).setFromMatrixScale(d)).clone().invert(),e=y.clone().multiply(t);x.copy(f).multiply(m).multiply(e).multiply(w)}const b=h.clone().invert(),_=o.clone().invert();let A=e.clone().multiply(l).multiply(h).multiply(i).multiply(r).multiply(n).multiply(b).multiply(a).multiply(o).multiply(s).multiply(_);const S=(new be.Matrix4).copyPosition(A),T=c.clone().multiply(S);return u.copyPosition(T),A=u.clone().multiply(x),A.premultiply(c.invert()),A}function Ks(t){const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(t=t||0)?(console.warn("THREE.FBXLoader: unsupported THREE.Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[t]}function $s(t){return t.split(",").map((function(t){return parseFloat(t)}))}function to(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),be.LoaderUtils.decodeText(new Uint8Array(t,e,i))}function eo(t,e,i){return t.slice(0,e).concat(i).concat(t.slice(e))}const io=new class{constructor(t){this._db=null,this._transaction=null,this._request=null,this._cacheTableName="resources",this._dbName="thing",this._dbversion=1}async initDB(t){let e=indexedDB.open(this._dbName,this._dbversion);return new Promise(((t,i)=>{e.onerror=()=>{console.log("error: create db error"),i()},e.onupgradeneeded=t=>{t.currentTarget.result.createObjectStore(this._cacheTableName,{keyPath:"id"}).createIndex("INDEX_ID","id",{unique:!0})},e.onsuccess=e=>{t(e.target.result)}}))}async get(t){return this._db=await this.initDB(),new Promise(((e,i)=>{let r=this._db.transaction(this._cacheTableName,"readwrite").objectStore(this._cacheTableName).get(t);r.onsuccess=t=>{r.result?e(r.result.resource):this.resolve(null)},r.onerror=()=>{e(t)}}))}async set(t){return this._db=await this.initDB(),new Promise(((e,i)=>{let r=this._db.transaction(this._cacheTableName,"readwrite").objectStore(this._cacheTableName).add({id:t.id,resource:t.data});r.onerror=e=>{i(t)},r.onsuccess=i=>{e(t)}}))}clear(){if(!this._db)return;this._db.transaction(this._cacheTableName,"readwrite").objectStore(this._cacheTableName).clear()}async loadNetSource(t){return new Promise(((e,i)=>{fetch(t).then((r=>{200===r.status?r.blob().then((r=>{let n=this._db.transaction(this._cacheTableName,"readwrite").objectStore(this._cacheTableName).add({id:t,blob:r});n.onerror=e=>{console.log("缓存失败"),i(t)},n.onsuccess=i=>{console.log(`创建${t}缓存成功`),e(r)}})):(console.log("未找到缓存资源"),i(t))}))}))}async cacheModel(t){return this._db=await this.initDB(),new Promise(((e,i)=>{let r=this._db.transaction(this._cacheTableName,"readwrite").objectStore(this._cacheTableName).get(t);r.onsuccess=i=>{if(!r.result)return void this.loadNetSource(t).then((t=>{let i=URL.createObjectURL(t);e(i)})).catch((i=>{e(t)}));let n=URL.createObjectURL(r.result.blob);e(n)},r.onerror=()=>{e(t)}}))}async deleteModel(t){return new Promise(((e,i)=>{let r=this._db.transaction(this._cacheTableName,"readwrite").objectStore(this._cacheTableName).get(t);r.onsuccess=()=>{console.log("删除成功"),e("删除成功")},r.onerror=t=>{console.log("删除失败"),i(t)}}))}};window.dbUtil=io;const{EventDispatcher:ro,FileLoader:no,TextureLoader:so,ImageLoader:oo}=be,ao=1,lo=2,ho=3,co="resource.error",uo="resource.loaded";class po extends ui{constructor(t,e,i){if(!t||!Q(t))throw new Error("Resource ID must be uri");super(),this.id=t,this.data=null,this.fileType=_t(t),this.type=e,this.count=0,this.progress=0,this.objects=[],this.config=i,this.status=Qt,this.updated=(new Date).getTime(),io.initDB()}addObject(t,e){t&&(this.hasObject(t)||(this.objects.push(t),this.data&&this.status===Zt?t.dispatchEvent({type:uo,resource:this,config:e}):this.status===qt?t.dispatchEvent({type:co,resource:this,config:e}):(this.once("loaded",(i=>{t.dispatchEvent({type:uo,resource:this,config:e})})),this.once("error",(i=>{t.dispatchEvent({type:co,resource:this,message:i.message,config:e})})))))}removeObject(t){t&&st(this.objects,"uuid",t.uuid)}hasObject(t){let e=!1;if(t)for(let i=0;i<this.objects.length;i++)if(this.objects[i]===t){e=!0;break}return e}cloneData(){return this.data?this.data.clone?void 0:this.data:null}get refCount(){return this.objects.length}toJSON(){return{id:this.id,type:this.type,config:this.config}}}const mo=new class extends ui{constructor(t){if(super(),this.viewer=null,this.data={},this.list=[],this._preloadAllSign=!1,this._loadedStep=0,this._allLoading=ao,this.loadingManager=new be.LoadingManager((()=>{this.fire({type:"loaded"})}),((t,e,i)=>{const r=ct(e/i*100,1);this.fire({type:"progress",progress:r,url:t,total:i})})),this.materials={},this.geometries={},this.textures={},this.objects={},this.materialsRefCounter=new Map,W(t)){const e=ot(t,((t,e)=>t.type===e.type&&t.id===e.id));e.forEach((t=>{this.set(t.id,t.type)}))}this.addEventListener(uo,(t=>{if(t.requestAll){const t=this.getResourcesCount();this._loadedStep+=1;let e=Math.round(100*this._loadedStep/t);100===e?(this._loadedStep=0,this._allLoading=ho):this._allLoading=lo,this.dispatchEvent({type:"progress.update",progress:e})}}))}transformUrl(t){return 0==t.indexOf("./")||0==t.indexOf("//")||0==t.indexOf("http://")||t.indexOf("https://"),t}setViewer(t){this.viewer=t}getRenderer(){const t=this.viewer;return t&&t.rendererManager.renderer}getMaxAnisotropy(){const t=this.getRenderer();return t&&t.capabilities.getMaxAnisotropy()||1}getResourcesCount(){return Object.keys(this.data).length}preloadAll(){if(this._allLoading!==lo){this._allLoading=ao;for(const t in this.data){const e=t.split("_");this.preload(e[0],e[1],!0)}}}toJSON(){const t=[];for(const e in this.data){const i=this.data[e];t[e]={type:i.type}}return t}get(t,e){if(!t||!e)return null;let i=t+"_"+e;return this.data[i]}getById(t){for(const e in Kt){let i=e.toLocaleLowerCase()+"_"+t;const r=this.data[i];if(r)return r}return null}getData(t,e){const i=this.get(t,e);return i&&i.status==Zt?i.data:null}set(t){const{id:e,type:i,object:r,data:n,config:s,cache:o}=t||{};if(!e||!i)return null;const a=i+"_"+e;let l=this.data[a];return l&&l.type===i?(r&&l.addObject(r,s),l.status===Zt&&this.dispatchEvent({type:uo,resource:l}),l):(l||(this.list.push({id:a,type:i}),l=this.data[a]=new po(e,i,s),l.cache=o,n&&this.setResourceData(l,n)),r&&l.addObject(r,s),l.status===Qt&&this.preload(e,i),l.status===Zt?(this.dispatchEvent({type:uo,resource:l}),l):l)}preload(t,e,i){if(t&&e&&this.get(e,t))switch(e){case Kt.IMAGE:this.preloadImage(t,i);break;case Kt.TEXTURE:this.preloadTexture(t,i);break;case Kt.MODEL:this.preloadModel(t,i);break;case Kt.CubeTexture:this.preloadCubeTexture(t,i);break;case Kt.WebView:this.preloadWebView(t,i);break;case Kt.SHADER:break;case Kt.VIDEO:this.preloadVideo(t,i)}}clear(){this.data={},this.list=[],this._preloadAllSign=!1,this.dispatchEvent({type:"clear"})}delete(t,e){const i=this.get(t,e);let r=!0,n="";return i&&(e=t+"_"+e,i.refCount>0?(r=!1,n="Some objects are referencing resource, the resource can't be deleted"):(delete this.data[e],st(this.list,"id",e))),{status:r,error:n,resource:i}}preloadVideo(t,e){const i=this.get(Kt.VIDEO,t);if(!i)return;if(i.status===Zt)return void this.dispatchEvent({type:uo,resource:i,requestAll:e});i.isVideo=!0,i.status=Jt;const r=i.config||{},{loop:n,muted:s,autoplay:o,uvRepeat:a}=r.oldTextureConfig||r;let l=r.width||1920,h=r.height||1080;const c=document.createElement("video");c.id=be.Math.generateUUID(),c.width=l,c.height=h,c.style.width=l+"px",c.style.height=h+"px",c.src=this.transformUrl(i.id),c.muted=!0,c.autoplay=void 0===o||!!o,c.loop=void 0===n||!!n,c.style.display="none",c.autoplay&&c.play();const d=new be.VideoTexture(c);d.wrapS=be.ClampToEdgeWrapping,d.wrapT=be.ClampToEdgeWrapping,d.minFilter=be.LinearFilter,d.magFilter=be.LinearFilter,d.format=be.RGBAFormat,d.encoding=be.sRGBEncoding,d.image.crossOrigin="*",this.setResourceData(i,d,e),setTimeout((()=>{d.image.muted=!!s}),3e3)}preloadTexture(t,e){const i=this.get(Kt.TEXTURE,t);if(!i||i.type!==Kt.TEXTURE)return;if(i.status===Jt)return;if(i.status===Zt)return void this.dispatchEvent({type:uo,resource:i,requestAll:e});i.status=Jt;const r=this;_t(i.id||"").indexOf("mp4")>=0?this.preloadVideo(t,e):new so(this.loadingManager).setCrossOrigin("anonymous").load(this.transformUrl(i.id),(t=>{const n=t.image;t.encoding=be.sRGBEncoding,n&&(wt(n.width)&&wt(n.height)?(t.wrapS=be.RepeatWrapping,t.wrapT=be.RepeatWrapping,t.minFilter=be.LinearMipmapLinearFilter,t.magFilter=be.LinearFilter):(t.wrapS=be.ClampToEdgeWrapping,t.wrapT=be.ClampToEdgeWrapping,t.minFilter=be.LinearFilter,t.magFilter=be.LinearFilter),t.anisotropy=r.getMaxAnisotropy()),r.setResourceData(i,t,e)}),void 0,(t=>{r.setResourceError(i,null,e)}))}preloadCubeTexture(t,e){const i=this.get(Kt.CubeTexture,t);if(!i||i.type!==Kt.CubeTexture)return;if(i.status===Jt)return;if(i.status===Zt)return void this.dispatchEvent({type:uo,resource:i,requestAll:e});if(!i.config&&!i.config.path)return void this.setResourceError(i,"CubeTexture Resource Config is null",e);i.status=Jt;let r=this.transformUrl(i.config.path);const n=i.config.files||["posx.jpg","negx.jpg","posy.jpg","negy.jpg","posz.jpg","negz.jpg"],s=new be.CubeTextureLoader(this.loadingManager);r&&s.setPath(r),s.load(n,(t=>{t.format=be.RGBAFormat,t.encoding=be.sRGBEncoding,this.setResourceData(i,t,e)}),null,(t=>{this.setResourceError(i,"CubeTexture init error",e)}))}preloadImage(t,e){const i=this.get(Kt.IMAGE,t);if(!i||i.type!==Kt.IMAGE)return;if(i.status===Zt)return void this.dispatchEvent({type:uo,resource:i,requestAll:e});const r=this;i.width=0,i.height=0;const n=new oo(this.loadingManager);n.setCrossOrigin("*"),n.load(this.transformUrl(i.id),(t=>{i.width=t.width,i.height=t.height,r.setResourceData(i,t,e)}),null,(t=>{i.data=rt,i.progress=-1,i.status=qt,r.setResourceError(i,null,e)}))}preloadWebView(t,e){const i=this.get(Kt.WebView,t);if(!i||i.type!==Kt.WebView)return;if(i.status===Zt)return void this.dispatchEvent({type:uo,resource:i,requestAll:e});const r=i.config;if(!r||!r.viewer)return void this.setResourceError(i,"WebView Resource Config is null",e);const{viewer:n}=r,s=document.createElement("iframe");s.src=this.transformUrl(i.id),s.style.border="none",this.setResourceData(i,{getMixerPlane:function(t){return si(n.webviewManager.mixerContext,s,t)}},e)}preloadModel(t,e){const i=this.get(Kt.MODEL,t);if(!i||i.type!==Kt.MODEL||!i.config)return;if(i.status===Zt)return void this.dispatchEvent({type:uo,resource:i,requestAll:e});i.status=Jt;const{src:r,modelType:n,type:s}=i.config;switch((n||s).toLocaleLowerCase()){case"obj":if(q(r))this._loadObjModel(r,i,e);else if(Q(r)){var o=new no(this.loadingManager);o.setResponseType("json"),o.load(this.transformUrl(r),(t=>{t?this._loadObjModel(t,i,e):this.setResourceError(i,i.id+" is empty.",e)}),null,(t=>{i.data=null,i.status=qt,i.progress=-1,this.dispatchEvent({type:uo,resource:i,requestAll:e})}))}break;case"gltf":Q(r)&&this._loadGLTFModel(this.transformUrl(r),i,e);break;case"fbx":Q(r)&&this._loadFBXModel(this.transformUrl(r),i,e)}}_loadObjModel(t,e,i){if(!t||!e)return;const{type:r,obj:n,mtl:s,path:o}=t;if("obj"!==r)return;const a=this.transformUrl(o||At(e.id))+"/";Ke({loadingManager:this.loadingManager,obj:n,mtl:s,path:a,loadedCallback:t=>{this.setResourceData(e,t,i)},progressCallback:t=>{this.setResourceProgress(e,t,i)},errorCallback:()=>{this.setResourceError(e,i)}})}_loadGLTFModel(t,e,i){if(!t||!e)return;const{path:r,fileName:n}=St(t);if(e.cache){const t=new mi(this.loadingManager);this.dracoLoader&&t.setDRACOLoader(this.dracoLoader),io.cacheModel(r+n).then((r=>{t.load(r,(t=>{this.setResourceData(e,t,i)}),(t=>{this.setResourceProgress(e,t,i)}),(t=>{console.log(t),this.setResourceError(e,i)}))}))}else{const t=new mi(this.loadingManager).setPath(r);this.dracoLoader&&t.setDRACOLoader(this.dracoLoader),t.load(n,(t=>{this.setResourceData(e,t,i)}),(t=>{this.setResourceProgress(e,t,i)}),(t=>{console.log(t),this.setResourceError(e,i)}))}}_loadFBXModel(t,e,i){const r=new Us(this.loadingManager);e.cache?io.cacheModel(t).then((t=>{r.load(t,(t=>{this.setResourceData(e,t,i)}),(t=>{this.setResourceProgress(e,t,i)}),(t=>{console.log(t),this.setResourceError(e,i)}))})):r.load(t,(t=>{this.setResourceData(e,t,i)}),(t=>{this.setResourceProgress(e,t,i)}),(t=>{console.log(t),this.setResourceError(e,i)}))}setDracoLoader({path:t}){let e=new fr(this.loadingManager);e.setDecoderPath(t||"./libs/thing/draco/"),e.setDecoderConfig({type:"js"}),e.preload(),this.dracoLoader=e}setResourceProgress(t,e,i){t.progress=e,this.dispatchEvent({type:"resource.progress",progress:e,requestAll:i})}setResourceData(t,e,i){t.data=e,t.status=Zt,t.progress=100,this.dispatchEvent({type:uo,resource:t,requestAll:i}),t.fire({type:"loaded",resource:t})}setResourceError(t,e,i){t.data=null,t.status=qt,t.progress=-1,this.dispatchEvent({type:uo,resource:t,requestAll:i}),t.fire({type:"error",message:e})}nameObject(t,e){t.name=e}addObject(t){t.traverse((t=>{void 0!==t.geometry&&this.addGeometry(t.geometry),void 0!==t.material&&this.addMaterial(t.material)}))}removeObject(t){if(null!==t.parent){var e=this;t.traverse((function(t){e.removeCamera(t),e.removeHelper(t),void 0!==t.material&&e.removeMaterial(t.material)})),t.parent.remove(t)}}addGeometry(t){t&&(this.geometries[t.uuid]=t)}setGeometryName(t,e){t.name=e}addMaterial(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;e++)this.addMaterialToRefCounter(t[e]);else this.addMaterialToRefCounter(t)}addMaterialToRefCounter(t){if(t){var e=this.materialsRefCounter,i=e.get(t);void 0===i?(e.set(t,1),this.materials[t.uuid]=t):(i++,e.set(t,i))}}removeMaterial(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;e++)this.removeMaterialFromRefCounter(t[e]);else this.removeMaterialFromRefCounter(t)}removeMaterialFromRefCounter(t){var e=this.materialsRefCounter,i=e.get(t);0===--i?(e.delete(t),delete this.materials[t.uuid]):e.set(t,i)}getMaterialRefCounter(t){return this.materialsRefCounter.get(t)||0}getMaterialById(t){for(var e,i=Object.values(this.materials),r=0;r<i.length;r++)if(i[r].id===t){e=i[r];break}return e}setMaterialName(t,e){t.name=e}},fo="_init_",go=["map","alphaMap","aoMap","bumpMap","displacementMap","envMaps","emissiveMap","envMap","lightMap","metalnessMap","normalMap","roughnessMap","gradientMap","specularMap","clearcoatNormalMap"],vo=["color","emissive","specular","attenuationColor","sheenColor","specularColor"];function yo(t,e){t&&void 0!==t[fo+e]&&(t[e]=t[fo+e],delete t[fo+e],t.needsUpdate=!0)}const wo=new class{constructor(){this.materials={},this.textures={},this.objects={},this.materialsRefCounter=new Map,this.viewers=[]}addViewer(t){this.viewers.includes(t)||this.viewers.push(t)}removeViewer(t){this.viewers=this.viewers.filter((e=>e!=t))}enbaleRender(){this.viewers.forEach((t=>{t.rendererManager.enableRender()}))}setTexture(t,e,i){if(t&&e&&i)if(i.image&&(t[e]=null),t[e])void 0===i.image||i.image||(t[e]=null,delete i.image),r(t[e],i),t.needsUpdate=!0;else if(i.image||i.path){const n={...i};delete n.image;let s="envMap"==e?Kt.CubeTexture:Kt.TEXTURE,o="envMap"==e?i.path:i.image,a=mo.get(s,o);if(a||(a=mo.set({type:s,id:o,config:n,object:t})),a.data){let i=a.data?.clone();r(i,a.config),t[e]=i,t.needsUpdate=!0}else a.on("loaded",(i=>{let s=a.data?.clone();r(s,n),t[e]=s,t.needsUpdate=!0,this.enbaleRender()}))}function r(t,e){if(t){for(const i in e){const r=e[i];void 0!==r&&(["center","repeat","offset"].includes(i)?t[i].fromArray(r):i.toLowerCase().indexOf("color")>=0?t[i]?t[i].isColor?t[i].setHex(r):t[i]=r:t[i]=r?ni(r):null:t[i]=r)}return t.needsUpdate=!0,t}}}setUniforms(t,e){if(t&&t.uniforms&&e)for(const i in e)if(t.uniforms[i]){let r=i.toLowerCase(),n=e[i];r.indexOf("color")>=0?t.uniforms[i].value.setHex(n):r.indexOf("resolution")>=0?t.uniforms[i].value.fromArray(n):t.uniforms[i].value=n}}backupMaterial(t,e){t.userData.skipStyle||t.isHelper||(Array.isArray(t.material)?(t._init_material&&Array.isArray(t._init_material)||(t._init_material=[]),t.material.forEach(((i,r)=>{i?t._init_material[r]||(t._init_material[r]=i,e&&(t.material[r]=i.clone())):t._init_material[r]}))):(t._init_material||(t._init_material=t.material),e&&(t.material=t.material.clone())))}resetMaterial(t,e){t&&t.traverse((t=>{const i=t.material;if(i)if(e)Array.isArray(i)?i.forEach((t=>{yo(t,e)})):yo(i,e);else if(Array.isArray(i))i.forEach((t=>{for(const e in t)yo(t,e)}));else for(const t in i)yo(i,t)}))}_needResetMaterial(t,e,i){return"transparent"==e&&0==i&&void 0!==t[fo+e]&&(yo(t,e),void 0!==t._init_opacity&&yo(t,"opacity"),!0)}_updateMaterialValue(t,e,i){if(t&&void 0!==t[e]&&"type"!=e){if(function(t,e,i){t&&void 0===t[fo+e]&&(t[fo+e]=i&&i.clone?i.clone():i)}(t,e,t[e]),vo.includes(e))return null===i?t[e]=null:t[e]&&!t[e].isColor||(t[e]=ni(i)),void(t.needsUpdate=!0);if(e.indexOf("Scale")>0||e.indexOf("Position")>0)return Lt(t[e])&&(isNaN(t[e])?t[e].fromArray(i):t[e]=i),void(t.needsUpdate=!0);if(go.includes(e))i?void 0===i&&tt(i)||this.setTexture(t,e,i):(t[e]=null,t.needsUpdate=!0);else{if("uniforms"==e&&t.uniforms)return console.log(i),void this.setUniforms(t,i);this._needResetMaterial(t,e,i)||(t[e]=i),t.needsUpdate=!0}}}updateMaterial(t,e){if(!t.material||!e||t.userData.skipStyle||t.isHelper)return;let i=e.slot;if(Array.isArray(t.material)){const{materialSlot:r}=t.geometry;if(Lt(i)){let n=Q(i)&&r?r[i]:i;if(J(n)&&t.material[n]){e.type&&t.material.type!==e.type&&(t.material[n]=new THREE[e.type]);for(const i in e)this._updateMaterialValue(t.material[n],i,e[i])}}else Array.isArray(e)?e.forEach((e=>{let n=Q(e.slot)&&r?r[e.slot]:i;t.material[n]&&e.type&&t.material[n].type!==e.type&&(t.material[n]=new THREE[e.type]);for(const i in e)"slot"!==i&&"type"!==i&&this._updateMaterialValue(t.material[n],i,e[i])})):t.material.forEach(((i,r)=>{i.type&&t.material[r].type!==i.type&&(t.material[r]=new THREE[i.type]);for(const t in e)this._updateMaterialValue(i,t,e[t])}))}else{if(Array.isArray(e)){const{materialArraySize:i,materialSlot:r}=t.geometry,n=t.material.clone();let s=new Array(i||e.length).toString().split(",").map((t=>t.type?new THREE[t.type]:n.clone()));return e.forEach(((t,e)=>{let i=e;Lt(t.slot)&&(J(t.slot)&&(i=t.slot),r&&Q(t.slot)&&void 0!==r[t.slot]&&(i=r[t.slot]));let n=s[i];for(const e in t)this._updateMaterialValue(n,e,t[e])})),void(t.material=s)}e.type&&t.material.type!==e.type&&(t.material=new THREE[e.type]);for(const i in e)this._updateMaterialValue(t.material,i,e[i])}}createMaterial(t,e){t=t||"MeshStandardMaterial";let i=THREE[t]&&new THREE[t];if(i&&i.isMaterial&&!tt(e))for(const t in e)this._updateMaterialValue(i,t,e[t]);return i}toJSON(t,e){const i=t.toJSON();if(delete i.uuid,e){const e=new THREE[t.type];for(const r in i){if(vo.includes(r)&&(t[r]&&!e[r].equals(t[r])?i[r]=new THREE.Color(i[r]).toHexString():delete i[r]),go.includes(r)&&i[r]){i[r]={image:t[r].image.src};const e=new THREE.Texture,n=["wrapS","wrapT","image","listeners","version","uuid","anisotropy","encoding","userData","matrix"];for(const s in t[r])if(!n.includes(s)){const n=t[r][s];Lt(n)&&(n.equals?n.equals(e[s])||(n.toArray?i[r][s]=n.toArray():n.toHexString&&(i[r][s]=n.toHexString())):n!=e[s]&&(Array.isArray(n)?n.length>0&&(i[r][s]=n):q(n)?tt(n)&&(i[r][s]=n):i[r][s]=n))}}"type"!==r&&t[r]==e[r]&&delete i[r]}}else for(const e in i){const r=i[e];vo.includes(e)&&r&&(i[e]=new THREE.Color(r).toHexString()),go.includes(e)&&r&&(i[e]={image:t[e].image.src})}return i}fromJSON(t){if(!t.type||!THREE[t.type])return null;const e=new THREE[t.type];for(const i in t)"type"==i||"meta"==i||this._updateMaterialValue(e,i,t[i]);return e}},xo={icon:"",fill:!1,fillColor:"#000000",fontSize:14,fontColor:"#111111",fontFamily:"Microsoft Yahei, Times, serif",fontWeight:"normal",fontVariant:"normal",lineGap:6,padding:4,textAlign:"left",textVisible:!0,iconVisible:!0,iconWidth:32,iconHeight:32,iconRotate:0,iconMargin:4,offsetX:0,offsetY:0,strokeWidth:2,strokeColor:"rgba(255,255,255,.85)",outlineWidth:0,outlineColor:"#FFFFFF",text:"",iconPosition:Yt.LEFT,forcePowerOf2:!1};function bo(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function _o(t,e){let i=0,r=t.length;for(let e=0,n=1,s=2;s<r;n++,s++){let r=t[e].distanceTo(t[n]),o=t[n].distanceTo(t[s]),a=(r+o+t[s].distanceTo(t[e]))/2;i+=Math.sqrt(a*(a-r)*(a-o)*(a-o))}return i.toFixed(e||2)}function Ao(t,e,i){var r=new be.Vector3,n=new be.Vector3;r=t.clone().sub(e),n=t.clone().sub(i);var s=new be.Vector3;return s.crossVectors(r,n),s.length()/2}function So(t,e,i){return(-(i.x*e.y*t.z)+e.x*i.y*t.z+i.x*t.y*e.z-t.x*i.y*e.z-e.x*t.y*i.z+t.x*e.y*i.z)/6}function To(t,e){return Math.sqrt(t*t+e*e)}function Eo(t,e){for(var i=t.concat([t[0]]),r=[],n=i.length,s=0;s<n;s++){var o=i[s],a=i[0==s?n-1:s-1],l=i[s==n-1?0:s+1];if(a&&l){var h=a[0]-o[0],c=a[1]-o[1],d=To(h,c);0!==d&&(h/=d,c/=d);var u=l[0]-o[0],p=l[1]-o[1],m=To(u,p);0!==m&&(u/=m,p/=m);var f=h+u,g=c+p,v=-e/Math.sqrt((1-(h*u+c*p))/2)/To(f,g);f*=v,g*=v,r[s]=[f+o[0],g+o[1]]}}return r.pop(),r.push(r[0]),r}class Po extends be.CanvasTexture{constructor(t){super(document.createElement("canvas"),void 0,void 0,void 0,be.LinearFilter,be.LinearFilter);const e=pt(et(xo),t||{});for(const t in e)this[`_${t}`]=e[t];e.icon&&(it(e.icon)||e.icon instanceof HTMLElement||(this._iconResource=mo.set({id:e.icon,type:Kt.IMAGE,object:this}),this.addEventListener("resource.loaded",(t=>{this.needsRedraw=!0,this.redraw()})))),this.needsRedraw=!0,this._outlineTimer=null}get pixelSize(){return this.fontSize/72*96*2}get isTexture(){return!0}get isLabelTexture(){return!0}get lines(){let{text:t,textVisible:e}=this;return e&&""!==t&&Lt(t)?String(t).split("\n"):[]}get textWidth(){let{fontFamily:t,fontStyle:e,fontVariant:i,fontWeight:r,fontSize:n,lines:s,textVisible:o}=this;if(o&&s.length){let o=document.createElement("canvas").getContext("2d");return o.font=bt(t,n,e,i,r),Pt(s.map((t=>o.measureText(t).width)))}return 0}get iconSize(){let t=this.iconWidth,e=this.iconHeight;return t&&e?{width:t,height:e}:this.iconNatureSize}get iconNatureSize(){const t=this._iconResource;return{width:t?t.width:0,height:t?t.height:0}}get textHeight(){let{lineGap:t,lines:e,fontSize:i}=this;return e.length?e.length*i+t*(e.length-1):0}get width(){let t,{text:e,icon:i,padding:r,textWidth:n,iconMargin:s,iconPosition:o,outlineWidth:a,textVisible:l,iconVisible:h}=this,c=this.iconSize;if(!Lt(e)||!l)return this.roundUpPowerOf2(c.width+2*a+2*r);if(!i||!h)return this.roundUpPowerOf2(n+2*a+2*r);switch(o.toLowerCase()){case Yt.LEFT:case Yt.TOP_LEFT:case Yt.TOP_RIGHT:case Yt.BOTTOM_LEFT:case Yt.BOTTOM_RIGHT:case Yt.RIGHT:t=2*r+n+c.width+2*a+s;break;default:t=2*r+Math.max(n,c.width)+2*a+s}return this.roundUpPowerOf2(t)}get height(){let{text:t,padding:e,textHeight:i,iconMargin:r,iconPosition:n,icon:s,outlineWidth:o,iconVisible:a,textVisible:l}=this;const h=this.iconSize;if(!s||!a)return this.roundUpPowerOf2(2*e+i+2*o-2);if(!Lt(t)||!l)return this.roundUpPowerOf2(h.height+2*o+2*e);let c=2*e+2*o;switch(n){case Yt.TOP:case Yt.BOTTOM:c+=i+h.height+r;break;default:c+=Math.max(i,h.height)}return this.roundUpPowerOf2(c)}roundUpPowerOf2(t){return this.forcePowerOf2?bo(t):t}redraw(){let{needsRedraw:t,image:e}=this;if(!t||!e)return;let{fontSize:i,height:r,width:n}=this;if(n&&r){e.width=512,e.height=512;let{textAlign:t,fill:s,fillColor:o,fontColor:a,fontFamily:l,fontStyle:h,fontVariant:c,fontWeight:d,lineGap:u,lines:p,padding:m,text:f,strokeColor:g,strokeWidth:v,textWidth:y,textHeight:w,icon:x,iconRotate:b,iconPosition:_,iconMargin:A,outlineWidth:S,outlineColor:T,iconVisible:E,textVisible:P}=this;const M=this.iconSize,C=M.height,L=M.width;let R=0,O=0,N=0,D=0;R=O=N=D=m+S;const I=_.toLowerCase();let U=e.getContext("2d");if(U.clearRect(0,0,e.width,e.height),U.scale(512/n,512/r),U.save(),s&&o&&(U.fillStyle=o,U.fillRect(0,0,n,r)),f&&P){switch(E&&x&&I.includes("left")&&(t="right",I===Yt.TOP_LEFT&&(D=r-m-S-w),I===Yt.LEFT&&(D=r/2-w/2)),E&&x&&I.includes("right")&&(R=y+A+m+S,t="left",I===Yt.TOP_RIGHT&&(D=r-m-S-w),I===Yt.RIGHT&&(D=r/2-w/2)),E&&x&&"top"===I&&(R=n/2-L/2,D+=C+A),E&&x&&"bottom"===I&&(R=n/2-L/2,O=w+D+A),E&&x&&I.indexOf("center")>=0&&(R=n/2-L/2,D=r/2-w/2),U.textAlign=t,U.font=bt(l,i,h,c,d),U.textBaseline="top",U.fillStyle=a,U.miterLimit=1,U.lineWidth=v,U.strokeStyle=g,t){case"right":N=n-m-S;break;case"center":N=n/2;break;case"left":N=m+S}p.forEach((t=>{v&&U.strokeText(t,N,D),U.fillText(t,N,D),D+=i+u}))}if(x&&E){let t=x;this._iconResource&&(t=this._iconResource.data),F(t)&&(b?(U.translate(R+L/2,O+C/2),U.rotate(b),U.drawImage(t,-L/2,-C/2,L,C),U.rotate(-1*b),U.translate(-R-L/2,-O-C/2)):U.drawImage(t,R,O,L,C))}S&&(U.miterLimit=0,U.strokeStyle=T,U.lineWidth=S,U.strokeRect(Math.max(S/2,1),Math.max(S/2,1),n-S,r-S)),U.restore()}else e.width=e.height=1;this.needsRedraw=!1,this.needsUpdate=!0}dispose(){this._iconResource&&this._iconResource.removeObject(this),be.CanvasTexture.prototype.dispose.call(this)}}Object.keys(xo).forEach((t=>{Object.defineProperty(Po.prototype,t,{get(){return this[`_${t}`]},set(e){this[`_${t}`]!==e&&(this[`_${t}`]=e,"icon"===t&&(this._iconResource&&(this._iconResource.removeObject(this),this._iconResource=null),e&&(it(e)||e instanceof HTMLElement||(this._iconResource=mo.set({id:e,type:Kt.IMAGE,object:this})))),this.needsRedraw=!0,this.redraw())}})}));class Mo extends be.Object3D{constructor(t,e){super(),this.isThing=!0,this._initOption(t),this.setupCommonEvent()}_initOption(t){this.option||(this.option={}),pt(this.option,t||{});const{uuid:e,name:i,visible:r,frustumCulled:n,renderOrder:s,layers:o,position:a,scale:l,rotation:h,matrix:c,up:d,mesh:u,geometry:p,material:m,interact:f,properties:g,refPositions:v,castShadow:y,receiveShadow:w,userData:x,locked:b}=this.option;if(e&&(this.uuid=e),i&&(this.name=i),Lt(r)&&(this.visible=r),a&&this.position&&this.position.copy(ti(a)),Lt(l)&&(J(l)?this.scale.setScalar(l):this.scale.copy(ti(l))),h){const t=ti(h);this.rotation.set(t.x,t.y,t.z)}if(Lt(n)&&(this.frustumCulled=n),Lt(s)&&(this.renderOrder=s),Lt(y)&&(this.castShadow=y),Lt(w)&&(this.receiveShadow=w),Lt(o)&&this.layers.set(o),Lt(b)&&(this.locked=b),this.interact={selectable:!0},Lt(f)&&pt(this.interact,f),x)for(const t in x)this.userData[t]=x[t];c&&this.matrix.copy(c),this.setProperties(g),this.name||(this.name=this.properties.name||""),this.scene=null,this.tickable=!1,this._eventInited=!1,this.setupStyle()}setupCommonEvent(){return this.addEventListener("added",(function(t){const e=t.target;if(e){if(!e.scene){const i=ai(t.target);i.isScene&&(e.scene=i,e.traverse((t=>{t.scene=i})))}e.scene&&(e.scene.dispatchEvent({type:ee,action:"object.added",object:e}),e.dispatchEvent({type:te,scene:e.scene})),e.tickable=!0}})),this.addEventListener("removed",(function(t){const e=t.target;e&&(e.resource&&(e.resource.removeObject(e),e.resource=null),e.scene&&e.scene.dispatchEvent({type:ee,action:"object.removed",object:e}),e.tickable=!1)})),this}setBeforeRender(t){this.traverseChild((e=>{oi(e)&&(e.onBeforeRender=t||(()=>{}))}))}setAfterRender(t){this.traverseChild((e=>{oi(e)&&(e.onAfterRender=t||(()=>{}))}))}onBeforeRender(){this.tickable&&(this.tickable=!1)}clearResource(){return this.resource&&(this.resource.removeObject(this),this.resource=null),this}clear(){const t=this.children||[];for(var e=0;e<t.length;e++)t[e]&&(t[e].parent=null,t[e].dispatchEvent({type:"removed"}));this.children=[]}setOption(t){this.updateBy(t)}setupStyle(){const t=this,e=this._easyStyle={transparent:!1,opacity:1,side:0,color:"#ffffff",emissive:"#000000",wireframe:!1,edge:!1,edgeColor:"#000000",edgeOpacity:1,box:!1,boxColor:"#00ff00",castShadow:!1,receiveShadow:!1};function i(e){this.object=t}Object.keys(this._easyStyle).forEach((t=>{Object.defineProperty(i.prototype,t,{get(){return this.object._easyStyle[t]},set(i){let r=e[t];switch(e[t]=i,t){case"transparent":case"opacity":case"color":case"side":case"wireframe":case"emissive":this.object.updateMaterial({[t]:i});break;case"box":this.object.setBoxHelper(i?{color:e.boxColor}:null);break;case"boxColor":e.box&&this.object.setBoxHelper({color:i});break;case"edgeColor":e.edge&&this.object.setEdge({color:i});break;case"edgeOpacity":e.edge&&this.object.setEdge({opacity:i});break;case"edge":this.object.setEdge(i?{color:e.edgeColor,opacity:e.edgeOpacity}:null);break;case"castShadow":case"receiveShadow":this.object.updateBy({[t]:i})}this.object.dispatchEvent({type:"style.change",key:t,oldValue:r,newValue:i})}})})),this.style=new i(this)}_getEasyStyle(t){}_setEasyStyle(t,e){}toJSON(t,e){super.toJSON2();const i={visible:this.visible,position:this.position.toArray(),scale:this.scale.toArray(),rotation:this.rotation.toArray(),layers:this.layers.getChannel(),receiveShadow:this.receiveShadow,castShadow:this.castShadow,material:this.option.material,geometry:this.option.geometry,polygon:this.option.polygon,line:this.option.line,arrow:this.option.arrow,video:this.option.video,style:this.option.style,shader:this.option.shader,points:this.getPoints&&this.getPoints(),properties:this.properties,userData:this.userData,locked:this.locked};let r=new be.Layers;r.set(0);for(const t in i){const e=i[t];switch(t){case"layers":let n=new be.Layers;n.set(e),r.test(n)&&delete i[t];break;case"locked":this.locked||delete i[t];break;default:(null==e||""===e||q(e)&&tt(e)||"scale"==t&&Et(e,[1,1,1])||"position"==t&&Et(e,[0,0,0])||"rotation"==t&&Et(e,[0,0,0,"XYZ"])||"visible"==t&&e||"castShadow"==t&&!e||"receiveShadow"==t&&!e||Array.isArray(e)&&0==e.length)&&delete i[t]}}this.isModel&&(i.size=this.getSize().toArray());return{isThing:!0,name:this.name,type:this.type,config:i}}fade(t,e){var i=(t=t||{}).duration||1e3,r=t.complete;this.fadeTween&&this.fadeTween.stop();var n=this.style.opacity,s={opacity:this.isWebView?e:n},o={opacity:this.isWebView?n:e},a=this;this.visible=!0,this.fadeTween=new Bt(s).to(o,i).easing(Ot.Linear.None).onUpdate((function(t){a.style.opacity=this._object.opacity})).onComplete((function(){let t=a.style.opacity,e=0===t;a.isWebView&&(e=1===t),e&&(a.visible=!1),void 0!==a._fadeTempTransparent&&(a.style.transparent=a._fadeTempTransparent),r&&r()})).start()}fadeIn(t){this._fadeTempTransparent=this.style.transparent,this.style.opacity=0,this.style.transparent=!0,this.fade(t,.99)}fadeOut(t){this._fadeTempTransparent=this.style.transparent,this.style.opacity=.99,this.style.transparent=!0,this.fade(t,0)}clone(){const t=this.toJSON();return t.config.properties&&delete t.config.properties.uuid,new this.constructor(t.config)}}pi(Mo);class Co extends Mo{constructor(t){super(pt({avoid:!1,center:[.5,0],material:{fog:!0,transparent:!0,rotation:0,sizeAttenuation:!1,map:et(xo)}},t)),this.isBillboard=!0,this.type="Billboard";const{avoid:e,visible:i,material:r}=this.option,n=new Po(r.map);n.encoding=be.sRGBEncoding;const s=new be.SpriteMaterial({map:n,sizeAttenuation:!1,depthWrite:!1});this.sprite=new be.Sprite(s),this.add(this.sprite),this.center=$e(this.option.center||[.5,0]),this.box2d=null,this._avoid=e,this._visible=i,this._avoidVisible=!0,this.updateMaterial(this.option.material)}get center(){return this.sprite.center.toArray()}set center(t){this.sprite.center.copy($e(t))}updateMaterial(t){super.updateMaterial(t),this.updateScale(this.spriteComputeParameter)}get spriteComputeParameter(){if(!this.scene)return 0;const t=this.scene.viewer;return t.cameraControl,t.spriteComputeParameter}setupCommonEvent(){this.addEventListener(te,(t=>{const e=t.scene;if(e&&(this.avoid&&!t.scene.avoidBillboards.contains(this)&&t.scene.avoidBillboards.add(this),e.viewer)){const t=this.sprite.material.map,i=e.viewer.spriteComputeParameter;this.updateScale(i),t.needsRedraw=!0,t.redraw()}})),this.addEventListener("removed",(t=>{const e=this.scene;e&&e.avoidBillboards.remove(this)})),Mo.prototype.setupCommonEvent.call(this)}get texture(){return this.sprite.material.map}getSize(){const{width:t,height:e}=this.texture;return{width:t,height:e}}updateBox(t){if(!t)return;const e=t.coordWorldToScreen(this.position);if(e){const{x:t,y:i}=e,{width:r,height:n}=this.getSize();this.box2d=new be.Box2(new be.Vector2(t-r/2,i-n/2),new be.Vector2(t+r/2,i+n/2))}}updateScale(t){if(void 0===(t=t||this.spriteComputeParameter)||t<0)return;const{width:e,height:i}=this.texture;let r=i/t,n=r*e/i;this.sprite.scale.set(ct(n,5),ct(r,5),1).multiplyScalar(1)}get avoid(){return this._avoid}set avoid(t){this._avoid=!!t}}const Lo={material:{},geometry:{}};class Ro extends Mo{constructor(t,e){super(gt({},Lo,t)),this.isGeometryThing=!0;const i=this.createGeometry(this.option.geometry);this.mesh=new be.Mesh(i,new be.MeshStandardMaterial),this.add(this.mesh),this.updateBy({...this.option,geometry:null})}getGeometry(){return this.mesh.geometry}getMaterial(){return this.mesh.material}updateGeometry(t){t&&(t.isBufferGeometry?(this.mesh.geometry.dispose(),this.mesh.geometry=t):(pt(this.option.geometry,t),this.mesh.geometry.dispose(),this.mesh.geometry=this.createGeometry(mt({},this.mesh.geometry.parameters,t))),this.mesh.geometry.computeBoundingBox())}createGeometry(){return new be.BufferGeometry}clone(){const t=super.clone();return t.material=this.mesh.material,t.geometry=this.mesh.geometry,t}}class Oo extends Ro{constructor(t){super(gt({},{name:"Box",geometry:{width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1}},t)),this.type="Box",this.isBox=!0,this.materialArraySize=Oo.materialArraySize,this.materialSlot=Oo.materialSlot}createGeometry(t){const e=THREE.BoxGeometry.fromJSON(t);return e.center(),e.uvsNeedUpdate=!0,e.materialArraySize=Oo.materialArraySize,e.materialSlot=Oo.materialSlot,e}toJSON(t){const e=super.toJSON(t),i=this.mesh.material;if(Array.isArray(i)){const t=i.map((t=>wo.toJSON(t,!0)));e.config.material=t}else e.config.material=wo.toJSON(i,!0);return e}}Oo.materialArraySize=6,Oo.materialSlot={front:0,back:1,top:2,bottom:3,left:4,right:5};class Fo extends Mo{constructor(t){super(pt({src:"",modelType:"gltf",selectLevel:1,animationTimeScale:1,animationEnable:!1,size:null,cache:!1,modifies:{}},t)),this.isSync=!0,this.isModel=!0,this.type="Model",this.selectLevel=this.option.selectLevel,this._src="",this._modelType="",this.animations=[],this._setSrc(this.option.src,this.option.modelType||this.option.type)}get animationEnable(){return this.option.animationEnable}set animationEnable(t){this.option.animationEnable=t,this.mixer.stopAllAction(),t&&this.animations.forEach((t=>{t.clipAction&&t.clipAction.play()}))}_addInitBox(){let{size:t}=this.option;t=ti(t||[1,1,1]);const e=this._initBox=new Oo({geometry:{width:t.x,height:t.y,depth:t.z}});this.add(e)}_removeInitBox(){this.remove(this._initBox),this._initBox=null}setupCommonEvent(){super.setupCommonEvent(),this.addEventListener(te,(t=>{this.scene&&this.scene.dispatchEvent({type:ee,action:"object.loaded",object:this})})),this.loaded=!1,this.addEventListener("resource.loaded",(t=>{setTimeout((()=>{this._setFromResource(t.resource.data),this.traverse((t=>{t.isMesh&&(t.properties||(t.properties={name:t.name,uuid:t.uuid}))})),this.complete&&this.complete(this),this._removeInitBox(),this.loaded=!0,this.dispatchEvent({type:"loaded"})}),50)})),this.addEventListener("resource.error",(t=>{this._removeInitBox(),this.loaded=!0,this.dispatchEvent({type:"error"})}))}_setSrc(t,e){this.loaded=!1,e&&(this._modelType=e),t&&t!==this._src&&(this._src=t,this.resource&&(this.resource.removeObject(this),this.resource=null),q(t)?this.resource=mo.set({id:be.Math.generateUUID(),type:Kt.MODEL,config:{type:this._modelType,src:t},cache:this.option.cache,object:this}):Q(t)&&(this.resource=mo.set({id:t,config:{type:this._modelType,src:t},cache:this.option.cache,type:Kt.MODEL,object:this})))}clear(){super.clear(),this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this),this.animations=[])}_setFromResource(t){switch(this._modelType.toLowerCase()){case"gltf":{let e=(t.scene||t.scenes[0]).clone();e.locked=this.locked;const{animations:i}=t;i&&i.length>0?(this.add(e),this._initAnimations(e,i)):this.add(e)}break;case"obj":const e=t.clone();e.locked=this.locked,this.add(e);break;case"fbx":{let e=t.clone();e.locked=this.locked;const{animations:i}=e;i&&i.length>0?(this.add(e),this._initAnimations(e,i)):this.add(e)}}return this.updateBy(this.option),this}_initAnimations(t,e){this.animations=[];const i=new be.AnimationMixer(t),{animationTimeScale:r}=this.option;r&&(i.timeScale=r);for(let t=0;t<e.length;t++){let r=e[t].clone(),n=i.clipAction(r);r.clipAction=n,this.animations.push(r),this.option.animationEnable&&n.play()}this.mixer=i,this.setBeforeRender(ut(((t,e,i)=>{this.mixer&&this.mixer.update(e.deltaTime)}),1))}initExplode(){function t(t,e){return(new be.Vector3).addVectors(t.max,t.min).multiplyScalar(e)}const e=new be.Box3;e.setFromObject(this);const i=t(e,.5),r=new be.Box3;this.traverse((function(e){if(!(e.isMark||e.isMarkChild||e.isLine||e.isSprite)&&e.isMesh){r.setFromObject(e);const n=t(r,.5);e.userData.worldDir=(new be.Vector3).subVectors(n,i).normalize(),e.userData.worldDistance=(new be.Vector3).subVectors(n,i),e.userData.originPosition=e.getWorldPosition(new be.Vector3),e.userData.meshCenter=n.clone(),e.userData.explodeCenter=i.clone()}}))}explode(t){t=t||1,this.traverse((e=>{if(!e.isMesh||!e.userData.originPosition)return;const i=e.userData.worldDir.clone().multiplyScalar(e.userData.worldDistance.length()*t),r=(new be.Vector3).subVectors(e.userData.meshCenter,e.userData.originPosition),n=e.userData.explodeCenter,s=(new be.Vector3).copy(n).add(i).sub(r),o=e.parent?.worldToLocal(s.clone());o&&e.position.copy(o)}))}toJSON(t){if(t=t||{models:{}},this.resource){const e=this.resource.toJSON();t.models||(t.models={}),t.models[e.id]=e}const e=super.toJSON();return e.config.src=this._src,e.config.modelType=this._modelType,e.config.animationTimeScale=this.option.animationTimeScale,e.config.selectLevel=this.selectLevel,e.config.modifies=this.option.modifies,e.config.animationEnable=this.animationEnable,e}get src(){return this._src}}class No extends Ro{constructor(t){super(pt({name:"circle",geometry:{radius:.5,segments:30,thetaStart:0,thetaLength:2*Math.PI}},t)),this.type="Circle",this.isCircle=!0}createGeometry(t){return THREE.CircleGeometry.fromJSON(t)}}class Do extends Ro{constructor(t){super(pt({name:"Cone",geometry:{radius:1,height:1,radialSegments:20,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}},t)),this.type="Cone",this.isCone=!0}createGeometry(t){return THREE.ConeGeometry.fromJSON(t)}}class Io extends Ro{constructor(t){super(pt({name:"Cylinder",geometry:{radiusTop:1,radiusBottom:1,radialSegments:30,height:1,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}},t)),this.type="Cylinder",this.isCylinder=!0}createGeometry(t){return THREE.CylinderGeometry.fromJSON(t)}}class Uo extends Ro{constructor(t){super(pt({name:"Dodecahedron",geometry:{radius:.5,detail:0}},t)),this.type="Dodecahedron",this.isDodecahedron=!0}createGeometry(t){return THREE.DodecahedronGeometry.fromJSON(t)}}class Bo extends Ro{constructor(t){super(pt({name:"Icosahedron",geometry:{radius:.5,detail:0}},t)),this.type="Icosahedron",this.isIcosahedron=!0}createGeometry(t){return THREE.IcosahedronGeometry.fromJSON(t)}}class ko extends Ro{constructor(t){super(pt({name:"Lathe",geometry:{points:[{x:0,y:.5},{x:.5,y:0},{x:0,y:-.5}],segments:12,phiStart:0,phiLength:2*Math.PI}},t)),this.type="Lathe",this.isLathe=!0}createGeometry(t){return THREE.LatheGeometry.fromJSON(t)}}class jo extends Ro{constructor(t){super(pt({name:"Octahedron",geometry:{radius:.5,detail:0}},t)),this.type="Octahedron",this.isOctahedron=!0}createGeometry(t){return THREE.OctahedronGeometry.fromJSON(t)}}class Vo extends Ro{constructor(t){super(pt({name:"Plane",geometry:{width:1,height:1,widthSegments:1,heightSegments:1}},t)),this.type="Plane",this.isPlane=!0}createGeometry(t){return THREE.PlaneGeometry.fromJSON(t)}get width(){return this.geometry.parameters.width}set width(t){this.geometry.parameters.width=t}get height(){return this.geometry.parameters.height}set height(t){this.geometry.parameters.height=t}}class zo extends Ro{constructor(t){super(pt({name:"Ring",geometry:{innerRadius:.4,outerRadius:.5,thetaSegments:30,phiSegments:30,thetaStart:0,thetaLength:2*Math.PI},material:{}},t)),this.type="Ring",this.isRing=!0}createGeometry(t){return THREE.RingGeometry.fromJSON(t)}}class Go extends Ro{constructor(t){super(pt({name:"Sphere",geometry:{radius:.5,widthSegments:30,heightSegments:30,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI}},t)),this.type="Sphere",this.isSphere=!0}createGeometry(t){return THREE.SphereGeometry.fromJSON(t)}}class Ho extends Ro{constructor(t){super(pt({name:"Tetrahedron",geometry:{radius:.5,detail:0}},t)),this.type="Tetrahedron",this.isTetrahedron=!0}createGeometry(t){return THREE.TetrahedronGeometry.fromJSON(t)}}class Xo extends Ro{constructor(t){super(pt({name:"Torus",geometry:{radius:.5,tube:.25,radialSegments:16,tubularSegments:16,arc:2*Math.PI}},t)),this.type="Torus",this.isTorus=!0}createGeometry(t){return THREE.TorusGeometry.fromJSON(t)}}class Wo extends Ro{constructor(t){super(pt({name:"TorusKnot",geometry:{radius:.5,tube:.2,tubularSegments:64,radialSegments:8,p:2,q:3}},t)),this.type="TorusKnot",this.isTorusKnot=!0}createGeometry(t){return THREE.TorusKnotGeometry.fromJSON(t)}}class Yo extends Ro{constructor(t){super(pt({name:"Capsule",geometry:{radius:.5,height:1,segments:30,phiStart:0,phiLength:2*Math.PI}},t)),this.type="Capsule",this.isCapsule=!0}createGeometry(t){const e=void 0!==t.radius?t.radius:this.option.geometry.radius,i=void 0!==t.height?t.height:this.option.geometry.height,r=[];for(let t=Math.PI/2;t>0;t-=.1)r.push(new THREE.Vector3(Math.cos(t)*e,Math.sin(t)*e+i/2,0));for(let t=i/2;t>-i/2;t-=.1)r.push(new THREE.Vector3(e,t,0));for(let t=0;t<=Math.PI/2;t+=.1)r.push(new THREE.Vector3(Math.cos(t)*e,-Math.sin(t)*e-i/2,0));r.push(new THREE.Vector3(0,-e-i/2,0));const{segments:n,phiStart:s,phiLength:o}=this.option.geometry,a=new THREE.LatheGeometry(r,n,s,o);return a.center(),a.uvsNeedUpdate=!0,a}}class Qo extends Ro{constructor(t){super(pt({name:"Doughnut",geometry:{radius:1,innerRadius:.5,segments:30,phiStart:0,phiLength:2*Math.PI}},t)),this.type="Doughnut",this.isDoughnut=!0}createGeometry(t){const e=void 0!==t.radius?t.radius:this.option.geometry.radius,i=void 0!==t.innerRadius?t.innerRadius:this.option.geometry.innerRadius,r=new THREE.EllipseCurve(0,0,i,i,0,2*Math.PI,!1,0).getPoints(60),n=[];r.forEach((t=>{t.x=t.x+e,n.push(t)}));const{segments:s,phiStart:o,phiLength:a}=this.option.geometry;return new THREE.LatheGeometry(n,s,o,a)}}class Jo extends Mo{constructor(t){super(pt({geometry:{points:[]},material:{size:3,sizeAttenuation:!1,transparent:!0}},t)),this.type="Points",this.mesh=new be.Points(this.createGeometry(this.option.geometry),new be.PointsMaterial),this.mesh.material.depthWrite=!1,this.add(this.mesh),this.updateBy(this.option)}createGeometry(t){const e=[];for(let i=0;i<t.points.length;i++)e.push(ti(t.points[i]));return(new be.BufferGeometry).setFromPoints(e)}updateGeometry(t){t&&(t.isBufferGeometry?this.mesh.geometry=t:this.mesh.geometry=this.createGeometry(mt({},this.mesh.geometry.parameters,t)),this.mesh.geometry.computeBoundingBox())}}var Zo=Object.freeze({__proto__:null,Box:Oo,Circle:No,Cone:Do,Cylinder:Io,Dodecahedron:Uo,Icosahedron:Bo,Lathe:ko,Octahedron:jo,Plane:Vo,Ring:zo,Sphere:Go,Tetrahedron:Ho,Torus:Xo,TorusKnot:Wo,Capsule:Yo,Doughnut:Qo,Points:Jo});let qo=1;class Ko{constructor(t){this._viewer=void 0,this._container=void 0,this.option=pt({link:"http://www.vaps.cc/",className:"THING-ctrl-logo"},t),this._container=null,this._viewer=null}onAdd(t){this._viewer=t,this._container=U("div","THING-ctrl",null);const e=U("a",this.option.className,null);return e.target="_blank",e.href=this.option.link,e.setAttribute("aria-label","thing"),e.setAttribute("rel","noopener"),this._container.appendChild(e),this._container}onRemove(){j(this._container)}getDefaultPosition(){return"bottom-left"}_updateCompact(){if(!this._container)return;const t=this._container.children;if(t.length){const e=t[0];this._viewer.container.offsetWidth<250?e.classList.add("THING-compact"):e.classList.remove("THING-compact")}}}class $o{constructor(t){this.options=pt({customAttribution:null},t||{}),this._container=null,this._innerContainer=null,ht(["_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const e=this.options&&this.options.compact;return this.viewer=t,this._container=U("div","THING-ctrl THING-ctrl-attrib",null),this._innerContainer=U("div","THING-ctrl-attrib-inner",this._container),e&&this._container.classList.add("THING-compact"),this._updateAttributions(),void 0===e&&(this.viewer.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){j(this._container),this.viewer.off("resize",this._updateCompact),this.viewer=null}_updateAttributions(){if(!this._container||!this._innerContainer)return;let t=[];const{customAttribution:e}=this.options;if(e&&(Array.isArray(e)?t=t.concat(e.map((t=>"string"!=typeof t?"":t))):"string"==typeof e&&t.push(e)),this.viewer.style){if(this.viewer.style.stylesheet){const t=this.viewer.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this.viewer.style.sourceCaches;for(const i in e){const r=e[i];if(r.used){const e=r.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}}t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0})),t.length?(this._innerContainer.innerHTML=t.join(" | "),this._container.classList.remove("THING-attrib-empty")):this._container.classList.add("THING-attrib-empty")}_updateCompact(){this._container&&(this.viewer.container.offsetWidth<=640?this._container.classList.add("THING-compact"):this._container.classList.remove("THING-compact"))}}
/*!
* camera-controls
* https://github.com/yomotsu/camera-controls
* (c) 2017 @yomotsu
* Released under the MIT License.
*/
/*!
* camera-controls
* https://github.com/yomotsu/camera-controls
* (c) 2017 @yomotsu
* Released under the MIT License.
*/var ta;function ea(t){return(ta[t]||"").toLowerCase()}function ia(t){return t.isPerspectiveCamera}function ra(t){return t.isOrthographicCamera}!function(t){t[t.NONE=0]="NONE",t[t.ROTATE=1]="ROTATE",t[t.TRUCK=2]="TRUCK",t[t.OFFSET=3]="OFFSET",t[t.DOLLY=4]="DOLLY",t[t.ZOOM=5]="ZOOM",t[t.TOUCH_ROTATE=6]="TOUCH_ROTATE",t[t.TOUCH_TRUCK=7]="TOUCH_TRUCK",t[t.TOUCH_OFFSET=8]="TOUCH_OFFSET",t[t.TOUCH_DOLLY=9]="TOUCH_DOLLY",t[t.TOUCH_ZOOM=10]="TOUCH_ZOOM",t[t.TOUCH_DOLLY_TRUCK=11]="TOUCH_DOLLY_TRUCK",t[t.TOUCH_DOLLY_OFFSET=12]="TOUCH_DOLLY_OFFSET",t[t.TOUCH_ZOOM_TRUCK=13]="TOUCH_ZOOM_TRUCK",t[t.TOUCH_ZOOM_OFFSET=14]="TOUCH_ZOOM_OFFSET"}(ta||(ta={}));const na=2*Math.PI,sa=Math.PI/2;function oa(t,e=1e-5){return Math.abs(t)<e}function aa(t,e,i=1e-5){return oa(t-e,i)}function la(t,e){return Math.round(t/e)*e}function ha(t){return isFinite(t)?t:t<0?-Number.MAX_VALUE:Number.MAX_VALUE}function ca(t){return Math.abs(t)<Number.MAX_VALUE?t:t*(1/0)}function da(t,e){e.set(0,0),t.forEach((t=>{e.x+=t.clientX,e.y+=t.clientY})),e.x/=t.length,e.y/=t.length}function ua(t,e){return!!ra(t)&&(console.warn(`${e} is not supported in OrthographicCamera`),!0)}function pa(t){return t.invert?t.invert():t.inverse(),t}const ma="undefined"!=typeof window,fa=ma&&/Mac/.test(navigator.platform),ga=!(ma&&"PointerEvent"in window),va=Object.freeze(ta),ya=1/8;let wa,xa,ba,_a,Aa,Sa,Ta,Ea,Pa,Ma,Ca,La,Ra,Oa,Fa,Na,Da,Ia,Ua,Ba,ka;wa=Object.freeze(new be.Vector3(0,0,0)),xa=Object.freeze(new be.Vector3(0,1,0)),ba=Object.freeze(new be.Vector3(0,0,1)),_a=new be.Vector2,Aa=new be.Vector3,Sa=new be.Vector3,Ta=new be.Vector3,Ea=new be.Vector3,Pa=new be.Vector3,Ma=new be.Vector3,Ca=new be.Vector3,La=new be.Vector3,Ra=new be.Spherical,Oa=new be.Spherical,Fa=new be.Box3,Na=new be.Box3,Da=new be.Sphere,Ia=new be.Quaternion,Ua=new be.Quaternion,Ba=new be.Matrix4,ka=new be.Raycaster;class ja extends class{constructor(){this._listeners={}}addEventListener(t,e){const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}removeEventListener(t,e){const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}removeAllEventListeners(t){t?Array.isArray(this._listeners[t])&&(this._listeners[t].length=0):this._listeners={}}dispatchEvent(t){const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,r=i.length;e<r;e++)i[e].call(this,t)}}}{constructor(t,e){if(super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=0,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.dampingFactor=.05,this.draggingDampingFactor=.25,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.verticalDragToForward=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=ta.NONE,this._viewport=null,this._dollyControlAmount=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._activePointers=[],this._truckInternal=(t,e,i)=>{if(ia(this._camera)){const r=Aa.copy(this._camera.position).sub(this._target),n=this._camera.getEffectiveFOV()*be.MathUtils.DEG2RAD,s=r.length()*Math.tan(.5*n),o=this.truckSpeed*t*s/this._elementRect.height,a=this.truckSpeed*e*s/this._elementRect.height;this.verticalDragToForward?(i?this.setFocalOffset(this._focalOffsetEnd.x+o,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(o,0,!0),this.forward(-a,!0)):i?this.setFocalOffset(this._focalOffsetEnd.x+o,this._focalOffsetEnd.y+a,this._focalOffsetEnd.z,!0):this.truck(o,a,!0)}else if(ra(this._camera)){const r=this._camera,n=t*(r.right-r.left)/r.zoom/this._elementRect.width,s=e*(r.top-r.bottom)/r.zoom/this._elementRect.height;i?this.setFocalOffset(this._focalOffsetEnd.x+n,this._focalOffsetEnd.y+s,this._focalOffsetEnd.z,!0):this.truck(n,s,!0)}},this._rotateInternal=(t,e)=>{const i=na*this.azimuthRotateSpeed*t/this._elementRect.height,r=na*this.polarRotateSpeed*e/this._elementRect.height;this.rotate(i,r,!0)},this._dollyInternal=(t,e,i)=>{const r=Math.pow(.95,-t*this.dollySpeed),n=this._sphericalEnd.radius*r,s=this._sphericalEnd.radius,o=s*(t>=0?-1:1);this.dollyTo(n),this.infinityDolly&&(n<this.minDistance||this.maxDistance===this.minDistance)&&(this._camera.getWorldDirection(Aa),this._targetEnd.add(Aa.normalize().multiplyScalar(o)),this._target.add(Aa.normalize().multiplyScalar(o))),this.dollyToCursor&&(this._dollyControlAmount+=this._sphericalEnd.radius-s,this.infinityDolly&&(n<this.minDistance||this.maxDistance===this.minDistance)&&(this._dollyControlAmount-=o),this._dollyControlCoord.set(e,i))},this._zoomInternal=(t,e,i)=>{const r=Math.pow(.95,t*this.dollySpeed);this.zoomTo(this._zoom*r),this.dollyToCursor&&(this._dollyControlAmount=this._zoomEnd,this._dollyControlCoord.set(e,i))},void 0===be&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=(new be.Quaternion).setFromUnitVectors(this._camera.up,xa),this._yAxisUpSpaceInverse=pa(this._yAxisUpSpace.clone()),this._state=ta.NONE,this._domElement=e,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._target=new be.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new be.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=(new be.Spherical).setFromVector3(Aa.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._nearPlaneCorners=[new be.Vector3,new be.Vector3,new be.Vector3,new be.Vector3],this._updateNearPlaneCorners(),this._boundary=new be.Box3(new be.Vector3(-1/0,-1/0,-1/0),new be.Vector3(1/0,1/0,1/0)),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlAmount=0,this._dollyControlCoord=new be.Vector2,this.mouseButtons={left:ta.ROTATE,middle:ta.DOLLY,right:ta.TRUCK,wheel:ia(this._camera)?ta.DOLLY:ra(this._camera)?ta.ZOOM:ta.NONE,shiftLeft:ta.NONE},this.touches={one:ta.TOUCH_ROTATE,two:ia(this._camera)?ta.TOUCH_DOLLY_TRUCK:ra(this._camera)?ta.TOUCH_ZOOM_TRUCK:ta.NONE,three:ta.TOUCH_TRUCK},this._domElement){const t=new be.Vector2,e=new be.Vector2,i=new be.Vector2,r=t=>{if(!this._enabled)return;const e={pointerId:t.pointerId,clientX:t.clientX,clientY:t.clientY};switch(this._activePointers.push(e),t.button){case be.MOUSE.LEFT:this._state=t.shiftKey?this.mouseButtons.shiftLeft:this.mouseButtons.left;break;case be.MOUSE.MIDDLE:this._state=this.mouseButtons.middle;break;case be.MOUSE.RIGHT:this._state=this.mouseButtons.right}if("touch"===t.pointerType)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),f()},n=t=>{if(!this._enabled)return;const e={pointerId:0,clientX:t.clientX,clientY:t.clientY};switch(this._activePointers.push(e),t.button){case be.MOUSE.LEFT:this._state=t.shiftKey?this.mouseButtons.shiftLeft:this.mouseButtons.left;break;case be.MOUSE.MIDDLE:this._state=this.mouseButtons.middle;break;case be.MOUSE.RIGHT:this._state=this.mouseButtons.right}this._domElement.ownerDocument.removeEventListener("mousemove",a),this._domElement.ownerDocument.removeEventListener("mouseup",c),this._domElement.ownerDocument.addEventListener("mousemove",a),this._domElement.ownerDocument.addEventListener("mouseup",c),f()},s=t=>{if(this._enabled){switch(t.preventDefault(),Array.prototype.forEach.call(t.changedTouches,(t=>{const e={pointerId:t.identifier,clientX:t.clientX,clientY:t.clientY};this._activePointers.push(e)})),this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}this._domElement.ownerDocument.removeEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("touchend",d),this._domElement.ownerDocument.addEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.addEventListener("touchend",d),f()}},o=t=>{t.cancelable&&t.preventDefault();const e=t.pointerId,i=this._findPointerById(e);i&&(i.clientX=t.clientX,i.clientY=t.clientY,g())},a=t=>{const e=this._findPointerById(0);e&&(e.clientX=t.clientX,e.clientY=t.clientY,g())},l=t=>{t.cancelable&&t.preventDefault(),Array.prototype.forEach.call(t.changedTouches,(t=>{const e=t.identifier,i=this._findPointerById(e);i&&(i.clientX=t.clientX,i.clientY=t.clientY)})),g()},h=t=>{let e=this._state;const i=t.pointerId,r=this._findPointerById(i);if(r&&this._activePointers.splice(this._activePointers.indexOf(r),1),"touch"===t.pointerType)switch(this._activePointers.length){case 0:this._state=ta.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}else this._state=ta.NONE;v(e)},c=()=>{const t=this._findPointerById(0);t&&this._activePointers.splice(this._activePointers.indexOf(t),1);let e=this._state;this._state=ta.NONE,v(e)},d=t=>{let e=this._state;switch(Array.prototype.forEach.call(t.changedTouches,(t=>{const e=t.identifier,i=this._findPointerById(e);i&&this._activePointers.splice(this._activePointers.indexOf(i),1)})),this._activePointers.length){case 0:this._state=ta.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three}v(e)};let u=-1;const p=t=>{if(!this._enabled||this.mouseButtons.wheel===ta.NONE)return;if(t.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ta.ROTATE||this.mouseButtons.wheel===ta.TRUCK){const t=performance.now();u-t<1e3&&this._getClientRect(this._elementRect),u=t}const e=fa?-1:-3,i=1===t.deltaMode?t.deltaY/e:t.deltaY/(10*e),r=this.dollyToCursor?(t.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,n=this.dollyToCursor?(t.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case ta.ROTATE:this._rotateInternal(t.deltaX,t.deltaY);break;case ta.TRUCK:this._truckInternal(t.deltaX,t.deltaY,!1);break;case ta.OFFSET:this._truckInternal(t.deltaX,t.deltaY,!0);break;case ta.DOLLY:this._dollyInternal(-i,r,n);break;case ta.ZOOM:this._zoomInternal(-i,r,n)}this.dispatchEvent({type:"control",eventType:ea(this.mouseButtons.wheel),delta:i})},m=t=>{this._enabled&&t.preventDefault()},f=()=>{if(!this._enabled)return;da(this._activePointers,_a),this._getClientRect(this._elementRect),t.copy(_a),e.copy(_a);if(this._activePointers.length>=2){const t=_a.x-this._activePointers[1].clientX,r=_a.y-this._activePointers[1].clientY,n=Math.sqrt(t*t+r*r);i.set(0,n);const s=.5*(this._activePointers[0].clientX+this._activePointers[1].clientX),o=.5*(this._activePointers[0].clientY+this._activePointers[1].clientY);e.set(s,o)}this.dispatchEvent({type:"controlstart",eventType:ea(this._state)+"start"})},g=()=>{if(!this._enabled)return;da(this._activePointers,_a);const r=e.x-_a.x,n=e.y-_a.y;switch(e.copy(_a),this._state){case ta.ROTATE:case ta.TOUCH_ROTATE:this._rotateInternal(r,n);break;case ta.DOLLY:case ta.ZOOM:{const e=this.dollyToCursor?(t.x-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(t.y-this._elementRect.y)/this._elementRect.height*-2+1:0;this._state===ta.DOLLY?this._dollyInternal(n*ya,e,i):this._zoomInternal(n*ya,e,i);break}case ta.TOUCH_DOLLY:case ta.TOUCH_ZOOM:case ta.TOUCH_DOLLY_TRUCK:case ta.TOUCH_ZOOM_TRUCK:case ta.TOUCH_DOLLY_OFFSET:case ta.TOUCH_ZOOM_OFFSET:{const t=_a.x-this._activePointers[1].clientX,s=_a.y-this._activePointers[1].clientY,o=Math.sqrt(t*t+s*s),a=i.y-o;i.set(0,o);const l=this.dollyToCursor?(e.x-this._elementRect.x)/this._elementRect.width*2-1:0,h=this.dollyToCursor?(e.y-this._elementRect.y)/this._elementRect.height*-2+1:0;this._state===ta.TOUCH_DOLLY||this._state===ta.TOUCH_DOLLY_TRUCK||this._state===ta.TOUCH_DOLLY_OFFSET?this._dollyInternal(a*ya,l,h):this._zoomInternal(a*ya,l,h),this._state===ta.TOUCH_DOLLY_TRUCK||this._state===ta.TOUCH_ZOOM_TRUCK?this._truckInternal(r,n,!1):this._state!==ta.TOUCH_DOLLY_OFFSET&&this._state!==ta.TOUCH_ZOOM_OFFSET||this._truckInternal(r,n,!0);break}case ta.TRUCK:case ta.TOUCH_TRUCK:this._truckInternal(r,n,!1);break;case ta.OFFSET:case ta.TOUCH_OFFSET:this._truckInternal(r,n,!0)}this.dispatchEvent({type:"control",eventType:ea(this._state)})},v=t=>{da(this._activePointers,_a),e.copy(_a),0===this._activePointers.length&&(this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("touchend",d),this.dispatchEvent({type:"controlend",eventType:ea(t||this._state)+"end"}))};this._domElement.addEventListener("pointerdown",r),ga&&this._domElement.addEventListener("mousedown",n),ga&&this._domElement.addEventListener("touchstart",s),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",p,{passive:!1}),this._domElement.addEventListener("contextmenu",m),this._removeAllEventListeners=()=>{this._domElement.removeEventListener("pointerdown",r),this._domElement.removeEventListener("mousedown",n),this._domElement.removeEventListener("touchstart",s),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",p,{passive:!1}),this._domElement.removeEventListener("contextmenu",m),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",a),this._domElement.ownerDocument.removeEventListener("touchmove",l,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",c),this._domElement.ownerDocument.removeEventListener("touchend",d)},this.cancel=()=>{if(this._state===ta.NONE)return;let t=this._state;this._state=ta.NONE,this._activePointers.length=0,v(t)}}this.update(0)}static install(){wa=Object.freeze(new be.Vector3(0,0,0)),xa=Object.freeze(new be.Vector3(0,1,0)),ba=Object.freeze(new be.Vector3(0,0,1)),_a=new be.Vector2,Aa=new be.Vector3,Sa=new be.Vector3,Ta=new be.Vector3,Ea=new be.Vector3,Pa=new be.Vector3,Ma=new be.Vector3,Ca=new be.Vector3,La=new be.Vector3,Ra=new be.Spherical,Oa=new be.Spherical,Fa=new be.Box3,Na=new be.Box3,Da=new be.Sphere,Ia=new be.Quaternion,Ua=new be.Quaternion,Ba=new be.Matrix4,ka=new be.Raycaster}static get ACTION(){return va}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="")}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,i=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,i)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,i=!1){const r=be.MathUtils.clamp(t,this.minAzimuthAngle,this.maxAzimuthAngle),n=be.MathUtils.clamp(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const s=!i||aa(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&aa(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(s)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){const i=this._sphericalEnd.radius,r=be.MathUtils.clamp(t,this.minDistance,this.maxDistance);if(this.colliderMeshes.length>=1){const t=this._collisionTest(),e=aa(t,this._spherical.radius);if(!(i>r)&&e)return Promise.resolve();this._sphericalEnd.radius=Math.min(r,t)}else this._sphericalEnd.radius=r;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const n=!e||aa(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._zoomEnd=be.MathUtils.clamp(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const i=!e||aa(this._zoom,this._zoomEnd,this.restThreshold);return this._createOnRestPromise(i)}pan(t,e,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,i)}truck(t,e,i=!1){this._camera.updateMatrix(),Ea.setFromMatrixColumn(this._camera.matrix,0),Pa.setFromMatrixColumn(this._camera.matrix,1),Ea.multiplyScalar(t),Pa.multiplyScalar(-e);const r=Aa.copy(Ea).add(Pa),n=Sa.copy(this._targetEnd).add(r);return this.moveTo(n.x,n.y,n.z,i)}forward(t,e=!1){Aa.setFromMatrixColumn(this._camera.matrix,0),Aa.crossVectors(this._camera.up,Aa),Aa.multiplyScalar(t);const i=Sa.copy(this._targetEnd).add(Aa);return this.moveTo(i.x,i.y,i.z,e)}moveTo(t,e,i,r=!1){const n=Aa.set(t,e,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const s=!r||aa(this._target.x,this._targetEnd.x,this.restThreshold)&&aa(this._target.y,this._targetEnd.y,this.restThreshold)&&aa(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}fitToBox(t,e,{paddingLeft:i=0,paddingRight:r=0,paddingBottom:n=0,paddingTop:s=0}={}){const o=[],a=t.isBox3?Fa.copy(t):Fa.setFromObject(t);a.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const l=la(this._sphericalEnd.theta,sa),h=la(this._sphericalEnd.phi,sa);o.push(this.rotateTo(l,h,e));const c=Aa.setFromSpherical(this._sphericalEnd).normalize(),d=Ia.setFromUnitVectors(c,ba);aa(Math.abs(c.y),1)&&d.multiply(Ua.setFromAxisAngle(xa,l));const u=Na.makeEmpty();Sa.copy(a.min).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.min).setX(a.max.x).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.min).setY(a.max.y).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.max).setZ(a.min.z).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.min).setZ(a.max.z).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.max).setY(a.min.y).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.max).setX(a.min.x).applyQuaternion(d),u.expandByPoint(Sa),Sa.copy(a.max).applyQuaternion(d),u.expandByPoint(Sa),d.setFromUnitVectors(ba,c),u.min.x-=i,u.min.y-=n,u.max.x+=r,u.max.y+=s;const p=u.getSize(Aa),m=u.getCenter(Sa).applyQuaternion(d);if(ia(this._camera)){const t=this.getDistanceToFitBox(p.x,p.y,p.z);o.push(this.moveTo(m.x,m.y,m.z,e)),o.push(this.dollyTo(t,e)),o.push(this.setFocalOffset(0,0,0,e))}else if(ra(this._camera)){const t=this._camera,i=t.right-t.left,r=t.top-t.bottom,n=Math.min(i/p.x,r/p.y);o.push(this.moveTo(m.x,m.y,m.z,e)),o.push(this.zoomTo(n,e)),o.push(this.setFocalOffset(0,0,0,e))}return Promise.all(o)}fitToSphere(t,e){const i=[],r=t instanceof be.Sphere?Da.copy(t):function(t,e){const i=e,r=i.center;Fa.makeEmpty(),t.traverseVisible((t=>{t.isMesh&&Fa.expandByObject(t)})),Fa.getCenter(r);let n=0;return t.traverseVisible((t=>{if(!t.isMesh)return;const e=t,i=e.geometry.clone();if(i.applyMatrix4(e.matrixWorld),i.isBufferGeometry){const t=i.attributes.position;for(let e=0,i=t.count;e<i;e++)Aa.fromBufferAttribute(t,e),n=Math.max(n,r.distanceToSquared(Aa))}else{const t=i.attributes.position,e=new be.Vector3;for(let i=0,s=t.count;i<s;i++)e.fromBufferAttribute(t,i),n=Math.max(n,r.distanceToSquared(e))}})),i.radius=Math.sqrt(n),i}(t,Da);if(i.push(this.moveTo(r.center.x,r.center.y,r.center.z,e)),ia(this._camera)){const t=this.getDistanceToFitSphere(r.radius);i.push(this.dollyTo(t,e))}else if(ra(this._camera)){const t=this._camera.right-this._camera.left,n=this._camera.top-this._camera.bottom,s=2*r.radius,o=Math.min(t/s,n/s);i.push(this.zoomTo(o,e))}return i.push(this.setFocalOffset(0,0,0,e)),Promise.all(i)}setLookAt(t,e,i,r,n,s,o=!1){const a=Sa.set(r,n,s),l=Aa.set(t,e,i);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||aa(this._target.x,this._targetEnd.x,this.restThreshold)&&aa(this._target.y,this._targetEnd.y,this.restThreshold)&&aa(this._target.z,this._targetEnd.z,this.restThreshold)&&aa(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&aa(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&aa(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(t,e,i,r,n,s,o,a,l,h,c,d,u,p=!1){const m=Aa.set(r,n,s),f=Sa.set(t,e,i);Ra.setFromVector3(f.sub(m).applyQuaternion(this._yAxisUpSpace));const g=Ta.set(h,c,d),v=Sa.set(o,a,l);Oa.setFromVector3(v.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(m.lerp(g,u));const y=Oa.theta-Ra.theta,w=Oa.phi-Ra.phi,x=Oa.radius-Ra.radius;this._sphericalEnd.set(Ra.radius+x*u,Ra.phi+w*u,Ra.theta+y*u),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const b=!p||aa(this._target.x,this._targetEnd.x,this.restThreshold)&&aa(this._target.y,this._targetEnd.y,this.restThreshold)&&aa(this._target.z,this._targetEnd.z,this.restThreshold)&&aa(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&aa(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&aa(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(b)}setPosition(t,e,i,r=!1){return this.setLookAt(t,e,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(t,e,i,r=!1){const n=this.getPosition(Aa);return this.setLookAt(n.x,n.y,n.z,t,e,i,r)}setFocalOffset(t,e,i,r=!1){this._focalOffsetEnd.set(t,e,i),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const n=!r||aa(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&aa(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&aa(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(t,e,i){Ea.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Pa.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Ma.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=Aa.set(t,e,i),n=r.distanceTo(this._camera.position),s=r.sub(this._camera.position);Ea.multiplyScalar(s.x),Pa.multiplyScalar(s.y),Ma.multiplyScalar(s.z),Aa.copy(Ea).add(Pa).add(Ma),Aa.z=Aa.z+n,this.dollyTo(n,!1),this.setFocalOffset(-Aa.x,Aa.y,-Aa.z,!1),this.moveTo(t,e,i,!1)}setBoundary(t){if(!t)return this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),void(this._needsUpdate=!0);this._boundary.copy(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,i,r){null!==t?(this._viewport=this._viewport||new be.Vector4,"number"==typeof t?this._viewport.set(t,e,i,r):this._viewport.copy(t)):this._viewport=null}getDistanceToFitBox(t,e,i){if(ua(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=t/e,n=this._camera.getEffectiveFOV()*be.MathUtils.DEG2RAD,s=this._camera.aspect;return.5*(r<s?e:t/s)/Math.tan(.5*n)+.5*i}getDistanceToFitSphere(t){if(ua(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const e=this._camera.getEffectiveFOV()*be.MathUtils.DEG2RAD,i=2*Math.atan(Math.tan(.5*e)*this._camera.aspect),r=1<this._camera.aspect?e:i;return t/Math.sin(.5*r)}getTarget(t){return(t&&t.isVector3?t:new be.Vector3).copy(this._targetEnd)}getPosition(t){return(t&&t.isVector3?t:new be.Vector3).setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).add(this._targetEnd)}getFocalOffset(t){return(t&&t.isVector3?t:new be.Vector3).copy(this._focalOffsetEnd)}normalizeRotations(){this._sphericalEnd.theta=this._sphericalEnd.theta%na,this._sphericalEnd.theta<0&&(this._sphericalEnd.theta+=na),this._spherical.theta+=na*Math.round((this._sphericalEnd.theta-this._spherical.theta)/na)}reset(t=!1){const e=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,t),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,t),this.zoomTo(this._zoom0,t)];return Promise.all(e)}saveState(){this._target0.copy(this._target),this._position0.copy(this._camera.position),this._zoom0=this._zoom}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,xa),pa(this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace))}update(t){const e=this._state===ta.NONE?this.dampingFactor:this.draggingDampingFactor,i=Math.min(e*t*60,1),r=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,s=this._sphericalEnd.radius-this._spherical.radius,o=Ca.subVectors(this._targetEnd,this._target),a=La.subVectors(this._focalOffsetEnd,this._focalOffset);if(oa(r)&&oa(n)&&oa(s)&&oa(o.x)&&oa(o.y)&&oa(o.z)&&oa(a.x)&&oa(a.y)&&oa(a.z)?(this._spherical.copy(this._sphericalEnd),this._target.copy(this._targetEnd),this._focalOffset.copy(this._focalOffsetEnd)):(this._spherical.set(this._spherical.radius+s*i,this._spherical.phi+n*i,this._spherical.theta+r*i),this._target.add(o.multiplyScalar(i)),this._focalOffset.add(a.multiplyScalar(i)),this._needsUpdate=!0),0!==this._dollyControlAmount){if(ia(this._camera)){const t=this._camera,e=Aa.setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate(),i=Sa.copy(e).cross(t.up).normalize();0===i.lengthSq()&&(i.x=1);const r=Ta.crossVectors(i,e),n=this._sphericalEnd.radius*Math.tan(t.getEffectiveFOV()*be.MathUtils.DEG2RAD*.5),s=(this._sphericalEnd.radius-this._dollyControlAmount-this._sphericalEnd.radius)/this._sphericalEnd.radius,o=Aa.copy(this._targetEnd).add(i.multiplyScalar(this._dollyControlCoord.x*n*t.aspect)).add(r.multiplyScalar(this._dollyControlCoord.y*n));this._targetEnd.lerp(o,s),this._target.copy(this._targetEnd)}else if(ra(this._camera)){const t=this._camera,e=Aa.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(t.near+t.far)/(t.near-t.far)).unproject(t),i=Sa.set(0,0,-1).applyQuaternion(t.quaternion),r=i.dot(t.up),n=oa(r)?-e.dot(t.up):-e.dot(t.up)/r,s=Ta.copy(e).add(i.multiplyScalar(n));this._targetEnd.lerp(s,1-t.zoom/this._dollyControlAmount),this._target.copy(this._targetEnd)}this._dollyControlAmount=0}const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target);(!oa(this._focalOffset.x)||!oa(this._focalOffset.y)||!oa(this._focalOffset.z))&&(this._camera.updateMatrix(),Ea.setFromMatrixColumn(this._camera.matrix,0),Pa.setFromMatrixColumn(this._camera.matrix,1),Ma.setFromMatrixColumn(this._camera.matrix,2),Ea.multiplyScalar(this._focalOffset.x),Pa.multiplyScalar(-this._focalOffset.y),Ma.multiplyScalar(this._focalOffset.z),Aa.copy(Ea).add(Pa).add(Ma),this._camera.position.add(Aa)),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),Aa.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const h=this._zoomEnd-this._zoom;this._zoom+=h*i,this._camera.zoom!==this._zoom&&(oa(h)&&(this._zoom=this._zoomEnd),this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0);const c=this._needsUpdate;return c&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):c?(this.dispatchEvent({type:"update"}),oa(r,this.restThreshold)&&oa(n,this.restThreshold)&&oa(s,this.restThreshold)&&oa(o.x,this.restThreshold)&&oa(o.y,this.restThreshold)&&oa(o.z,this.restThreshold)&&oa(a.x,this.restThreshold)&&oa(a.y,this.restThreshold)&&oa(a.z,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!c&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._updatedLastTime=c,this._needsUpdate=!1,c}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:ha(this.maxDistance),minZoom:this.minZoom,maxZoom:ha(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:ha(this.maxPolarAngle),minAzimuthAngle:ha(this.minAzimuthAngle),maxAzimuthAngle:ha(this.maxAzimuthAngle),dampingFactor:this.dampingFactor,draggingDampingFactor:this.draggingDampingFactor,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,verticalDragToForward:this.verticalDragToForward,target:this._targetEnd.toArray(),position:Aa.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(t,e=!1){const i=JSON.parse(t),r=Aa.fromArray(i.position);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=ca(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=ca(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=ca(i.maxPolarAngle),this.minAzimuthAngle=ca(i.minAzimuthAngle),this.maxAzimuthAngle=ca(i.maxAzimuthAngle),this.dampingFactor=i.dampingFactor,this.draggingDampingFactor=i.draggingDampingFactor,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this.verticalDragToForward=i.verticalDragToForward,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],e),Ra.setFromVector3(r.sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(Ra.theta,Ra.phi,e),this.zoomTo(i.zoom,e),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],e),this._needsUpdate=!0}dispose(){this._removeAllEventListeners()}_findPointerById(t){let e=null;return this._activePointers.some((i=>i.pointerId===t&&(e=i,!0))),e}_encloseToBoundary(t,e,i){const r=e.lengthSq();if(0===r)return t;const n=Sa.copy(e).add(t),s=this._boundary.clampPoint(n,Ta).sub(n),o=s.lengthSq();if(0===o)return t.add(e);if(o===r)return t;if(0===i)return t.add(e).add(s);{const r=1+i*o/e.dot(s);return t.add(Sa.copy(e).multiplyScalar(r)).add(s.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(ia(this._camera)){const t=this._camera,e=t.near,i=t.getEffectiveFOV()*be.MathUtils.DEG2RAD,r=Math.tan(.5*i)*e,n=r*t.aspect;this._nearPlaneCorners[0].set(-n,-r,0),this._nearPlaneCorners[1].set(n,-r,0),this._nearPlaneCorners[2].set(n,r,0),this._nearPlaneCorners[3].set(-n,r,0)}else if(ra(this._camera)){const t=this._camera,e=1/t.zoom,i=t.left*e,r=t.right*e,n=t.top*e,s=t.bottom*e;this._nearPlaneCorners[0].set(i,n,0),this._nearPlaneCorners[1].set(r,n,0),this._nearPlaneCorners[2].set(r,s,0),this._nearPlaneCorners[3].set(i,s,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1))return t;if(ua(this._camera,"_collisionTest"))return t;const e=Aa.setFromSpherical(this._spherical).divideScalar(this._spherical.radius);Ba.lookAt(wa,e,this._camera.up);for(let i=0;i<4;i++){const r=Sa.copy(this._nearPlaneCorners[i]);r.applyMatrix4(Ba);const n=Ta.addVectors(this._target,r);ka.set(n,e),ka.far=this._spherical.radius+1;const s=ka.intersectObjects(this.colliderMeshes);0!==s.length&&s[0].distance<t&&(t=s[0].distance)}return t}getDirection(){return Aa.setFromSpherical(this._sphericalEnd).applyQuaternion(this._yAxisUpSpaceInverse).normalize().negate()}_getClientRect(t){const e=this._domElement.getBoundingClientRect();return t.x=e.left,t.y=e.top,this._viewport?(t.x+=this._viewport.x,t.y+=e.height-this._viewport.w-this._viewport.y,t.width=this._viewport.z,t.height=this._viewport.w):(t.width=e.width,t.height=e.height),t}_createOnRestPromise(t){return t?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise((t=>{const e=()=>{this.removeEventListener("rest",e),t()};this.addEventListener("rest",e)})))}_removeAllEventListeners(){}}const Va={PAN:ja.ACTION.TRUCK,ROTATE:ja.ACTION.ROTATE,ZOOM:ja.ACTION.ZOOM,DOLLY:ja.ACTION.DOLLY,DOLLY_PAN:ja.ACTION.DOLLY_TRUCK,ZOOM_PAN:ja.ACTION.ZOOM_TRUCK,NONE:ja.ACTION.NONE},{OrthographicCamera:za,PerspectiveCamera:Ga,Clock:Ha}=be,Xa=["minAzimuthAngle","maxAzimuthAngle","minDistance","maxDistance","maxPolarAngle","minPolarAngle","minZoom","maxZoom"];class Wa extends ui{constructor(t,e){if(super(),!t)throw new Error("init cameraControl error, need Viewer instance");this.viewer=t;const{width:i,height:r}=t.getSize(),n=this.option=pt({width:i,height:r,far:1e4,near:.05,fov:60,orthoFar:1e4,orthoNear:-1e4,aspect:null,isOrtho:!1,center:{x:0,y:0,z:0},position:{x:0,y:50,z:100},enabled:!0,mouseButtonLeft:"rotate",mouseButtonRight:"pan",mouseButtonWheel:"dolly",mouseButtonMiddle:"dolly",moveStep:.25,rotateAngle:1,keypress:!1,type:"3d",minAzimuthAngle:-1/0,maxAzimuthAngle:1/0,minDistance:1,maxDistance:1e4,maxPolarAngle:.5*Math.PI,minPolarAngle:0,dollyToCursor:!0,draggingDampingFactor:4},e||{});this.isOrtho=n.isOrtho,this.type="3d",this.orthographicCamera=null,this.orthographicCameraControls=null,this.perspectiveCamera=null,this.perspectiveCameraControls=null,this._updateClock=new Ha,this._keypress=n.keypress||!1,this.moveStep=n.moveStep||.1,this.rotateAngle=n.rotateAngle||1,this.keypressed={KeyD:!1,KeyA:!1,KeyS:!1,KeyW:!1,ArrowUp:!1,ArrowDown:!1,ArrowLeft:!1,ArrowRight:!1,shift:!1},ht(["_cameraControlStart","_cameraUpdateDelay","_keyDown","_keyUp"],this),this._initCamera(n),this.setRange(n),this.setInteract(n),this.setType(n.type),this._initEvent(),this.updateProjectionMatrix()}tick(t){if(!this.control)return!0;return this.control.update(t)}_initCamera(t){const{width:e,height:i,fov:r,near:n,far:s,orthoNear:o,orthoFar:a,enabled:l,center:h,position:c}=t,d=e/i,u=this.viewer.rendererContainer;this.orthographicCamera=new za(e/-2,e/2,i/2,i/-2,o||n,a||s);const p=this.orthographicCameraControls=new ja(this.orthographicCamera,u);p.enabled=l,this.perspectiveCamera=new Ga(r,d,n,s);const m=this.perspectiveCameraControls=new ja(this.perspectiveCamera,u);m.enabled=l,Object.keys(pe).forEach((t=>{p.camera.layers.enable(pe[t]),m.camera.layers.enable(pe[t])})),this.setCenter(h,!1),this.setPosition(c,!1)}_cameraControlStart(t){}_cameraUpdateDelay(t){if(!this.viewer.sm)return;const e=this.viewer.sm.getScene();if(e){if(e&&e.avoidBillboards.length){e.avoidBillboards.each((t=>{t.updateScale()})),e.avoid&&e.updateAvoid(this.viewer)}this.viewer._updatePopups(),this.viewer._updateControls(),e._updateDefaultLight(),this.viewer.rm.enableRender()}}_cameraUpdateImmediately(){if(!this.viewer.sm)return;const t=this.viewer.sm.getScene();t&&(this.viewer._updatePopups(),t._updateDefaultLight(),this.viewer.rm.enableRender())}_keyDown(t){if(!this.keypress)return;let e=t.code;e=e.indexOf("hift")>0?"shift":e,void 0!==this.keypressed[e]&&(this.keypressed[e]=!0,this._keypressedHandle())}_keyUp(t){if(!this.keypress)return;let e=t.code;e=e.indexOf("hift")>0?"shift":e,void 0!==this.keypressed[e]&&(this.keypressed[e]=!1)}_keypressedHandle(){if(!this.keypress)return;const{moveStep:t,rotateAngle:e,type:i}=this,{KeyA:r,KeyD:n,KeyW:s,KeyS:o,ArrowDown:a,ArrowUp:l,ArrowLeft:h,ArrowRight:c,shift:d}=this.keypressed;d?"3d"==this.type&&(a&&this.truck(0,.5*-t,!1),l&&this.truck(0,.5*t,!1)):(r&&this.pan(-1*t,0,!1),n&&this.pan(t,0,!1),s&&this.forward(t,!1),o&&this.forward(-1*t,!1),"3d"==i&&(c&&this.rotate(e,0,!1),h&&this.rotate(-1*e,0,!1),a&&this.rotate(0,-1*e,!1),l&&this.rotate(0,e,!1))),this.cameraUpdateEvent()}_initEvent(){this.step=0,this.cameraUpdateEvent=ut(this._cameraUpdateDelay,0,this),this.cameraUpdateImmediately=ut(this._cameraUpdateImmediately,100,this),this.control.addEventListener("controlstart",this._cameraControlStart),this.control.addEventListener("control",this.cameraUpdateEvent),this.control.addEventListener("sleep",this.cameraUpdateEvent),this.control.addEventListener("controlend",this.cameraUpdateEvent),this.control.addEventListener("wake",this.cameraUpdateEvent),window.addEventListener("keydown",this._keyDown),window.addEventListener("keyup",this._keyUp)}get enabled(){return this.control.enabled}set enabled(t){this.enabled!==t&&this.setEnabled(t)}get keypress(){return this._keypress}set keypress(t){this._keypress!==t&&(this._keypress=!!t)}setEnabled(t){this.perspectiveCameraControls.enabled=!!t,this.orthographicCameraControls.enabled=!!t}setInteract(t){if(t&&!tt(t))for(const e in t)["mouseButtonLeft","mouseButtonRight","mouseButtonWheel","mouseButtonMiddle"].includes(e)&&(this[e]=t[e]);const{mouseButtonLeft:e,mouseButtonRight:i,mouseButtonWheel:r,mouseButtonMiddle:n}=this,s={left:e?.toUpperCase(),right:i?.toUpperCase(),wheel:r?.toUpperCase(),middle:n?.toUpperCase()};for(const t in s)this.perspectiveCameraControls.mouseButtons[t]=Va[s[t]],this.orthographicCameraControls.mouseButtons[t]="wheel"===t||"middle"===t?Va.ZOOM:Va[s[t]];this.control.dollySpeed=t.dollySpeed||.5,this.control.truckSpeed=t.truckSpeed||2*t.moveStep||1,this.control.dampingFactor=t.dampingFactor||.3,this.control.draggingDampingFactor=t.draggingDampingFactor||1,this.control.dollyToCursor=t.dollyToCursor}setRange(t,e){if(t)if(Q(t)&&void 0!==e&&Xa.includes(t))this.control[t]=e;else if(q(t))for(const e in t)void 0!==t[e]&&Xa.includes(e)&&(this.control[e]=t[e])}getRange(t){return Xa.includes(t)?this.control[t]:void 0}updateProjectionMatrix(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix()}setSize(t,e){if(!J(t)||!J(e))return this;this.width=t,this.height=e;const i=t/e,{perspectiveCamera:r,orthographicCamera:n}=this;return r.aspect=i,n.left=-t/2,n.right=t/2,n.top=e/2,n.bottom=-e/2,this.updateProjectionMatrix(),this}get fov(){return this.camera.fov}set fov(t){this.setFov(t)}setFov(t){return J(t)&&t>=0&&(this.camera.fov=t,this.camera.updateProjectionMatrix()),this}setOrtho(t){if(K(t)||this.isOrtho===t)return this;const e=this.viewer.rendererManager.effectRenderer.enable;this.viewer.rendererManager.setMainRendererEnable(!1);const{perspectiveCamera:i,orthographicCamera:r,orthographicCameraControls:n,perspectiveCameraControls:s}=this,o=this.center,a=this.position;if(t){if(!this.isOrtho){const t=i.fov;var l=2*Math.tan(t/2*Math.PI/180)*a.distanceTo(o),h=l*i.aspect;r.left=-h/2,r.right=h/2,r.top=l/2,r.bottom=-l/2,n.setPosition(a.x,a.y,a.z,!1),n.setTarget(o.x,o.y,o.z,!1),this.control._sphericalEnd.makeSafe(),this.control._needsUpdate=!0}}else this.isOrtho&&(s.setPosition(a.x,a.y,a.z,!1),s.setTarget(o.x,o.y,o.z,!1),this.control._sphericalEnd.makeSafe(),this.control._needsUpdate=!0);return this.isOrtho=!this.isOrtho,this.camera.updateProjectionMatrix(),this._cameraUpdateDelay(),this.viewer.rendererManager.setMainRendererEnable(e),this}setType(t){if(!t||this.type===t)return;this.enableRotate(),this.type=t;const{polarAngle:e,azimuthAngle:i,maxPolarAngle:r,minPolarAngle:n}=this.control;switch(t){case"2d":this._tempPolarAngle=e,this._tempPolarMaxAngle=r,this._tempPolarMinAngle=n,this.setOrtho(!0),this.control.rotateTo(i,0),this.control._sphericalEnd.phi=0,this.control._sphericalEnd.makeSafe(),this.control.maxPolarAngle=0,this.control.minPolarAngle=0,this.control._needsUpdate=!0;break;case"3d":this.setOrtho(!1),void 0!==this._tempPolarAngle&&(this.control.rotateTo(i,this._tempPolarAngle),this.control.maxPolarAngle=this._tempPolarMaxAngle,this.control.minPolarAngle=this._tempPolarMinAngle)}this._cameraUpdateDelay()}get position(){return this.control.getPosition()}set position(t){this.setPosition(t,!0)}setPosition(t,e){const i=ti(t);return i&&this.control.setPosition(i.x,i.y,i.z,e),this}get center(){return this.control.getTarget()}set center(t){this.setCenter(t,!0)}setCenter(t,e=!1){const i=ti(t);return i&&this.control.setTarget(i.x,i.y,i.z,e),this}get far(){return this.camera.far}set far(t){this.setFar(t)}setFar(t){J(t)&&t>1e-5&&(this.camera.far=t,this.camera.updateProjectionMatrix())}get near(){return this.camera.near}set near(t){this.setNear(t)}setNear(t){J(t)&&t>1e-5&&(this.camera.near=t,this.camera.updateProjectionMatrix())}get zoom(){return this.camera.zoom}set zoom(t){this.setZoom(t)}setZoom(t){this.control.zoomTo(t)}get camera(){return this.isOrtho?this.orthographicCamera:this.perspectiveCamera}get control(){return this.isOrtho?this.orthographicCameraControls:this.perspectiveCameraControls}toPerspective(){this._initRange(),this.setOrtho(!1),this._switch2DTo3D()}_switch2DTo3D(){"2d"===this.type&&this.setType("3d")}disableRotate(t){["minAzimuthAngle","maxAzimuthAngle","minPolarAngle","maxPolarAngle"].forEach((t=>{void 0===this["_old_"+t]&&(this["_old_"+t]=this.control[t]),delete this["_old"+t]})),(!t||t&&t.disableAzimuthAngle)&&(this.setRange("minAzimuthAngle",0),this.setRange("maxAzimuthAngle",0)),(!t||t&&t.disablePolarAngle)&&(this.setRange("minPolarAngle",this.control.polarAngle),this.setRange("maxPolarAngle",this.control.polarAngle))}enableRotate(){["minAzimuthAngle","maxAzimuthAngle","minPolarAngle","maxPolarAngle"].forEach((t=>{void 0!==this["_old_"+t]&&(this.setRange(t,this["_old_"+t]),delete this["_old_"+t])}))}_initRange(){this.control.minAzimuthAngle=-1/0,this.control.maxAzimuthAngle=1/0,this.control.minPolarAngle=-1/0,this.control.maxPolarAngle=1/0}toFrontView(){this._initRange(),this._switch2DTo3D(),this.setOrtho(!0),this.rotateTo(0,90,{enableTransition:!1}),this.setRange("minAzimuthAngle",0),this.setRange("maxAzimuthAngle",0),this.setRange("minPolarAngle",Math.PI/2),this.setRange("maxPolarAngle",Math.PI/2)}toBackView(){this._initRange(),this._switch2DTo3D(),this.setOrtho(!0),this.rotateTo(-180,90,{enableTransition:!1}),this.setRange("minAzimuthAngle",-Math.PI),this.setRange("maxAzimuthAngle",-Math.PI),this.setRange("minPolarAngle",Math.PI/2),this.setRange("maxPolarAngle",Math.PI/2)}toLeftView(){this._initRange(),this._switch2DTo3D(),this.setOrtho(!0),this.rotateTo(-90,90,{enableTransition:!1}),this.setRange("minAzimuthAngle",-Math.PI/2),this.setRange("maxAzimuthAngle",-Math.PI/2),this.setRange("minPolarAngle",Math.PI/2),this.setRange("maxPolarAngle",Math.PI/2)}toRightView(){this._initRange(),this._switch2DTo3D(),this.setOrtho(!0),this.rotateTo(90,90,{enableTransition:!1}),this.setRange("minAzimuthAngle",Math.PI/2),this.setRange("maxAzimuthAngle",Math.PI/2),this.setRange("minPolarAngle",Math.PI/2),this.setRange("maxPolarAngle",Math.PI/2)}toTopView(){this._initRange(),this._switch2DTo3D(),this.setOrtho(!0),this.control.rotatePolarTo(0),this.setRange("minPolarAngle",0),this.setRange("maxPolarAngle",0)}toBottomView(){this._initRange(),this._switch2DTo3D(),this.setOrtho(!0),this.control.rotatePolarTo(Math.PI),this.setRange("minPolarAngle",Math.PI),this.setRange("maxPolarAngle",Math.PI)}pan(t,e,i){return this.control.truck(t,e,i),this.viewer.rendererManager.enableRender(),this}forward(t,e){return this.control.forward(t||0,e),this.viewer.rendererManager.enableRender(),this}moveTo(t,e,i,r){return this.control.moveTo(t,e,i,r),this.viewer.rendererManager.enableRender(),this}fitTo(t,e){const i=pt({enableTransition:!1,paddingLeft:1,paddingRight:1,paddingTop:1,paddingBottom:1},e||{}),{polarAngle:r,azimuthAngle:n}=this.control;if(t instanceof be.Object3D){const e=t.getBox3();if(e.min.x==1/0||e.max.x==1/0)return}return this.control.fitToBox(t,i.enableTransition,i),this.control.rotateTo(n,r),this}fitToScene(t){this.fitTo(this.viewer.scene.root,t)}lookAt(t,e,i){return e=e||this.camera.position.clone(),this.control.setLookAt(e.x,e.y,e.z,t.x,t.y,t.z,i),this}rotate(t,e,i){const r=pt({enableTransition:!0,unit:"degree"},i||{});return t=t||0,e=e||0,"degree"===r.unit&&(t=be.Math.degToRad(t),e=be.Math.degToRad(e)),e="3d"===this.type?e:0,this.control.rotate(t,e,r.enableTransition),this}rotateTo(t,e,i){const r=pt({enableTransition:!0,unit:"degree"},i||{});let n=t||0,s=e||0;return"degree"===r.unit&&(n=be.Math.degToRad(t),s=be.Math.degToRad(e)),s="3d"===this.type?s:0,J(t)&&J(e)?this.control.rotateTo(n,s,r.enableTransition):J(t)?this.control.rotateAzimuthTo(n,r.enableTransition):J(e)&&this.control.rotatePolarTo(s,r.enableTransition),this}truck(t,e,i){this.control.truck(t||0,e||0,i)}removeEvent(){this.control._removeAllEventListeners(),window.removeEventListener("keydown",this._keyDown),window.removeEventListener("keyup",this._keyUp)}setFirstPersonMode(t,e){if(this.firstPersonMode=!!t,this._switch2DTo3D(),e=e||{},this._oldInteract?t||(this.setInteract({mouseButtonLeft:this._oldInteract.mouseButtonLeft,mouseButtonRight:this._oldInteract.mouseButtonRight}),this.keypress=this._oldInteract.keypress,this.control.minDistance=this._oldInteract.minDistance,this.control.maxDistance=this._oldInteract.maxDistance,this.control.maxPolarAngle=this._oldInteract.maxPolarAngle,this.control.minPolarAngle=this._oldInteract.minPolarAngle,this.control.azimuthRotateSpeed=this._oldInteract.azimuthRotateSpeed,this.control.polarRotateSpeed=this._oldInteract.polarRotateSpeed,this.control.reset().then((()=>{this.setPosition(this._oldInteract.position)}))):this._oldInteract={mouseButtonLeft:this.mouseButtonLeft,mouseButtonMiddle:this.mouseButtonMiddle,mouseButtonRight:this.mouseButtonRight,mouseButtonWheel:this.mouseButtonWheel,keypress:this.keypress,minDistance:this.control.minDistance,maxDistance:this.control.maxDistance,minPolarAngle:this.control.minPolarAngle,maxPolarAngle:this.control.maxPolarAngle,azimuthRotateSpeed:this.control.azimuthRotateSpeed,polarRotateSpeed:this.control.polarRotateSpeed,position:this.position.clone(),target:this.control.getTarget()},t){this.control.minDistance=this.control.maxDistance=1,this.control.azimuthRotateSpeed=-.1,this.control.polarRotateSpeed=-.1,this.control.touches.two="TOUCH_ZOOM_TRUCK",this.control.saveState();const t=this.position.clone();e.offsetY&&(t.y+=e.offsetY||0),t.z+=e.offsetZ||0,t.x+=e.offsetX||0;let i=this.control.getTarget();this.lookAt(i,t,!1),this.control.maxPolarAngle=180*be.Math.DEG2RAD,this.setInteract({mouseButtonLeft:"ROTATE",mouseButtonRight:"PAN"}),this.keypress=!0}}getEyeVector(){let t=this.camera;return t?this.control._target.clone().sub(t.position):new be.Vector3(0,0,-1)}destroy(){this.keypress=!1,this.removeEvent(),this.control.dispose(),this.perspectiveCamera=null,this.perspectiveCameraControls=null,this.orthographicCamera=null,this.orthographicCameraControls=null}}class Ya extends Mo{constructor(t){super(t),this.isGroup=!0,this.type="Group"}toJSON(t){const e=super.toJSON();return{children:this.children.map((e=>e.toJSON(t))),object:{...e.object,children:void 0},config:{...e.config,...this.option},name:this.name,type:this.type}}}var Qa={helper:{grid:{visible:!1,size:200,divisions:200,color1:"#1b1b1b",color2:"#050505",position:[0,0,0]},axes:{visible:!1,size:2e3}},defaultLights:{enable:!0,csm:{enable:!0,maxFar:100,cascades:4,lightColor:"#FFFFFF",lightIntensity:.15,lightDirection:[-.577,-.577,.577]},ambientLight:{intensity:.8,color:16777215},hemisphereLight:{intensity:.5,color:16777215,groundColor:8947848},secondaryLight:{intensity:.2,color:16777215,alpha:.5,beta:.866}},fog:{visible:!1,color:"#ffffff",near:10,far:30},background:"#3C3C3C",envmap:"",avoid:!1,avoidPadding:4,meta:[]};class Ja{constructor(t){t=t||{},this.boxs=[],this.padding=t.padding||0}clear(){this.boxs.length=0}push(t){if(0===this.boxs.length)return this.boxs.push(t),!1;for(let e=0;e<this.boxs.length;e++)if(this.collision(this.boxs[e],t))return!0;return this.boxs.push(t),!1}collision(t,e){if(!t||!e)return!0;const i=this.padding;return t.min.x<e.max.x+i&&e.min.x-i<t.max.x&&t.min.y<e.max.y+i&&e.min.y-i<t.max.y}}function Za(t){return t instanceof qa}class qa{constructor(){this._items=[],this.maxLength=5e3;const t=arguments.length;if(1===t){let t=arguments[0];if(Za(t)&&(t=t._items),isArray(t)){for(let e=Math.min(t.length,this.maxLength),i=0;e>i;i++)this._items.push(t[i])}else null!=t&&this._items.push(t)}else if(t>1){let e=Math.min(t,this.maxLength);for(let t=0;e>t;t++)this._items.push(arguments[t])}}forEach(t,e){this.each(t,e)}push(){if(!(this._items.length>=this.maxLength))for(var t=0;t<arguments.length;t++)this.add(arguments[t])}pop(){return this._items.pop()}shift(){return this._items.shift()}unshift(){if(!(this._items.length>=this.maxLength))return this._items.unshift.apply(this._items,arguments)}size(){return this._items.length}isEmpty(){return 0===this._items.length}add(t,e){this._items.length>=this.maxLength||(void 0===e?this._items.push(t):this._items.splice(e,0,t))}addAll(t){this._items.length>=this.maxLength||(Za(t)&&(t=t._items),isArray(t)?appendArray(this._items,t):this._items.push(t))}get(t){return this._items[t]}slice(t,e){return new qa(this._items.slice(t,e))}remove(t){var e=this._items.indexOf(t);return e>=0&&e<this._items.length&&this.removeAt(e),e}removeAt(t){return this._items.splice(t,1)[0]}set(t,e){return this._items[t]=e}clear(){return this._items.splice(0,this._items.length)}contains(t){return this._items.indexOf(t)>=0}indexOf(t){return this._items.indexOf(t)}each(t,e){for(var i=0,r=this._items.length;r>i;i++){var n=this._items[i];e?t.call(e,n,i,this):t(n,i,this)}}reverseEach(t,e){for(var i=this._items.length-1;i>=0;i--){var r=this._items[i];e?t.call(e,r):t(r)}}getArray(){return this._items}toArray(t,e){if(t){for(var i,r=[],n=0,s=this._items.length;s>n;n++)i=this._items[n],e?t.call(e,i)&&r.push(i):t(i)&&r.push(i);return r}return this._items.concat()}toList(t,e){if(t){for(var i,r=new qa,n=0,s=this._items.length;s>n;n++)i=this._items[n],e?t.call(e,i)&&r.add(i):t(i)&&r.add(i);return r}return new qa(this)}reverse(){this._items.reverse()}sort(t){return this._items.sort(t||sortFunc),this}toString(){return this._items.toString()}get length(){return this._items.length}set length(t){this._items.length=t}}const{ObjectLoader:Ka}=THREE;class $a extends Ka{async parseAsync(t){if(!t)return[];t.models&&t.models.length>0&&await this.parseModels(t.models);const e=({type:t,config:i,object:r,name:n,material:s,geometry:o,children:a})=>{const l=Mf(t,n,i);return l?(l.isGroup&&(r&&l.copy(super.parseObject(r)),a&&a.forEach((t=>{const i=e(t);i&&l.add(i)}))),l):null};return t.things?t.things.map(e):[]}parseModels(t,e){(t=t||[]).length;const i=t.map((t=>new Promise((e=>{let i=mo.getById(t.id);i?e():(i=mo.set(t),i.once("loaded",(()=>{e()})))}))));return Promise.all(i)}}class tl extends be.DataTextureLoader{constructor(t){super(t),this.type=be.HalfFloatType}parse(t){const e=function(t,e){switch(t){case 1:console.error("THREE.RGBELoader Read Error: "+(e||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(e||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(e||""));break;default:console.error("THREE.RGBELoader: Error: "+(e||""))}return-1},i=function(t,e,i){e=e||1024;let r=t.pos,n=-1,s=0,o="",a=String.fromCharCode.apply(null,new Uint16Array(t.subarray(r,r+128)));for(;0>(n=a.indexOf("\n"))&&s<e&&r<t.byteLength;)o+=a,s+=a.length,r+=128,a+=String.fromCharCode.apply(null,new Uint16Array(t.subarray(r,r+128)));return-1<n&&(!1!==i&&(t.pos+=s+n+1),o+a.slice(0,n))},r=function(t,e,i,r){const n=t[e+3],s=Math.pow(2,n-128)/255;i[r+0]=t[e+0]*s,i[r+1]=t[e+1]*s,i[r+2]=t[e+2]*s,i[r+3]=1},n=function(t,e,i,r){const n=t[e+3],s=Math.pow(2,n-128)/255;i[r+0]=be.DataUtils.toHalfFloat(Math.min(t[e+0]*s,65504)),i[r+1]=be.DataUtils.toHalfFloat(Math.min(t[e+1]*s,65504)),i[r+2]=be.DataUtils.toHalfFloat(Math.min(t[e+2]*s,65504)),i[r+3]=be.DataUtils.toHalfFloat(1)},s=new Uint8Array(t);s.pos=0;const o=function(t){const r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,n=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,a={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,h;if(t.pos>=t.byteLength||!(l=i(t)))return e(1,"no header found");if(!(h=l.match(/^#\?(\S+)/)))return e(3,"bad initial token");for(a.valid|=1,a.programtype=h[1],a.string+=l+"\n";l=i(t),!1!==l;)if(a.string+=l+"\n","#"!==l.charAt(0)){if((h=l.match(r))&&(a.gamma=parseFloat(h[1])),(h=l.match(n))&&(a.exposure=parseFloat(h[1])),(h=l.match(s))&&(a.valid|=2,a.format=h[1]),(h=l.match(o))&&(a.valid|=4,a.height=parseInt(h[1],10),a.width=parseInt(h[2],10)),2&a.valid&&4&a.valid)break}else a.comments+=l+"\n";return 2&a.valid?4&a.valid?a:e(3,"missing image size specifier"):e(3,"missing format specifier")}(s);if(-1!==o){const t=o.width,i=o.height,a=function(t,i,r){const n=i;if(n<8||n>32767||2!==t[0]||2!==t[1]||128&t[2])return new Uint8Array(t);if(n!==(t[2]<<8|t[3]))return e(3,"wrong scanline width");const s=new Uint8Array(4*i*r);if(!s.length)return e(4,"unable to allocate buffer space");let o=0,a=0;const l=4*n,h=new Uint8Array(4),c=new Uint8Array(l);let d=r;for(;d>0&&a<t.byteLength;){if(a+4>t.byteLength)return e(1);if(h[0]=t[a++],h[1]=t[a++],h[2]=t[a++],h[3]=t[a++],2!=h[0]||2!=h[1]||(h[2]<<8|h[3])!=n)return e(3,"bad rgbe scanline format");let i,r=0;for(;r<l&&a<t.byteLength;){i=t[a++];const n=i>128;if(n&&(i-=128),0===i||r+i>l)return e(3,"bad scanline data");if(n){const e=t[a++];for(let t=0;t<i;t++)c[r++]=e}else c.set(t.subarray(a,a+i),r),r+=i,a+=i}const u=n;for(let t=0;t<u;t++){let e=0;s[o]=c[t+e],e+=n,s[o+1]=c[t+e],e+=n,s[o+2]=c[t+e],e+=n,s[o+3]=c[t+e],o+=4}d--}return s}(s.subarray(s.pos),t,i);if(-1!==a){let e,s,l,h;switch(this.type){case be.FloatType:h=a.length/4;const t=new Float32Array(4*h);for(let e=0;e<h;e++)r(a,4*e,t,4*e);e=t,l=be.FloatType;break;case be.HalfFloatType:h=a.length/4;const i=new Uint16Array(4*h);for(let t=0;t<h;t++)n(a,4*t,i,4*t);e=i,l=be.HalfFloatType;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:t,height:i,data:e,header:o.string,gamma:o.gamma,exposure:o.exposure,format:s,type:l}}}return null}setDataType(t){return this.type=t,this}load(t,e,i,r){return super.load(t,(function(t,i){switch(t.type){case be.FloatType:case be.HalfFloatType:t.encoding=be.LinearEncoding,t.minFilter=be.LinearFilter,t.magFilter=be.LinearFilter,t.generateMipmaps=!1,t.flipY=!0}e&&e(t,i)}),i,r)}}const{Object3D:el,Box3:il,FileLoader:rl}=be;class nl extends be.Scene{constructor(){super(),this.isScene=!0,this.option=et(Qa),this.root=null,this.defaultLightGroup=null,this.helperGroup=null,this.dirty=!1,this.boundingBox=null,this._avoid=!1,this.avoidBillboards=new qa,this.boxCollision=new Ja({padding:this.option.avoidPadding}),this.particles=new qa,this.mixer=new be.AnimationMixer(this),this._initRoot(),this._initEvents()}async _initThing(){const t=new $a;(await t.parseAsync(this.option.meta)).forEach((t=>{this.add(t)})),this.dispatchEvent({type:"ready"})}async preload(t){if(!t)return;const e=new $a;await e.parseAsync(t),this.dispatchEvent({type:"preloaded"})}async _init(t){if(this._avoid=!!this.option.avoid,this.avoidPadding=this.option.avoidPadding,this.setBackground(this.option.background),this._initDefaultLights(t),this.setFog(),this._initHelper(),await this._initThing(),t){const e=this.option.defaultLights.csm;this.csm=new mf({mode:"practical",parent:this.defaultLightGroup,camera:t.camera,...e}),this.csm.setEnable(e.enable),this.option.defaultLights.enable&&e.enable&&this.csm.update(),this.setEnvironment(this.option.envmap,t.rendererManager)}this._inited||(this._inited=!0,setTimeout((()=>{this.dispatchEvent({type:"inited"})}),200))}_initHelper(){this.helperGroup||(this.helperGroup=new Ya,this.helperGroup.name="helperGroup",this.add(this.helperGroup,this)),this.setHelper()}updateAvoid(t){if(!t)return;const{avoid:e,boxCollision:i,avoidBillboards:r}=this;this.boxCollision.clear(),e&&0!=r.length&&r.each((e=>{if(e&&e.avoid&&(e.updateBox(t),!1!==e.parent.visible)){let t=i.push(e.box2d);e.avoid&&(e.visible=!t)}}))}clearAvoidBillboards(){this.boxCollision.clear(),this.avoidBillboards.clear()}_restoreAvoidBillboards(){this.boxCollision.clear(),this.avoidBillboards.each((t=>{t.visible=!0}))}_initEvents(){this.addEventListener("resource.loaded",(function(t){const e=t.resource;if(e&&e===this._backgroundResource)switch(e.type){case Kt.CubeTexture:case Kt.TEXTURE:this.background=e.data}}))}_initRoot(){this.root=new Ya,this.root.name="root",this.root.isRoot=!0,this.add(this.root,this),this.tempRoot=new Ya,this.tempRoot.name="tempRoot",this.add(this.tempRoot,this)}_initDefaultLights(t){this.defaultLightGroup||(this.defaultLightGroup=new Ya,this.defaultLightGroup.name="defaultLightsGroup",this.add(this.defaultLightGroup,this)),this.defaultLightGroup.clear();const e=this.defaultLightGroup;e.visible=this.option.defaultLights.enable;[["ambientLight","ambient"],["hemisphereLight","hemisphere"],["secondaryLight","directional"]].forEach((t=>{const i=t[0];let r=null;switch(t[1]){case"ambient":r=new be.AmbientLight;break;case"directional":r=new be.DirectionalLight;break;case"hemisphere":r=new be.HemisphereLight(16777215,2236962,1)}if(r){r.name=i;const t=e.getObjectByName(r.name);t&&e.remove(t),e.add(r)}})),!this.csm&&t&&t.cameraControl,this.setDefaultLights()}setDefaultLights(t){pt(this.option.defaultLights,et(t||{}));const e=this.option.defaultLights,i=this.defaultLightGroup;if(i.visible=e.enable,["ambientLight","hemisphereLight"].forEach((t=>{const r=i.getObjectByName(t);if(r){const{intensity:i,color:n,groundColor:s}=e[t];r.intensity=i;const o=ni(n);r.color.set(o),s&&r.groundColor.set(ni(s))}})),["secondaryLight"].forEach((t=>{const r=i.getObjectByName(t);if(r){const{intensity:i,color:s,shadow:o,shadowQuality:a}=e[t];r.intensity=i,r.visible=i>0;const l=ni(s);if(r.color.set(l),r.castShadow=o,o){var n={low:512,medium:1024,high:2048,ultra:4096}[a]||1024;r.shadow.bias=-.005,r.shadow.mapSize.set(n,n)}}})),this.csm){const t=e.csm,i=e.enable&&t.enable;this.csm.setEnable(i);for(const e in t)if("lightDirection"==e){let e=(new be.Vector3).fromArray(t.lightDirection);this.csm.lightDirection.copy(e)}else this.csm[e]=t[e];this.csm.updateWithParams()}this._updateDefaultLight()}_updateDefaultLight(t){t=t||(this.viewer?this.viewer.cameraControl:null);const e=this.defaultLightGroup;if(!e||!e.visible||!t)return;const i=(new be.Box3).setFromObject(this);if(!i)return;const r=new be.Sphere;i.getBoundingSphere(r),["secondaryLight"].forEach((i=>{const r=e.getObjectByName(i);if(r){(t?t.position:null)&&(r.target.position.copy(t.control.getTarget()),r.position.copy(t.control.getPosition()),r.target.updateMatrixWorld(!0))}}))}setHelper(t){pt(this.option.helper,t||{});const{grid:e,axes:i}=this.option.helper;this.updateAxesHelper(i),this.updateGridHelper(e)}get gridHelperVisible(){const t=this.helperGroup;let e=!1;return["BaseGrid","ExtendGrid"].forEach((i=>{let r=t.getObjectByName(i);r&&(e=void 0===r.visible||r.visible)})),e}set gridHelperVisible(t){const e=this.helperGroup;["BaseGrid","ExtendGrid"].forEach((i=>{let r=e.getObjectByName(i);r&&(r.visible=t)})),this.option.helper.grid.visible=t}updateGridHelper(t){const e=this.helperGroup;["BaseGrid","ExtendGrid"].forEach((i=>{let r=e.getObjectByName(i);t=t||this.option.helper.grid||{};let n="ExtendGrid"==i?.2:1;if(r||(r=new be.GridHelper(t.size,t.divisions*n,t.color1,t.color1),t.color2,r.material.vertexColors=!1,r.name=i,t.onTop,e.add(r)),t.divisions&&t.size){let e=new be.GridHelper(t.size,t.divisions*n);r.geometry=e.geometry.clone(),r.userData.divisions=t.divisions,r.userData.size=t.size}Lt(t.visible)&&(r.visible=t.visible),t.color1&&"BaseGrid"==r.name&&(r.material.color=new be.Color(t.color1),r.userData.color=r.material.color.toHexString()),t.color2&&"ExtendGrid"==r.name&&(r.material.color=ni(t.color2),r.userData.color=r.material.color.toHexString()),Lt(t.opacity)&&(r.material.transparent=t.opacity<1,r.material.opaicty=t.opacity)})),e.traverse((t=>{t._thing_tag="helper",t.layers.set(pe.IGNORE_RAYCAST)}))}updateAxesHelper(t){if(!t)return;const e="axesHelper",i=this.helperGroup;let r=i.getObjectByName(e);if(r||(r=new be.AxesHelper(t.size),r.layers.set(pe.IGNORE_RAYCAST),r.name=e,i.add(r),this.axesHelper=r),r&&(Lt(t.visible)&&(r.visible=t.visible),t.size)){let e=new be.AxesHelper(t.size);e.layers.set(pe.IGNORE_RAYCAST),r.geometry=e.geometry.clone(),e.remove(),e=null}i.traverse((t=>{t._thing_tag="helper",t.layers.set(pe.IGNORE_RAYCAST)}))}updateBoundingBox(){return this.boundingBox?this.boundingBox.setFromVisibleObject(this):this.boundingBox=(new il).setFromVisibleObject(this),this}setFog(t){pt(this.option.fog,t||{});const{color:e,near:i,far:r,visible:n,density:s,isExp2:o}=this.option.fog;return this.fog,this.fog=o?n?new be.Fog(ni(e),s):null:n?new be.Fog(ni(e),i,r):null,this}update(t){this.deltaTime=t}_addObject(t,e){if(!t||!t instanceof el)return null;t.properties||(t.properties={}),t.properties.uuid||(t.properties.uuid=t.uuid);let i=e;(J(i)||Q(i))&&(i=this.getObjectById(i)),i||(i=this.root),t.traverse((t=>{t.scene=this,t.dispatchEvent({type:te,scene:this}),t.addEventListener(t.isSync?"resource.loaded":"added",(()=>{this.dispatchEvent({type:ee,action:"add",object:t})}))})),e===this?be.Scene.prototype.add.call(this,t):i.add(t)}add(t,e){if(!t)return this;if(t instanceof el)return this._addObject(t,e),t;if(q(t)&&!K(t.type)){const{type:i,config:r,children:n,name:s}=t,o=Mf(i,s,r,n);return o?(this._addObject(o,e),o.helper&&this.helperGroup.add(o.helper),o):this}if(W(t)){let i=[];for(let r=0;r<t.length;r++){let n=t[r];if(n instanceof el)this._addObject(n,e),i.push(n);else if(q(n)&&!K(n.type)){const{type:t,config:r,children:s,name:o}=n,a=Mf(t,o,r,s);this._addObject(a,e),i.push(a)}}return i}return this}remove(t){if(!t)return this;if(arguments.length>1)be.Scene.prototype.remove.call(this,arguments),this.dispatchEvent({type:ee,action:"remove",objects:[...arguments]});else if(1===arguments.length){let e=null;if(t instanceof el?e=[t]:J(t)?e=[this.getObjectById(t)]:W(t)&&(e=t),W(e)){for(let t=0;t<e.length;t++)if(e[t]){J(e[t])&&(e[t]=this.getObjectById(e[t]));let i=e[t];if(i instanceof el)if(i.parent instanceof nl)be.Scene.prototype.remove.call(this,i);else try{i.parent.remove(i)}catch(t){be.Scene.prototype.remove.call(this,i)}}this.dispatchEvent({type:ee,action:"remove",objects:e})}}return this}each(t){t&&Z(t)&&this.root.traverse((e=>{(e instanceof Fo||e!==this.root||!qe(e))&&t(e)}))}isEmpty(){return 0===this.size()}getObjectByAttribute(t,e){var i=[];return this.each((r=>{r.attr(t)===e&&i.push(r)})),i}toList(){let t=[];return this.each((e=>{t.push(e)})),t}getRoots(){return this.root.children.filter((t=>!qe(t)))}size(){let t=0;return this.each((()=>{t++})),t}clear(){return this.root.clear(),this.boxCollision.clear(),this.avoidBillboards.clear(),this.tempRoot.clear(),this.dispatchEvent({type:ee,action:"clear"}),this}getBrothers(t){const e=[];if(t&&t.parent){const i=t;for(let r=0;r<i.children.length;r++){let n=i.children[r];n==t||qe(n)||e.push(n)}}return e}getParents(t){var e=[];if(t)for(let i=t.parent;i;i=i.parent)e.push(i);return e}getVerticesCount(){var t=0;return this.traverse((function(e){e.isMesh&&(t+=e.verticesCount())})),t}destroy(){this.csm&&this.csm.dispose(),this.defaultLightGroup&&(this.defaultLightGroup.clear(),this.remove(this.defaultLightGroup)),this.clear(),this.remove(this.root),this.remove(this.tempRoot)}setEnvironment(t,e){if(e=e||(this.viewer?this.viewer.rm:null),pt(this.option,{envmap:t}),t)return e&&e.loadHDR(t).then((t=>{this.environment=t})),this;this.environment=null}setBackground(t){if(this.option.background=t||null,!t)return this.background=null,void(this._skyMesh&&(this._skyMesh.removeBySelf(),this._skyMesh=null));if(this._backgroundResource&&(this._backgroundResource.removeObject(this),mo.delete(this._backgroundResource.type,this._backgroundResource.id),this._backgroundResource=null),Q(t))return this.background=new be.Color(t),this;if(q(t)){if(t.color)return this.background=new be.Color(t),this;if(t.image){const e=mo.set({id:t.image,type:Kt.TEXTURE,object:this});if(t.isSky){const i=t.far||(this.viewer&&this.viewer.camrea?this.viewer.camrea.far:1e4),r=()=>{const t=new be.Mesh(new be.SphereGeometry(i),new be.MeshBasicMaterial({map:e.data,side:1}));this._skyMesh=t,this.root.add(t)};e.data?r():e.on("loaded",(()=>{r()}))}else this.background=e.data,this._backgroundResource=e;return this}if(t.skyboxPath){let e=Tt(t.skyboxPath);const i=mo.set({id:e,type:Kt.CubeTexture,object:this,config:{path:e,files:t.skyFiles}});return this.background=i.data,this._backgroundResource=i,this}if(t.hdr){return(new tl).loadAsync(mo.transformUrl(t.hdr)).then((t=>{t.mapping=be.EquirectangularReflectionMapping,t.encoding=be.sRGBEncoding,this.background=t,this.environment=t})),this}}return this}getRootTree({keyword:t,type:e}={}){return function i(r,n){for(var s=0,o=r.length;s<o;s++){var a=r[s];if(a.isThing||a.isNode||a.isLight||a.isGroup&&a.userData.isLinkGroup||a.isMesh&&!a.parent.isThing){var l=a.toJSON?a.toJSON():{};let r={children:[],id:a.uuid,name:a.name,config:l.config,userData:a.userData,type:l.type,locked:a.locked},s=!0;e&&(s=r.type==e),s&&(t?(!a.name||a.name.toLowerCase().indexOf(t.toLowerCase())>=0&&!r.userData.hideInTree)&&n.push(r):r.userData.hideInTree||n.push(r)),a.children.length>0&&(a.isNode,i(a.children,r.children))}}return n}(this.root.children,[])}toJSON(){function t(t){const e=[];for(const i in t){const r=t[i];delete r.metadata,e.push(r)}return e}const e={geometries:{},materials:{},textures:{},images:{},shapes:{},models:{},things:[]};const i=[];!function t(e,i){!e.isThing||e.userData.hideInTree||e.isRoot?e.children&&e.children.forEach((e=>{t(e,i)})):i(e)}(this.root,(t=>{i.push(t.toJSON(e))}));const r=t(e.geometries),n=t(e.materials),s=t(e.textures),o=t(e.images),a=t(e.shapes),l=t(e.models);return{...this.option,meta:{things:i,geometries:r,materials:n,textures:s,images:o,shapes:a,models:l,defaultLights:this.option.defaultLights}}}}Mt(nl,[{key:"defaultLightsEnable",get:function(){return this.defaultLightGroup.visible},set:function(t){this.defaultLightsEnable!==!!t&&(this.option.defaultLights.enable=!!t,this.defaultLightGroup&&(this.defaultLightGroup.visible=!!t))}}]),pi(nl),Mt(nl,[{key:"avoid",get:function(){return this._avoid},set:function(t){this._avoid=!!t,this._avoid||this._restoreAvoidBillboards(),this.updateAvoid(this.viewer)}},{key:"avoidPadding",get:function(){return this.boxCollision.padding},set:function(t){this.boxCollision.padding=t,this.updateAvoid(this.viewer)}}]);class sl extends ui{constructor(t,e){super(),this.viewer=t,this.option=pt(et(Qa),e),this.current=null,this.scenes={},this._background=null,this._backgroundResource=null,this._skyBox=null,this._skyBoxResource=null,this.sky=null,this.skyEffectLightConfigCache=null,this._fogConfig=null,this._fogLinear=null,this._fogExp2=null,this._enableDeafultViewPointFile=!1,this._defaultViewPointFileName="viewpoint.json",this._initScenes(),this._initRenderControl()}_initScenes(){const t=this.viewer,e=new nl;e.name="default",e._init(t),this.addScene(e);const i=this.sceneHelpers=new nl;i.name="sceneHelpers",this.addScene(i),i._initDefaultLights();const r=this.htmlScene=new nl;r.name="htmlScene",this.addScene(r)}getScene(t){return this.scenes[t||this.current||"default"]}get scene(){return this.getScene()}setCurrent(t){this.current=t}createScene(t){const e=new nl;return e.name=t,this.addScene(e),e}addScene(t){t.viewer=this.viewer,this.scenes[t.name||t.uuid]=t}loadScene(t,e,i){if(!t||!e)return;let r=this.scenes[t];r||(r=this.createScene(t));const n=this.viewer;async function s(t){r.clear(),r.option=pt(et(Qa),t||{}),await r._init(n),r.dispatchEvent({type:"loaded",viewer:n}),i&&i(r)}if(Q(e)){const t=new be.FileLoader;t.setResponseType("json"),t.load(e,(t=>{t?s(t):this.dispatchEvent({type:"error",message:"Scene config is null"})}),(t=>{this.dispatchEvent({type:"progress",progress:t})}),(t=>{this.dispatchEvent({type:"error",message:"Scene load failure"})}))}else s(e)}_initRenderControl(){new be.Vector3,new be.Vector3}destroy(){for(const t in this.scenes)this.scenes[t].destroy();this.scenes={}}}const ol=new be.Frustum,al=new be.Vector3,ll=new be.Vector3,hl=new be.Vector3,cl=new be.Vector3,dl=new be.Vector3,ul=new be.Vector3,pl=new be.Vector3,ml=new be.Vector3,fl=new be.Vector3,gl=new be.Vector3,vl=new be.Vector3,yl=new be.Vector3,wl=new be.Vector3,xl=new be.Vector3,bl=new be.Matrix4,_l=new be.Quaternion,Al=new be.Vector3;class Sl{constructor(t,e,i=Number.MAX_VALUE){this.camera=t,this.scene=e,this.startPoint=new be.Vector3,this.endPoint=new be.Vector3,this.collection=[],this.instances={},this.deep=i}filterCollection(t){let e=this.collection||[];e=e.map((t=>{let e=[];return t.traverseAncestors((t=>{(t.isMesh||t.isThing||t.isSprite||t.isBillboard)&&!t.isScene&&e.push(t)})),e[0]})).filter((t=>t&&"helper"!=t._thing_tag)),e=ot(e,((t,e)=>t.uuid==e.uuid)),this.filter&&Z(this.filter)&&(e=e.filter(this.filter)),t&&Z(t)&&(e=e.filter(t)),this.collection=e}select(t,e){return this.startPoint=t||this.startPoint,this.endPoint=e||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(ol,this.scene),this.filterCollection(),this.collection}updateFrustum(t,e){if(t=t||this.startPoint,e=e||this.endPoint,t.x===e.x&&(e.x+=Number.EPSILON),t.y===e.y&&(e.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){ll.copy(t),ll.x=Math.min(t.x,e.x),ll.y=Math.max(t.y,e.y),e.x=Math.max(t.x,e.x),e.y=Math.min(t.y,e.y),hl.setFromMatrixPosition(this.camera.matrixWorld),cl.copy(ll),dl.set(e.x,ll.y,0),ul.copy(e),pl.set(ll.x,e.y,0),cl.unproject(this.camera),dl.unproject(this.camera),ul.unproject(this.camera),pl.unproject(this.camera),yl.copy(cl).sub(hl),wl.copy(dl).sub(hl),xl.copy(ul).sub(hl),yl.normalize(),wl.normalize(),xl.normalize(),yl.multiplyScalar(this.deep),wl.multiplyScalar(this.deep),xl.multiplyScalar(this.deep),yl.add(hl),wl.add(hl),xl.add(hl);const i=ol.planes;i[0].setFromCoplanarPoints(hl,cl,dl),i[1].setFromCoplanarPoints(hl,dl,ul),i[2].setFromCoplanarPoints(ul,pl,hl),i[3].setFromCoplanarPoints(pl,cl,hl),i[4].setFromCoplanarPoints(dl,ul,pl),i[5].setFromCoplanarPoints(xl,wl,yl),i[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const i=Math.min(t.x,e.x),r=Math.max(t.y,e.y),n=Math.max(t.x,e.x),s=Math.min(t.y,e.y);cl.set(i,r,-1),dl.set(n,r,-1),ul.set(n,s,-1),pl.set(i,s,-1),ml.set(i,r,1),fl.set(n,r,1),gl.set(n,s,1),vl.set(i,s,1),cl.unproject(this.camera),dl.unproject(this.camera),ul.unproject(this.camera),pl.unproject(this.camera),ml.unproject(this.camera),fl.unproject(this.camera),gl.unproject(this.camera),vl.unproject(this.camera);const o=ol.planes;o[0].setFromCoplanarPoints(cl,ml,fl),o[1].setFromCoplanarPoints(dl,fl,gl),o[2].setFromCoplanarPoints(gl,vl,pl),o[3].setFromCoplanarPoints(vl,ml,cl),o[4].setFromCoplanarPoints(dl,ul,pl),o[5].setFromCoplanarPoints(gl,fl,ml),o[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(t,e){if(e.isMesh||e.isLine||e.isPoints||e.isSprite)if(e.isInstancedMesh){this.instances[e.uuid]=[];for(let i=0;i<e.count;i++)e.getMatrixAt(i,bl),bl.decompose(al,_l,Al),al.applyMatrix4(e.matrixWorld),t.containsPoint(al)&&"helper"!=e._thing_tag&&!e.isTransformControls&&this.instances[e.uuid].push(i)}else null===e.geometry.boundingSphere&&e.geometry.computeBoundingSphere(),al.copy(e.geometry.boundingSphere.center),al.applyMatrix4(e.matrixWorld),t.containsPoint(al)&&"helper"!=e._thing_tag&&!e.isTransformControls&&this.collection.push(e);if(e.children.length>0)for(let i=0;i<e.children.length;i++)this.searchChildInFrustum(t,e.children[i])}}class Tl{constructor(t,e,i){this.element=document.createElement("div"),this.element.classList.add(i),this.element.style.pointerEvents="none",this.renderer=e,this.startPoint=new be.Vector2,this.pointTopLeft=new be.Vector2,this.pointBottomRight=new be.Vector2,this.isDown=!1,this.onPointerDown=function(t){this.isDown=!0,this.onSelectStart(t)}.bind(this),this.onPointerMove=function(t){this.isDown&&this.onSelectMove(t)}.bind(this),this.onPointerUp=function(){this.isDown=!1,this.onSelectOver()}.bind(this),this.renderer.domElement.addEventListener("pointermove",this.onPointerMove)}dispose(){this.renderer.domElement.removeEventListener("pointerdown",this.onPointerDown),this.renderer.domElement.removeEventListener("pointermove",this.onPointerMove),this.renderer.domElement.removeEventListener("pointerup",this.onPointerUp)}onSelectStart(t){this.renderer.domElement.parentElement.appendChild(this.element);const e=z(this.renderer.domElement,t);this.element.style.left=e.offsetX+"px",this.element.style.top=e.offsetY+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=e.offsetX,this.startPoint.y=e.offsetY}onSelectMove(t){const e=z(this.renderer.domElement,t);this.pointBottomRight.x=Math.max(this.startPoint.x,e.offsetX),this.pointBottomRight.y=Math.max(this.startPoint.y,e.offsetY),this.pointTopLeft.x=Math.min(this.startPoint.x,e.offsetX),this.pointTopLeft.y=Math.min(this.startPoint.y,e.offsetY),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"}onSelectOver(){this.element.parentElement.removeChild(this.element)}}
/*!
* hotkeys-js v3.8.7
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2021 kenny wong <wowohoo@qq.com>
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
*/var El="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Pl(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent&&t.attachEvent("on".concat(e),(function(){i(window.event)}))}function Ml(t,e){for(var i=e.slice(0,e.length-1),r=0;r<i.length;r++)i[r]=t[i[r].toLowerCase()];return i}function Cl(t){"string"!=typeof t&&(t="");for(var e=(t=t.replace(/\s/g,"")).split(","),i=e.lastIndexOf("");i>=0;)e[i-1]+=",",e.splice(i,1),i=e.lastIndexOf("");return e}for(var Ll={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":El?173:189,"=":El?61:187,";":El?59:186,"'":222,"[":219,"]":221,"\\":220},Rl={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ol={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Fl={16:!1,18:!1,17:!1,91:!1},Nl={},Dl=1;Dl<20;Dl++)Ll["f".concat(Dl)]=111+Dl;var Il=[],Ul="all",Bl=[],kl=function(t){return Ll[t.toLowerCase()]||Rl[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function jl(t){Ul=t||"all"}function Vl(){return Ul||"all"}var zl=function(t){var e=t.key,i=t.scope,r=t.method,n=t.splitKey,s=void 0===n?"+":n;Cl(e).forEach((function(t){var e=t.split(s),n=e.length,o=e[n-1],a="*"===o?"*":kl(o);if(Nl[a]){i||(i=Vl());var l=n>1?Ml(Rl,e):[];Nl[a]=Nl[a].map((function(t){return(!r||t.method===r)&&t.scope===i&&function(t,e){for(var i=t.length>=e.length?t:e,r=t.length>=e.length?e:t,n=!0,s=0;s<i.length;s++)-1===r.indexOf(i[s])&&(n=!1);return n}(t.mods,l)?{}:t}))}}))};function Gl(t,e,i){var r;if(e.scope===i||"all"===e.scope){for(var n in r=e.mods.length>0,Fl)Object.prototype.hasOwnProperty.call(Fl,n)&&(!Fl[n]&&e.mods.indexOf(+n)>-1||Fl[n]&&-1===e.mods.indexOf(+n))&&(r=!1);(0!==e.mods.length||Fl[16]||Fl[18]||Fl[17]||Fl[91])&&!r&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function Hl(t){var e=Nl["*"],i=t.keyCode||t.which||t.charCode;if(Xl.filter.call(this,t)){if(93!==i&&224!==i||(i=91),-1===Il.indexOf(i)&&229!==i&&Il.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(e){var i=Ol[e];t[e]&&-1===Il.indexOf(i)?Il.push(i):!t[e]&&Il.indexOf(i)>-1?Il.splice(Il.indexOf(i),1):"metaKey"===e&&t[e]&&3===Il.length&&(t.ctrlKey||t.shiftKey||t.altKey||(Il=Il.slice(Il.indexOf(i))))})),i in Fl){for(var r in Fl[i]=!0,Rl)Rl[r]===i&&(Xl[r]=!0);if(!e)return}for(var n in Fl)Object.prototype.hasOwnProperty.call(Fl,n)&&(Fl[n]=t[Ol[n]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===Il.indexOf(17)&&Il.push(17),-1===Il.indexOf(18)&&Il.push(18),Fl[17]=!0,Fl[18]=!0);var s=Vl();if(e)for(var o=0;o<e.length;o++)e[o].scope===s&&("keydown"===t.type&&e[o].keydown||"keyup"===t.type&&e[o].keyup)&&Gl(t,e[o],s);if(i in Nl)for(var a=0;a<Nl[i].length;a++)if(("keydown"===t.type&&Nl[i][a].keydown||"keyup"===t.type&&Nl[i][a].keyup)&&Nl[i][a].key){for(var l=Nl[i][a],h=l.splitKey,c=l.key.split(h),d=[],u=0;u<c.length;u++)d.push(kl(c[u]));d.sort().join("")===Il.sort().join("")&&Gl(t,l,s)}}}function Xl(t,e,i){Il=[];var r=Cl(t),n=[],s="all",o=document,a=0,l=!1,h=!0,c="+";for(void 0===i&&"function"==typeof e&&(i=e),"[object Object]"===Object.prototype.toString.call(e)&&(e.scope&&(s=e.scope),e.element&&(o=e.element),e.keyup&&(l=e.keyup),void 0!==e.keydown&&(h=e.keydown),"string"==typeof e.splitKey&&(c=e.splitKey)),"string"==typeof e&&(s=e);a<r.length;a++)n=[],(t=r[a].split(c)).length>1&&(n=Ml(Rl,t)),(t="*"===(t=t[t.length-1])?"*":kl(t))in Nl||(Nl[t]=[]),Nl[t].push({keyup:l,keydown:h,scope:s,mods:n,shortcut:r[a],method:i,key:r[a],splitKey:c});void 0!==o&&!function(t){return Bl.indexOf(t)>-1}(o)&&window&&(Bl.push(o),Pl(o,"keydown",(function(t){Hl(t)})),Pl(window,"focus",(function(){Il=[]})),Pl(o,"keyup",(function(t){Hl(t),function(t){var e=t.keyCode||t.which||t.charCode,i=Il.indexOf(e);if(i>=0&&Il.splice(i,1),t.key&&"meta"===t.key.toLowerCase()&&Il.splice(0,Il.length),93!==e&&224!==e||(e=91),e in Fl)for(var r in Fl[e]=!1,Rl)Rl[r]===e&&(Xl[r]=!1)}(t)})))}var Wl={setScope:jl,getScope:Vl,deleteScope:function(t,e){var i,r;for(var n in t||(t=Vl()),Nl)if(Object.prototype.hasOwnProperty.call(Nl,n))for(i=Nl[n],r=0;r<i.length;)i[r].scope===t?i.splice(r,1):r++;Vl()===t&&jl(e||"all")},getPressedKeyCodes:function(){return Il.slice(0)},isPressed:function(t){return"string"==typeof t&&(t=kl(t)),-1!==Il.indexOf(t)},filter:function(t){var e=t.target||t.srcElement,i=e.tagName,r=!0;return!e.isContentEditable&&("INPUT"!==i&&"TEXTAREA"!==i&&"SELECT"!==i||e.readOnly)||(r=!1),r},unbind:function(t){if(t){if(Array.isArray(t))t.forEach((function(t){t.key&&zl(t)}));else if("object"==typeof t)t.key&&zl(t);else if("string"==typeof t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n=i[0],s=i[1];"function"==typeof n&&(s=n,n=""),zl({key:t,scope:n,method:s,splitKey:"+"})}}else Object.keys(Nl).forEach((function(t){return delete Nl[t]}))}};for(var Yl in Wl)Object.prototype.hasOwnProperty.call(Wl,Yl)&&(Xl[Yl]=Wl[Yl]);class Ql extends ui{constructor(t,e){if(super(),!t)throw new Error("Selector init error, need viewer argument");const i=pt({mode:$t.POINT,color:"#FF9999",setColor:!0},e||{});this.enabled=!1,this._viewer=t,this.mode=i.mode,this.color=i.color,this.setColor=i.setColor,this.selection=[],this.selectionBox=null,this.helper=null,this.ctrlDown=!1,ht(["_pointerdown","_pointermove","_pointerup","_updateSelectRegion","_updateStyle"],this),this.__old_selectedIds=[]}setMode(t){t&&$t[t.toUpperCase()]&&(this.deactive(),this.mode=t)}_initHelper(){if(!this.camera||!this.scene)return;const t=this._viewer,e=this.selectionBox=new Sl(this.camera,this.scene);this.helper=new Tl(e,t.rendererManager.renderer,"THING-selectbox")}active(t){if(this.enabled&&this.mode==t)return;this.deactive(),this.enabled=!0,this.mode=t||$t.POINT;const{_viewer:e}=this,{camera:i,cameraControl:r}=e,n=e.scene;this.camera=i,this.scene=n,this.cameraControl=r,this.ctrlDown=!1,t===$t.RECTANGLE&&this._initHelper(),this._initEvent()}deactive(){this.clear(),this.__old_selectedIds=[],this.enabled=!1,this._removeEvent();const{_viewer:t,mode:e,selectionBox:i,helper:r,cameraControl:n}=this;e===$t.RECTANGLE&&i&&(n.setEnabled(!0),r.dispose(),this.helper=null,this.selectionBox=null,this.cameraControl=null,this.camera=null,this.scene=null)}update(){this.enabled&&(this.deactive(),this.active())}_initEvent(){if(!this._viewer)return;const t=this._viewer.container;this.pointerdown=ut(this._pointerdown,200,this),t.addEventListener("pointerdown",this._pointerdown),t.addEventListener("pointermove",this._pointermove),t.addEventListener("pointerup",this._pointerup),Xl("*",{keyup:!0},((t,e)=>{this.ctrlDown=!(this.mode!==$t.POINT||"keyup"===t.type||!Xl.ctrl)}))}_removeEvent(){if(!this._viewer)return;const t=this._viewer.container;this.pointerdown&&t.removeEventListener("pointerdown",this.pointerdown),t.removeEventListener("pointermove",this._pointermove),t.removeEventListener("pointerup",this._pointerup),Xl.unbind("*")}_unique(){this.selection=ot(this.selection,((t,e)=>t.uuid===e.uuid)).filter((t=>t&&0!=t.visible))}_fireSelectChange(){this._unique(),this._updateStyle()}_pointerdown(t){if(this.enabled&&V(t)){if(this._removeStyle(),this.__old_selectedIds=this.selection.map((t=>t.id)),this.mode===$t.RECTANGLE&&this.selectionBox)return this._viewer.cameraControl.enabled=!1,this._updateSelectRegion(t,"startPoint"),void this.helper.onPointerDown(t);if(this.mode===$t.POINT){let e=this._viewer.picker.pick(t).picked||[];if(this.ctrlDown){const t=[];for(let i=0;i<e.length;i++)this.selection.includes(e[i])&&(t.push(e[i].id),e[i]=null);e=e.filter((t=>t||this.selection.includes(t))),this.selection=this.selection.concat(e).filter((e=>!t.includes(e.id)))}else this.selection=e;const i=this.selection.map((t=>t.id));Et(this.__old_selectedIds,i)||this._fireSelectChange()}}}_pointermove(t){this.enabled&&this.helper&&this.helper.isDown&&this.mode===$t.RECTANGLE&&(this._updateSelectRegion(t,"endPoint"),this.helper.onPointerMove(t),this.selection=this.selectionBox.select(),this._fireSelectChange())}_pointerup(t){if(this._viewer.cameraControl.enabled=!0,this.enabled&&V(t)&&this.mode===$t.RECTANGLE&&this.selectionBox){this._updateSelectRegion(t,"endPoint"),this.helper.onPointerUp(t),this.selection=this.selectionBox.select(),this._fireSelectChange();const e=this.selection.map((t=>t.id));Et(this.__old_selectedIds,e)}}_updateSelectRegion(t,e){if(!t)return;const{selectionBox:i}=this;if(i&&i[e]){const{x:r,y:n}=z(this._viewer.container,t);i[e].set(r,n,.5)}}_updateStyle(){const{sceneHelpers:t,rendererManager:e}=this._viewer;this.selection.forEach((i=>{if(!i.isLight)if(e.outline)e.addOutlineObject(i);else{const e=new be.BoxHelper(i,16776960);e.name="SelectBox",e.uuid=i.uuid,t.getObjectByProperty("uuid",i.uuid)||t.add(e)}}))}_removeStyle(){this._viewer.rendererManager;const{rendererManager:t,sceneHelpers:e}=this._viewer;this.selection.forEach((i=>{t.removeOutlineObject(i);const r=e.getObjectByProperty("uuid",i.uuid);r&&r.removeFromParent()}))}setSelection(t){if(!W(t))return;this.clear();const{mode:e}=this;e===$t.RECTANGLE&&this.selectionBox&&(this.selectionBox.collection=t.filter((t=>t)),this.selectionBox.filterCollection()),e===$t.POINT&&(this.selection=t.filter((t=>t))),this._unique(),this._updateStyle()}getSelection(){return this.selection}clear(){this._removeStyle();const{selectionBox:t}=this;t&&(t.endPoint.set(0,0,.5),t.startPoint.set(0,0,.5),t.select()),this.selection=[]}selectByScreenCoordinates(t,e){return this._viewer.getIntersects({clientX:t,clientY:e})}}function Jl(t){var e=document.createElement("div");function i(t){return e.appendChild(t.dom),t}function r(t){for(var i=0;i<e.children.length;i++)e.children[i].style.display=i===t?"block":"none"}e.style.cssText="position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:99";var n=(performance||Date).now(),s=n,o=0,a=i(new Jl.Panel("FPS","#0ff","#002")),l=i(new Jl.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=i(new Jl.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:e,addPanel:i,showPanel:r,begin:function(){n=(performance||Date).now()},end:function(){o++;var t=(performance||Date).now();if(l.update(t-n,200),t>=s+1e3&&(a.update(1e3*o/(t-s),100),s=t,o=0,h)){var e=performance.memory;h.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){n=this.end()},domElement:e,setMode:r}}Jl.Panel=function(t,e,i){var r=1/0,n=0,s=Math.round,o=s(window.devicePixelRatio||1),a=120*o,l=48*o,h=3*o,c=2*o,d=3*o,u=15*o,p=114*o,m=30*o,f=document.createElement("canvas");f.width=a,f.height=l,f.style.cssText="width:120px;height:48px";var g=f.getContext("2d");return g.font="bold "+9*o+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,a,l),g.fillStyle=e,g.fillText(t,h,c),g.fillRect(d,u,p,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(d,u,p,m),{dom:f,update:function(l,v){r=Math.min(r,l),n=Math.max(n,l),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,a,u),g.fillStyle=e,g.fillText(s(l)+" "+t+" ("+s(r)+"-"+s(n)+")",h,c),g.drawImage(f,d+o,u,p-o,m,d,u,p-o,m),g.fillRect(d+p-o,u,o,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(d+p-o,u,o,s((1-l/v)*m))}}};class Zl extends be.EventDispatcher{constructor(t){super(),this.viewer=t,this.stats=new Jl;const e=this.stats.dom.children;D(this.stats.dom,"debugger-render-stats");for(let t=0;t<e.length;t++)e[t].style.display="none";t.container.appendChild(this.stats.dom),this.renderStates=this.viewer.renderStates,this.enable=!1}show({showFPS:t,showMilliseconds:e,showMemory:i,showRenderInfo:r,enable:n}={}){const s=this.stats.dom.children;s&&(s[0]&&(s[0].style.display=t?"block":"none",D(s[0],"stats-fps")),s[1]&&(s[1].style.display=e?"block":"none",D(s[1],"stats-milliseconds")),s[2]&&(s[2].style.display=i?"block":"none",D(s[2],"stats-memory")),void 0!==n&&(this.enable=n))}hide(){this.show(!1,!1,!1),this.enable=!1}begin(){this.enable&&this.stats.begin()}end(){this.enable&&this.stats.end()}update(){this.enable&&this.stats.update()}remove(){this.hide(),this.viewer.container.removeChild(this.stats.dom)}}const ql={uniforms:{tDiffuse:{value:null},resolution:{value:new be.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File:\t\t\t\tes3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email:\t\t\t gameworks@nvidia.com","// Site:\t\t\t\thttp://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","//\t* Redistributions of source code must retain the above copyright","//\t\tnotice, this list of conditions and the following disclaimer.","//\t* Redistributions in binary form must reproduce the above copyright","//\t\tnotice, this list of conditions and the following disclaimer in the","//\t\tdocumentation and/or other materials provided with the distribution.","//\t* Neither the name of NVIDIA CORPORATION nor the names of its","//\t\tcontributors may be used to endorse or promote products derived","//\t\tfrom this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED.\tIN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE","\t\t//","\t\t// The console algorithm for PC is included","\t\t// for developers targeting really low spec machines.","\t\t// Likely better to just run FXAA_PC, and use a really low preset.","\t\t//","\t\t#define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120","\t\t#define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130","\t\t#define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3","\t\t#define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4","\t\t#define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5","\t\t#define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA","\t\t//","\t\t// For those using non-linear color,","\t\t// and either not able to get luma in alpha, or not wanting to,","\t\t// this enables FXAA to run using green as a proxy for luma.","\t\t// So with this enabled, no need to pack luma in alpha.","\t\t//","\t\t// This will turn off AA on anything which lacks some amount of green.","\t\t// Pure red and blue or combination of only R and B, will get no AA.","\t\t//","\t\t// Might want to lower the settings for both,","\t\t//\t\tfxaaConsoleEdgeThresholdMin","\t\t//\t\tfxaaQualityEdgeThresholdMin","\t\t// In order to insure AA does not get turned off on colors","\t\t// which contain a minor amount of green.","\t\t//","\t\t// 1 = On.","\t\t// 0 = Off.","\t\t//","\t\t#define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT","\t\t//","\t\t// Controls algorithm's early exit path.","\t\t// On PS3 turning this ON adds 2 cycles to the shader.","\t\t// On 360 turning this OFF adds 10ths of a millisecond to the shader.","\t\t// Turning this off on console will result in a more blurry image.","\t\t// So this defaults to on.","\t\t//","\t\t// 1 = On.","\t\t// 0 = Off.","\t\t//","\t\t#define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD","\t\t//","\t\t// Only valid for PC OpenGL currently.","\t\t// Probably will not work when FXAA_GREEN_AS_LUMA = 1.","\t\t//","\t\t// 1 = Use discard on pixels which don't need AA.","\t\t//\t\t For APIs which enable concurrent TEX+ROP from same surface.","\t\t// 0 = Return unchanged color on pixels which don't need AA.","\t\t//","\t\t#define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET","\t\t//","\t\t// Used for GLSL 120 only.","\t\t//","\t\t// 1 = GL API supports fast pixel offsets","\t\t// 0 = do not use fast pixel offsets","\t\t//","\t\t#ifdef GL_EXT_gpu_shader4","\t\t\t\t#define FXAA_FAST_PIXEL_OFFSET 1","\t\t#endif","\t\t#ifdef GL_NV_gpu_shader5","\t\t\t\t#define FXAA_FAST_PIXEL_OFFSET 1","\t\t#endif","\t\t#ifdef GL_ARB_gpu_shader5","\t\t\t\t#define FXAA_FAST_PIXEL_OFFSET 1","\t\t#endif","\t\t#ifndef FXAA_FAST_PIXEL_OFFSET","\t\t\t\t#define FXAA_FAST_PIXEL_OFFSET 0","\t\t#endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA","\t\t//","\t\t// 1 = API supports gather4 on alpha channel.","\t\t// 0 = API does not support gather4 on alpha channel.","\t\t//","\t\t#if (FXAA_HLSL_5 == 1)","\t\t\t\t#define FXAA_GATHER4_ALPHA 1","\t\t#endif","\t\t#ifdef GL_ARB_gpu_shader5","\t\t\t\t#define FXAA_GATHER4_ALPHA 1","\t\t#endif","\t\t#ifdef GL_NV_gpu_shader5","\t\t\t\t#define FXAA_GATHER4_ALPHA 1","\t\t#endif","\t\t#ifndef FXAA_GATHER4_ALPHA","\t\t\t\t#define FXAA_GATHER4_ALPHA 0","\t\t#endif","#endif","","","/*============================================================================","\t\t\t\t\t\t\t\t\t\t\t\tFXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET","\t\t//","\t\t// Choose the quality preset.","\t\t// This needs to be compiled into the shader as it effects code.","\t\t// Best option to include multiple presets is to","\t\t// in each shader define the preset, then include this file.","\t\t//","\t\t// OPTIONS","\t\t// -----------------------------------------------------------------------","\t\t// 10 to 15 - default medium dither (10=fastest, 15=highest quality)","\t\t// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)","\t\t// 39\t\t\t - no dither, very expensive","\t\t//","\t\t// NOTES","\t\t// -----------------------------------------------------------------------","\t\t// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)","\t\t// 13 = about same speed as FXAA 3.9 and better than 12","\t\t// 23 = closest to FXAA 3.9 visually and performance wise","\t\t//\t_ = the lowest digit is directly related to performance","\t\t// _\t= the highest digit is directly related to style","\t\t//","\t\t#define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================","","\t\t\t\t\t\t\t\t\t\t\t\t\t FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================","\t\t\t\t\t\t\t\t\t\t FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)","\t\t#define FXAA_QUALITY_PS 3","\t\t#define FXAA_QUALITY_P0 1.5","\t\t#define FXAA_QUALITY_P1 3.0","\t\t#define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)","\t\t#define FXAA_QUALITY_PS 4","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 3.0","\t\t#define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)","\t\t#define FXAA_QUALITY_PS 5","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 4.0","\t\t#define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)","\t\t#define FXAA_QUALITY_PS 6","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 4.0","\t\t#define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)","\t\t#define FXAA_QUALITY_PS 7","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 4.0","\t\t#define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)","\t\t#define FXAA_QUALITY_PS 8","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 2.0","\t\t#define FXAA_QUALITY_P6 4.0","\t\t#define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================","\t\t\t\t\t\t\t\t\t\t FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)","\t\t#define FXAA_QUALITY_PS 3","\t\t#define FXAA_QUALITY_P0 1.5","\t\t#define FXAA_QUALITY_P1 2.0","\t\t#define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)","\t\t#define FXAA_QUALITY_PS 4","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)","\t\t#define FXAA_QUALITY_PS 5","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)","\t\t#define FXAA_QUALITY_PS 6","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)","\t\t#define FXAA_QUALITY_PS 7","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 3.0","\t\t#define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)","\t\t#define FXAA_QUALITY_PS 8","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 2.0","\t\t#define FXAA_QUALITY_P6 4.0","\t\t#define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)","\t\t#define FXAA_QUALITY_PS 9","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 2.0","\t\t#define FXAA_QUALITY_P6 2.0","\t\t#define FXAA_QUALITY_P7 4.0","\t\t#define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)","\t\t#define FXAA_QUALITY_PS 10","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 2.0","\t\t#define FXAA_QUALITY_P6 2.0","\t\t#define FXAA_QUALITY_P7 2.0","\t\t#define FXAA_QUALITY_P8 4.0","\t\t#define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)","\t\t#define FXAA_QUALITY_PS 11","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 2.0","\t\t#define FXAA_QUALITY_P6 2.0","\t\t#define FXAA_QUALITY_P7 2.0","\t\t#define FXAA_QUALITY_P8 2.0","\t\t#define FXAA_QUALITY_P9 4.0","\t\t#define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)","\t\t#define FXAA_QUALITY_PS 12","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.5","\t\t#define FXAA_QUALITY_P2 2.0","\t\t#define FXAA_QUALITY_P3 2.0","\t\t#define FXAA_QUALITY_P4 2.0","\t\t#define FXAA_QUALITY_P5 2.0","\t\t#define FXAA_QUALITY_P6 2.0","\t\t#define FXAA_QUALITY_P7 2.0","\t\t#define FXAA_QUALITY_P8 2.0","\t\t#define FXAA_QUALITY_P9 2.0","\t\t#define FXAA_QUALITY_P10 4.0","\t\t#define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================","\t\t\t\t\t\t\t\t\t\t FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)","\t\t#define FXAA_QUALITY_PS 12","\t\t#define FXAA_QUALITY_P0 1.0","\t\t#define FXAA_QUALITY_P1 1.0","\t\t#define FXAA_QUALITY_P2 1.0","\t\t#define FXAA_QUALITY_P3 1.0","\t\t#define FXAA_QUALITY_P4 1.0","\t\t#define FXAA_QUALITY_P5 1.5","\t\t#define FXAA_QUALITY_P6 2.0","\t\t#define FXAA_QUALITY_P7 2.0","\t\t#define FXAA_QUALITY_P8 2.0","\t\t#define FXAA_QUALITY_P9 2.0","\t\t#define FXAA_QUALITY_P10 4.0","\t\t#define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================","","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)","\t\t#define FxaaBool bool","\t\t#define FxaaDiscard discard","\t\t#define FxaaFloat float","\t\t#define FxaaFloat2 vec2","\t\t#define FxaaFloat3 vec3","\t\t#define FxaaFloat4 vec4","\t\t#define FxaaHalf float","\t\t#define FxaaHalf2 vec2","\t\t#define FxaaHalf3 vec3","\t\t#define FxaaHalf4 vec4","\t\t#define FxaaInt2 ivec2","\t\t#define FxaaSat(x) clamp(x, 0.0, 1.0)","\t\t#define FxaaTex sampler2D","#else","\t\t#define FxaaBool bool","\t\t#define FxaaDiscard clip(-1)","\t\t#define FxaaFloat float","\t\t#define FxaaFloat2 float2","\t\t#define FxaaFloat3 float3","\t\t#define FxaaFloat4 float4","\t\t#define FxaaHalf half","\t\t#define FxaaHalf2 half2","\t\t#define FxaaHalf3 half3","\t\t#define FxaaHalf4 half4","\t\t#define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)","\t#define FxaaTexTop(t, p) texture2D(t, p, 0.0)","\t#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)","\t\t// Requires,","\t\t//\t#version 120","\t\t// And at least,","\t\t//\t#extension GL_EXT_gpu_shader4 : enable","\t\t//\t(or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)","\t\t#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)","\t\t#if (FXAA_FAST_PIXEL_OFFSET == 1)","\t\t\t\t#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)","\t\t#else","\t\t\t\t#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)","\t\t#endif","\t\t#if (FXAA_GATHER4_ALPHA == 1)","\t\t\t\t// use #extension GL_ARB_gpu_shader5 : enable","\t\t\t\t#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)","\t\t\t\t#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)","\t\t\t\t#define FxaaTexGreen4(t, p) textureGather(t, p, 1)","\t\t\t\t#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)","\t\t#endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",'\t\t// Requires "#version 130" or better',"\t\t#define FxaaTexTop(t, p) textureLod(t, p, 0.0)","\t\t#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)","\t\t#if (FXAA_GATHER4_ALPHA == 1)","\t\t\t\t// use #extension GL_ARB_gpu_shader5 : enable","\t\t\t\t#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)","\t\t\t\t#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)","\t\t\t\t#define FxaaTexGreen4(t, p) textureGather(t, p, 1)","\t\t\t\t#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)","\t\t#endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)","\t\t#define FxaaInt2 float2","\t\t#define FxaaTex sampler2D","\t\t#define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))","\t\t#define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)","\t\t#define FxaaInt2 int2","\t\tstruct FxaaTex { SamplerState smpl; Texture2D tex; };","\t\t#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)","\t\t#define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)","\t\t#define FxaaInt2 int2","\t\tstruct FxaaTex { SamplerState smpl; Texture2D tex; };","\t\t#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)","\t\t#define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","\t\t#define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)","\t\t#define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)","\t\t#define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)","\t\t#define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================","\t\t\t\t\t\t\t\t\t GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)","\t\tFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else","\t\tFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================","","\t\t\t\t\t\t\t\t\t\t\t\t\t\t FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader(","\t\t//","\t\t// Use noperspective interpolation here (turn off perspective interpolation).","\t\t// {xy} = center of pixel","\t\tFxaaFloat2 pos,","\t\t//","\t\t// Used only for FXAA Console, and not used on the 360 version.","\t\t// Use noperspective interpolation here (turn off perspective interpolation).","\t\t// {xy_} = upper left of pixel","\t\t// {_zw} = lower right of pixel","\t\tFxaaFloat4 fxaaConsolePosPos,","\t\t//","\t\t// Input color texture.","\t\t// {rgb_} = color in linear or perceptual color space","\t\t// if (FXAA_GREEN_AS_LUMA == 0)","\t\t//\t\t {__a} = luma in perceptual color space (not linear)","\t\tFxaaTex tex,","\t\t//","\t\t// Only used on the optimized 360 version of FXAA Console.",'\t\t// For everything but 360, just use the same input here as for "tex".',"\t\t// For 360, same texture, just alias with a 2nd sampler.","\t\t// This sampler needs to have an exponent bias of -1.","\t\tFxaaTex fxaaConsole360TexExpBiasNegOne,","\t\t//","\t\t// Only used on the optimized 360 version of FXAA Console.",'\t\t// For everything but 360, just use the same input here as for "tex".',"\t\t// For 360, same texture, just alias with a 3nd sampler.","\t\t// This sampler needs to have an exponent bias of -2.","\t\tFxaaTex fxaaConsole360TexExpBiasNegTwo,","\t\t//","\t\t// Only used on FXAA Quality.","\t\t// This must be from a constant/uniform.","\t\t// {x_} = 1.0/screenWidthInPixels","\t\t// {_y} = 1.0/screenHeightInPixels","\t\tFxaaFloat2 fxaaQualityRcpFrame,","\t\t//","\t\t// Only used on FXAA Console.","\t\t// This must be from a constant/uniform.","\t\t// This effects sub-pixel AA quality and inversely sharpness.","\t\t//\t Where N ranges between,","\t\t//\t\t N = 0.50 (default)","\t\t//\t\t N = 0.33 (sharper)","\t\t// {x__} = -N/screenWidthInPixels","\t\t// {_y_} = -N/screenHeightInPixels","\t\t// {_z_} =\tN/screenWidthInPixels","\t\t// {__w} =\tN/screenHeightInPixels","\t\tFxaaFloat4 fxaaConsoleRcpFrameOpt,","\t\t//","\t\t// Only used on FXAA Console.","\t\t// Not used on 360, but used on PS3 and PC.","\t\t// This must be from a constant/uniform.","\t\t// {x__} = -2.0/screenWidthInPixels","\t\t// {_y_} = -2.0/screenHeightInPixels","\t\t// {_z_} =\t2.0/screenWidthInPixels","\t\t// {__w} =\t2.0/screenHeightInPixels","\t\tFxaaFloat4 fxaaConsoleRcpFrameOpt2,","\t\t//","\t\t// Only used on FXAA Console.","\t\t// Only used on 360 in place of fxaaConsoleRcpFrameOpt2.","\t\t// This must be from a constant/uniform.","\t\t// {x__} =\t8.0/screenWidthInPixels","\t\t// {_y_} =\t8.0/screenHeightInPixels","\t\t// {_z_} = -4.0/screenWidthInPixels","\t\t// {__w} = -4.0/screenHeightInPixels","\t\tFxaaFloat4 fxaaConsole360RcpFrameOpt2,","\t\t//","\t\t// Only used on FXAA Quality.","\t\t// This used to be the FXAA_QUALITY_SUBPIX define.","\t\t// It is here now to allow easier tuning.","\t\t// Choose the amount of sub-pixel aliasing removal.","\t\t// This can effect sharpness.","\t\t//\t 1.00 - upper limit (softer)","\t\t//\t 0.75 - default amount of filtering","\t\t//\t 0.50 - lower limit (sharper, less sub-pixel aliasing removal)","\t\t//\t 0.25 - almost off","\t\t//\t 0.00 - completely off","\t\tFxaaFloat fxaaQualitySubpix,","\t\t//","\t\t// Only used on FXAA Quality.","\t\t// This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.","\t\t// It is here now to allow easier tuning.","\t\t// The minimum amount of local contrast required to apply algorithm.","\t\t//\t 0.333 - too little (faster)","\t\t//\t 0.250 - low quality","\t\t//\t 0.166 - default","\t\t//\t 0.125 - high quality","\t\t//\t 0.063 - overkill (slower)","\t\tFxaaFloat fxaaQualityEdgeThreshold,","\t\t//","\t\t// Only used on FXAA Quality.","\t\t// This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.","\t\t// It is here now to allow easier tuning.","\t\t// Trims the algorithm from processing darks.","\t\t//\t 0.0833 - upper limit (default, the start of visible unfiltered edges)","\t\t//\t 0.0625 - high quality (faster)","\t\t//\t 0.0312 - visible limit (slower)","\t\t// Special notes when using FXAA_GREEN_AS_LUMA,","\t\t//\t Likely want to set this to zero.","\t\t//\t As colors that are mostly not-green","\t\t//\t will appear very dark in the green channel!","\t\t//\t Tune by looking at mostly non-green content,","\t\t//\t then start at zero and increase until aliasing is a problem.","\t\tFxaaFloat fxaaQualityEdgeThresholdMin,","\t\t//","\t\t// Only used on FXAA Console.","\t\t// This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.","\t\t// It is here now to allow easier tuning.","\t\t// This does not effect PS3, as this needs to be compiled in.","\t\t//\t Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.","\t\t//\t Due to the PS3 being ALU bound,","\t\t//\t there are only three safe values here: 2 and 4 and 8.","\t\t//\t These options use the shaders ability to a free *|/ by 2|4|8.","\t\t// For all other platforms can be a non-power of two.","\t\t//\t 8.0 is sharper (default!!!)","\t\t//\t 4.0 is softer","\t\t//\t 2.0 is really soft (good only for vector graphics inputs)","\t\tFxaaFloat fxaaConsoleEdgeSharpness,","\t\t//","\t\t// Only used on FXAA Console.","\t\t// This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.","\t\t// It is here now to allow easier tuning.","\t\t// This does not effect PS3, as this needs to be compiled in.","\t\t//\t Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.","\t\t//\t Due to the PS3 being ALU bound,","\t\t//\t there are only two safe values here: 1/4 and 1/8.","\t\t//\t These options use the shaders ability to a free *|/ by 2|4|8.","\t\t// The console setting has a different mapping than the quality setting.","\t\t// Other platforms can use other values.","\t\t//\t 0.125 leaves less aliasing, but is softer (default!!!)","\t\t//\t 0.25 leaves more aliasing, and is sharper","\t\tFxaaFloat fxaaConsoleEdgeThreshold,","\t\t//","\t\t// Only used on FXAA Console.","\t\t// This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.","\t\t// It is here now to allow easier tuning.","\t\t// Trims the algorithm from processing darks.","\t\t// The console setting has a different mapping than the quality setting.","\t\t// This only applies when FXAA_EARLY_EXIT is 1.","\t\t// This does not apply to PS3,","\t\t// PS3 was simplified to avoid more shader instructions.","\t\t//\t 0.06 - faster but more aliasing in darks","\t\t//\t 0.05 - default","\t\t//\t 0.04 - slower and less aliasing in darks","\t\t// Special notes when using FXAA_GREEN_AS_LUMA,","\t\t//\t Likely want to set this to zero.","\t\t//\t As colors that are mostly not-green","\t\t//\t will appear very dark in the green channel!","\t\t//\t Tune by looking at mostly non-green content,","\t\t//\t then start at zero and increase until aliasing is a problem.","\t\tFxaaFloat fxaaConsoleEdgeThresholdMin,","\t\t//","\t\t// Extra constants for 360 FXAA Console only.","\t\t// Use zeros or anything else for other platforms.","\t\t// These must be in physical constant registers and NOT immediates.","\t\t// Immediates will result in compiler un-optimizing.","\t\t// {xyzw} = float4(1.0, -1.0, 0.25, -0.25)","\t\tFxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat2 posM;","\t\tposM.x = pos.x;","\t\tposM.y = pos.y;","\t\t#if (FXAA_GATHER4_ALPHA == 1)","\t\t\t\t#if (FXAA_DISCARD == 0)","\t\t\t\t\t\tFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);","\t\t\t\t\t\t#if (FXAA_GREEN_AS_LUMA == 0)","\t\t\t\t\t\t\t\t#define lumaM rgbyM.w","\t\t\t\t\t\t#else","\t\t\t\t\t\t\t\t#define lumaM rgbyM.y","\t\t\t\t\t\t#endif","\t\t\t\t#endif","\t\t\t\t#if (FXAA_GREEN_AS_LUMA == 0)","\t\t\t\t\t\tFxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);","\t\t\t\t\t\tFxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));","\t\t\t\t#else","\t\t\t\t\t\tFxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);","\t\t\t\t\t\tFxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));","\t\t\t\t#endif","\t\t\t\t#if (FXAA_DISCARD == 1)","\t\t\t\t\t\t#define lumaM luma4A.w","\t\t\t\t#endif","\t\t\t\t#define lumaE luma4A.z","\t\t\t\t#define lumaS luma4A.x","\t\t\t\t#define lumaSE luma4A.y","\t\t\t\t#define lumaNW luma4B.w","\t\t\t\t#define lumaN luma4B.z","\t\t\t\t#define lumaW luma4B.x","\t\t#else","\t\t\t\tFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);","\t\t\t\t#if (FXAA_GREEN_AS_LUMA == 0)","\t\t\t\t\t\t#define lumaM rgbyM.w","\t\t\t\t#else","\t\t\t\t\t\t#define lumaM rgbyM.y","\t\t\t\t#endif","\t\t\t\t#if (FXAA_GLSL_100 == 1)","\t\t\t\t\tFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));","\t\t\t\t#else","\t\t\t\t\tFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));","\t\t\t\t#endif","\t\t#endif","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat maxSM = max(lumaS, lumaM);","\t\tFxaaFloat minSM = min(lumaS, lumaM);","\t\tFxaaFloat maxESM = max(lumaE, maxSM);","\t\tFxaaFloat minESM = min(lumaE, minSM);","\t\tFxaaFloat maxWN = max(lumaN, lumaW);","\t\tFxaaFloat minWN = min(lumaN, lumaW);","\t\tFxaaFloat rangeMax = max(maxWN, maxESM);","\t\tFxaaFloat rangeMin = min(minWN, minESM);","\t\tFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;","\t\tFxaaFloat range = rangeMax - rangeMin;","\t\tFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);","\t\tFxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/","\t\tif(earlyExit)","\t\t\t\t#if (FXAA_DISCARD == 1)","\t\t\t\t\t\tFxaaDiscard;","\t\t\t\t#else","\t\t\t\t\t\treturn rgbyM;","\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t#if (FXAA_GATHER4_ALPHA == 0)","\t\t\t\t#if (FXAA_GLSL_100 == 1)","\t\t\t\t\tFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));","\t\t\t\t#else","\t\t\t\t\tFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));","\t\t\t\t\tFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));","\t\t\t\t#endif","\t\t#else","\t\t\t\tFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));","\t\t\t\tFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));","\t\t#endif","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat lumaNS = lumaN + lumaS;","\t\tFxaaFloat lumaWE = lumaW + lumaE;","\t\tFxaaFloat subpixRcpRange = 1.0/range;","\t\tFxaaFloat subpixNSWE = lumaNS + lumaWE;","\t\tFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;","\t\tFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat lumaNESE = lumaNE + lumaSE;","\t\tFxaaFloat lumaNWNE = lumaNW + lumaNE;","\t\tFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;","\t\tFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat lumaNWSW = lumaNW + lumaSW;","\t\tFxaaFloat lumaSWSE = lumaSW + lumaSE;","\t\tFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);","\t\tFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);","\t\tFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;","\t\tFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;","\t\tFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;","\t\tFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;","\t\tFxaaFloat lengthSign = fxaaQualityRcpFrame.x;","\t\tFxaaBool horzSpan = edgeHorz >= edgeVert;","\t\tFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/","\t\tif(!horzSpan) lumaN = lumaW;","\t\tif(!horzSpan) lumaS = lumaE;","\t\tif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;","\t\tFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat gradientN = lumaN - lumaM;","\t\tFxaaFloat gradientS = lumaS - lumaM;","\t\tFxaaFloat lumaNN = lumaN + lumaM;","\t\tFxaaFloat lumaSS = lumaS + lumaM;","\t\tFxaaBool pairN = abs(gradientN) >= abs(gradientS);","\t\tFxaaFloat gradient = max(abs(gradientN), abs(gradientS));","\t\tif(pairN) lengthSign = -lengthSign;","\t\tFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat2 posB;","\t\tposB.x = posM.x;","\t\tposB.y = posM.y;","\t\tFxaaFloat2 offNP;","\t\toffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;","\t\toffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;","\t\tif(!horzSpan) posB.x += lengthSign * 0.5;","\t\tif( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat2 posN;","\t\tposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;","\t\tposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;","\t\tFxaaFloat2 posP;","\t\tposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;","\t\tposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;","\t\tFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;","\t\tFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));","\t\tFxaaFloat subpixE = subpixC * subpixC;","\t\tFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/","\t\tif(!pairN) lumaNN = lumaSS;","\t\tFxaaFloat gradientScaled = gradient * 1.0/4.0;","\t\tFxaaFloat lumaMM = lumaM - lumaNN * 0.5;","\t\tFxaaFloat subpixF = subpixD * subpixE;","\t\tFxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/","\t\tlumaEndN -= lumaNN * 0.5;","\t\tlumaEndP -= lumaNN * 0.5;","\t\tFxaaBool doneN = abs(lumaEndN) >= gradientScaled;","\t\tFxaaBool doneP = abs(lumaEndP) >= gradientScaled;","\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;","\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;","\t\tFxaaBool doneNP = (!doneN) || (!doneP);","\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;","\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/","\t\tif(doneNP) {","\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;","\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;","\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;","\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/","\t\t\t\t#if (FXAA_QUALITY_PS > 3)","\t\t\t\tif(doneNP) {","\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;","\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;","\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;","\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 4)","\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;","\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;","\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;","\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 5)","\t\t\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;","\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;","\t\t\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;","\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 6)","\t\t\t\t\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;","\t\t\t\t\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 7)","\t\t\t\t\t\t\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;","\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/","\t\t#if (FXAA_QUALITY_PS > 8)","\t\tif(doneNP) {","\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;","\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;","\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;","\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/","\t\t\t\t#if (FXAA_QUALITY_PS > 9)","\t\t\t\tif(doneNP) {","\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;","\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;","\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;","\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 10)","\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;","\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;","\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;","\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 11)","\t\t\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;","\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;","\t\t\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;","\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t\t\t#if (FXAA_QUALITY_PS > 12)","\t\t\t\t\t\t\t\t\t\tif(doneNP) {","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;","\t\t\t\t\t\t\t\t\t\t\t\tdoneN = abs(lumaEndN) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\t\t\tdoneP = abs(lumaEndP) >= gradientScaled;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;","\t\t\t\t\t\t\t\t\t\t\t\tdoneNP = (!doneN) || (!doneP);","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;","\t\t\t\t\t\t\t\t\t\t\t\tif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t}","\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t}","\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t}","\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t\t\t}","\t\t\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t\t\t}","\t\t\t\t#endif","/*--------------------------------------------------------------------------*/","\t\t}","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat dstN = posM.x - posN.x;","\t\tFxaaFloat dstP = posP.x - posM.x;","\t\tif(!horzSpan) dstN = posM.y - posN.y;","\t\tif(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/","\t\tFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;","\t\tFxaaFloat spanLength = (dstP + dstN);","\t\tFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;","\t\tFxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/","\t\tFxaaBool directionN = dstN < dstP;","\t\tFxaaFloat dst = min(dstN, dstP);","\t\tFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;","\t\tFxaaFloat subpixG = subpixF * subpixF;","\t\tFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;","\t\tFxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/","\t\tFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;","\t\tFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);","\t\tif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;","\t\tif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;","\t\t#if (FXAA_DISCARD == 1)","\t\t\t\treturn FxaaTexTop(tex, posM);","\t\t#else","\t\t\t\treturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);","\t\t#endif","}","/*==========================================================================*/","#endif","","void main() {","\tgl_FragColor = FxaaPixelShader(","\t\tvUv,","\t\tvec4(0.0),","\t\ttDiffuse,","\t\ttDiffuse,","\t\ttDiffuse,","\t\tresolution,","\t\tvec4(0.0),","\t\tvec4(0.0),","\t\tvec4(0.0),","\t\t0.75,","\t\t0.166,","\t\t0.0833,","\t\t0.0,","\t\t0.0,","\t\t0.0,","\t\tvec4(0.0)","\t);","","\t// TODO avoid querying texture twice for same texel","\tgl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};var Kl={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\t\n\t\t\tvarying vec2 vUv;\n\t\n\t\t\tvoid main() {\n\t\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\n\t\t\t}",fragmentShader:"\n\t\n\t\t\tuniform float opacity;\n\t\n\t\t\tuniform sampler2D tDiffuse;\n\t\n\t\t\tvarying vec2 vUv;\n\t\n\t\t\tvoid main() {\n\t\n\t\t\t\tgl_FragColor = texture2D( tDiffuse, vUv );\n\t\t\t\tgl_FragColor.a *= opacity;\n\t\n\t\n\t\t\t}"};class $l{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}const th=new be.OrthographicCamera(-1,1,1,-1,0,1),eh=new be.BufferGeometry;eh.setAttribute("position",new be.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),eh.setAttribute("uv",new be.Float32BufferAttribute([0,2,0,0,2,0],2));class ih{constructor(t){this._mesh=new be.Mesh(eh,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,th)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class rh extends $l{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof be.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=be.UniformsUtils.clone(t.uniforms),this.material=new be.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new ih(this.material)}render(t,e,i){this.enabled&&(this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t)))}}class nh extends $l{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,i){const r=t.getContext(),n=t.state;let s,o;n.buffers.color.setMask(!1),n.buffers.depth.setMask(!1),n.buffers.color.setLocked(!0),n.buffers.depth.setLocked(!0),this.inverse?(s=0,o=1):(s=1,o=0),n.buffers.stencil.setTest(!0),n.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),n.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),n.buffers.stencil.setClear(o),n.buffers.stencil.setLocked(!0),t.setRenderTarget(i),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),n.buffers.color.setLocked(!1),n.buffers.depth.setLocked(!1),n.buffers.stencil.setLocked(!1),n.buffers.stencil.setFunc(r.EQUAL,1,4294967295),n.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),n.buffers.stencil.setLocked(!0)}}class sh extends $l{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class oh{constructor(t,e){this.renderer=t,this._pixelRatio=this.renderer.getPixelRatio();const i=t.getSize(new be.Vector2);void 0===e?(this._width=i.width,this._height=i.height,(e=new be.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,{minFilter:be.LinearFilter,magFilter:be.LinearFilter,format:be.RGBAFormat,type:be.FloatType,stencilBuffer:!1,encoding:be.sRGBEncoding})).texture.name="EffectComposer.rt1"):(this._width=e.width,this._height=e.height,e.texture.name="EffectComposer.rt1"),this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Kl&&console.error("THREE.EffectComposer relies on THREE.CopyShader"),void 0===rh&&console.error("THREE.EffectComposer relies on THREE.ShaderPass"),this.copyPass=new rh(Kl),this.clock=new be.Clock}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let i=!1;for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,i),r.needsSwap){if(i){const e=this.renderer.getContext(),i=this.renderer.state.buffers.stencil;i.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),i.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==nh&&(r instanceof nh?i=!0:r instanceof sh&&(i=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new be.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(i,r),this.renderTarget2.setSize(i,r);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(i,r)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}}new be.OrthographicCamera(-1,1,1,-1,0,1);const ah=new be.BufferGeometry;ah.setAttribute("position",new be.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),ah.setAttribute("uv",new be.Float32BufferAttribute([0,2,0,0,2,0],2));class lh extends $l{constructor(t,e,i,r,n){super(),this.scene=t||new be.Scene,this.camera=e,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new be.Color}render(t,e,i){const r=t.autoClear;let n,s;t.autoClear=!1,void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(t.getClearColor(this._oldClearColor),n=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:i),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),this.clearColor&&t.setClearColor(this._oldClearColor,n),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),t.autoClear=r}}class hh extends $l{constructor(t,e,i,r){super(),this.renderScene=e,this.renderCamera=i,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new be.Color(1,1,1),this.hiddenEdgeColor=new be.Color(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==t?new be.Vector2(t.x,t.y):new be.Vector2(256,256);const n=Math.round(this.resolution.x/this.downSampleRatio),s=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new be.WebGLRenderTarget(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new be.MeshDepthMaterial,this.depthMaterial.side=be.DoubleSide,this.depthMaterial.depthPacking=be.RGBADepthPacking,this.depthMaterial.blending=be.NoBlending,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=be.DoubleSide,this.prepareMaskMaterial.fragmentShader=function(t,e){const i=e.isPerspectiveCamera?"perspective":"orthographic";return t.replace(/DEPTH_TO_VIEW_Z/g,i+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new be.WebGLRenderTarget(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new be.WebGLRenderTarget(n,s),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new be.WebGLRenderTarget(n,s),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new be.WebGLRenderTarget(Math.round(n/2),Math.round(s/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new be.WebGLRenderTarget(n,s),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new be.WebGLRenderTarget(Math.round(n/2),Math.round(s/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(n,s),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(n/2),Math.round(s/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===Kl&&console.error("THREE.OutlinePass relies on CopyShader");const o=Kl;this.copyUniforms=be.UniformsUtils.clone(o.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new be.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,blending:be.NoBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new be.Color,this.oldClearAlpha=0,this.fsQuad=new ih(null),this.tempPulseColor1=new be.Color,this.tempPulseColor2=new be.Color,this.textureMatrix=new be.Matrix4}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()}setSize(t,e){this.renderTargetMaskBuffer.setSize(t,e),this.renderTargetDepthBuffer.setSize(t,e);let i=Math.round(t/this.downSampleRatio),r=Math.round(e/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(i,r),this.renderTargetBlurBuffer1.setSize(i,r),this.renderTargetEdgeBuffer1.setSize(i,r),this.separableBlurMaterial1.uniforms.texSize.value.set(i,r),i=Math.round(i/2),r=Math.round(r/2),this.renderTargetBlurBuffer2.setSize(i,r),this.renderTargetEdgeBuffer2.setSize(i,r),this.separableBlurMaterial2.uniforms.texSize.value.set(i,r)}changeVisibilityOfSelectedObjects(t){const e=this._visibilityCache;function i(i){i.isMesh&&(!0===t?i.visible=e.get(i):(e.set(i,i.visible),i.visible=t))}for(let t=0;t<this.selectedObjects.length;t++){this.selectedObjects[t].traverse(i)}}changeVisibilityOfNonSelectedObjects(t){const e=this._visibilityCache,i=[];function r(t){t.isMesh&&i.push(t)}for(let t=0;t<this.selectedObjects.length;t++){this.selectedObjects[t].traverse(r)}this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite||r.isTransformControls||"helper"==r._thing_tag){let n=!1;for(let t=0;t<i.length;t++){if(i[t].id===r.id){n=!0;break}}if(!1===n){const i=r.visible;!1!==t&&!0!==e.get(r)||(r.visible=t),e.set(r,i)}}else(r.isPoints||r.isLine)&&(!0===t?r.visible=e.get(r):(e.set(r,r.visible),r.visible=t))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(t,e,i,r,n){if(this.selectedObjects.length>0){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();const e=t.autoClear;t.autoClear=!1,n&&t.state.buffers.stencil.setTest(!1),t.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const r=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,t.setRenderTarget(this.renderTargetDepthBuffer),t.clear(),t.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,t.setRenderTarget(this.renderTargetMaskBuffer),t.clear(),t.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,t.setRenderTarget(this.renderTargetMaskDownSampleBuffer),t.clear(),this.fsQuad.render(t),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const t=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(t),this.tempPulseColor2.multiplyScalar(t)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,t.setRenderTarget(this.renderTargetEdgeBuffer1),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=hh.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,t.setRenderTarget(this.renderTargetBlurBuffer1),t.clear(),this.fsQuad.render(t),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=hh.BlurDirectionY,t.setRenderTarget(this.renderTargetEdgeBuffer1),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=hh.BlurDirectionX,t.setRenderTarget(this.renderTargetBlurBuffer2),t.clear(),this.fsQuad.render(t),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=hh.BlurDirectionY,t.setRenderTarget(this.renderTargetEdgeBuffer2),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,n&&t.state.buffers.stencil.setTest(!0),t.setRenderTarget(i),this.fsQuad.render(t),t.setClearColor(0,0),t.autoClear=e,this.renderToScreen&&(this.fsQuad.material=this.materialCopy,i.texture.encoding=t.outputEncoding,this.copyUniforms.tDiffuse.value=i.texture,t.setRenderTarget(null),this.fsQuad.render(t))}}getPrepareMaskMaterial(){return new be.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new be.Vector2(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t#include <skinning_pars_vertex>\n\n\t\t\tvarying vec4 projTexCoord;\n\t\t\tvarying vec4 vPosition;\n\t\t\tuniform mat4 textureMatrix;\n\n\t\t\tvoid main() {\n\n\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t#include <begin_vertex>\n\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t#include <skinning_vertex>\n\t\t\t\t#include <project_vertex>\n\n\t\t\t\tvPosition = mvPosition;\n\t\t\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\n\t\t\t}",fragmentShader:"#include <packing>\n\t\t\tvarying vec4 vPosition;\n\t\t\tvarying vec4 projTexCoord;\n\t\t\tuniform sampler2D depthTexture;\n\t\t\tuniform vec2 cameraNearFar;\n\n\t\t\tvoid main() {\n\n\t\t\t\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\n\t\t\t}"})}getEdgeDetectionMaterial(){return new be.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new be.Vector2(.5,.5)},visibleEdgeColor:{value:new be.Vector3(1,1,1)},hiddenEdgeColor:{value:new be.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\tuniform sampler2D maskTexture;\n\t\t\tuniform vec2 texSize;\n\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\tuniform vec3 hiddenEdgeColor;\n\n\t\t\tvoid main() {\n\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t}"})}getSeperableBlurMaterial(t){return new be.ShaderMaterial({defines:{MAX_RADIUS:t},uniforms:{colorTexture:{value:null},texSize:{value:new be.Vector2(.5,.5)},direction:{value:new be.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}",fragmentShader:"#include <common>\n\t\t\tvarying vec2 vUv;\n\t\t\tuniform sampler2D colorTexture;\n\t\t\tuniform vec2 texSize;\n\t\t\tuniform vec2 direction;\n\t\t\tuniform float kernelRadius;\n\n\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\n\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\n\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\tuvOffset += delta;\n\t\t\t\t}\n\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t}"})}getOverlayMaterial(){return new be.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\tuniform sampler2D maskTexture;\n\t\t\tuniform sampler2D edgeTexture1;\n\t\t\tuniform sampler2D edgeTexture2;\n\t\t\tuniform sampler2D patternTexture;\n\t\t\tuniform float edgeStrength;\n\t\t\tuniform float edgeGlow;\n\t\t\tuniform bool usePatternTexture;\n\n\t\t\tvoid main() {\n\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\tif(usePatternTexture)\n\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\tgl_FragColor = finalColor;\n\t\t\t}",blending:be.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}hh.BlurDirectionX=new be.Vector2(1,0),hh.BlurDirectionY=new be.Vector2(0,1);var ch=function(t){null==t&&(t=Math),this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.grad4=[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]],this.p=[];for(var e=0;e<256;e++)this.p[e]=Math.floor(256*t.random());this.perm=[];for(e=0;e<512;e++)this.perm[e]=this.p[255&e];this.simplex=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]};ch.prototype.dot=function(t,e,i){return t[0]*e+t[1]*i},ch.prototype.dot3=function(t,e,i,r){return t[0]*e+t[1]*i+t[2]*r},ch.prototype.dot4=function(t,e,i,r,n){return t[0]*e+t[1]*i+t[2]*r+t[3]*n},ch.prototype.noise=function(t,e){var i,r,n=(t+e)*(.5*(Math.sqrt(3)-1)),s=Math.floor(t+n),o=Math.floor(e+n),a=(3-Math.sqrt(3))/6,l=(s+o)*a,h=t-(s-l),c=e-(o-l);h>c?(i=1,r=0):(i=0,r=1);var d=h-i+a,u=c-r+a,p=h-1+2*a,m=c-1+2*a,f=255&s,g=255&o,v=this.perm[f+this.perm[g]]%12,y=this.perm[f+i+this.perm[g+r]]%12,w=this.perm[f+1+this.perm[g+1]]%12,x=.5-h*h-c*c,b=.5-d*d-u*u,_=.5-p*p-m*m;return 70*((x<0?0:(x*=x)*x*this.dot(this.grad3[v],h,c))+(b<0?0:(b*=b)*b*this.dot(this.grad3[y],d,u))+(_<0?0:(_*=_)*_*this.dot(this.grad3[w],p,m)))},ch.prototype.noise3d=function(t,e,i){var r,n,s,o,a,l,h=(t+e+i)*(1/3),c=Math.floor(t+h),d=Math.floor(e+h),u=Math.floor(i+h),p=1/6,m=(c+d+u)*p,f=t-(c-m),g=e-(d-m),v=i-(u-m);f>=g?g>=v?(r=1,n=0,s=0,o=1,a=1,l=0):f>=v?(r=1,n=0,s=0,o=1,a=0,l=1):(r=0,n=0,s=1,o=1,a=0,l=1):g<v?(r=0,n=0,s=1,o=0,a=1,l=1):f<v?(r=0,n=1,s=0,o=0,a=1,l=1):(r=0,n=1,s=0,o=1,a=1,l=0);var y=f-r+p,w=g-n+p,x=v-s+p,b=f-o+2*p,_=g-a+2*p,A=v-l+2*p,S=f-1+.5,T=g-1+.5,E=v-1+.5,P=255&c,M=255&d,C=255&u,L=this.perm[P+this.perm[M+this.perm[C]]]%12,R=this.perm[P+r+this.perm[M+n+this.perm[C+s]]]%12,O=this.perm[P+o+this.perm[M+a+this.perm[C+l]]]%12,F=this.perm[P+1+this.perm[M+1+this.perm[C+1]]]%12,N=.6-f*f-g*g-v*v,D=.6-y*y-w*w-x*x,I=.6-b*b-_*_-A*A,U=.6-S*S-T*T-E*E;return 32*((N<0?0:(N*=N)*N*this.dot3(this.grad3[L],f,g,v))+(D<0?0:(D*=D)*D*this.dot3(this.grad3[R],y,w,x))+(I<0?0:(I*=I)*I*this.dot3(this.grad3[O],b,_,A))+(U<0?0:(U*=U)*U*this.dot3(this.grad3[F],S,T,E)))},ch.prototype.noise4d=function(t,e,i,r){var n,s,o,a,l,h,c,d,u,p,m,f,g=this.grad4,v=this.simplex,y=this.perm,w=(Math.sqrt(5)-1)/4,x=(5-Math.sqrt(5))/20,b=(t+e+i+r)*w,_=Math.floor(t+b),A=Math.floor(e+b),S=Math.floor(i+b),T=Math.floor(r+b),E=(_+A+S+T)*x,P=t-(_-E),M=e-(A-E),C=i-(S-E),L=r-(T-E),R=(P>M?32:0)+(P>C?16:0)+(M>C?8:0)+(P>L?4:0)+(M>L?2:0)+(C>L?1:0),O=P-(n=v[R][0]>=3?1:0)+x,F=M-(s=v[R][1]>=3?1:0)+x,N=C-(o=v[R][2]>=3?1:0)+x,D=L-(a=v[R][3]>=3?1:0)+x,I=P-(l=v[R][0]>=2?1:0)+2*x,U=M-(h=v[R][1]>=2?1:0)+2*x,B=C-(c=v[R][2]>=2?1:0)+2*x,k=L-(d=v[R][3]>=2?1:0)+2*x,j=P-(u=v[R][0]>=1?1:0)+3*x,V=M-(p=v[R][1]>=1?1:0)+3*x,z=C-(m=v[R][2]>=1?1:0)+3*x,G=L-(f=v[R][3]>=1?1:0)+3*x,H=P-1+4*x,X=M-1+4*x,W=C-1+4*x,Y=L-1+4*x,Q=255&_,J=255&A,Z=255&S,q=255&T,K=y[Q+y[J+y[Z+y[q]]]]%32,$=y[Q+n+y[J+s+y[Z+o+y[q+a]]]]%32,tt=y[Q+l+y[J+h+y[Z+c+y[q+d]]]]%32,et=y[Q+u+y[J+p+y[Z+m+y[q+f]]]]%32,it=y[Q+1+y[J+1+y[Z+1+y[q+1]]]]%32,rt=.6-P*P-M*M-C*C-L*L,nt=.6-O*O-F*F-N*N-D*D,st=.6-I*I-U*U-B*B-k*k,ot=.6-j*j-V*V-z*z-G*G,at=.6-H*H-X*X-W*W-Y*Y;return 27*((rt<0?0:(rt*=rt)*rt*this.dot4(g[K],P,M,C,L))+(nt<0?0:(nt*=nt)*nt*this.dot4(g[$],O,F,N,D))+(st<0?0:(st*=st)*st*this.dot4(g[tt],I,U,B,k))+(ot<0?0:(ot*=ot)*ot*this.dot4(g[et],j,V,z,G))+(at<0?0:(at*=at)*at*this.dot4(g[it],H,X,W,Y)))};const dh={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new be.Vector2},cameraProjectionMatrix:{value:new be.Matrix4},cameraInverseProjectionMatrix:{value:new be.Matrix4},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:"\n\n\tvarying vec2 vUv;\n\n\tvoid main() {\n\n\t\tvUv = uv;\n\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t}",fragmentShader:"\n\n\tuniform sampler2D tDiffuse;\n\tuniform sampler2D tNormal;\n\tuniform sampler2D tDepth;\n\tuniform sampler2D tNoise;\n\n\tuniform vec3 kernel[ KERNEL_SIZE ];\n\n\tuniform vec2 resolution;\n\n\tuniform float cameraNear;\n\tuniform float cameraFar;\n\tuniform mat4 cameraProjectionMatrix;\n\tuniform mat4 cameraInverseProjectionMatrix;\n\n\tuniform float kernelRadius;\n\tuniform float minDistance; // avoid artifacts caused by neighbour fragments with minimal depth difference\n\tuniform float maxDistance; // avoid the influence of fragments which are too far away\n\n\tvarying vec2 vUv;\n\n\t#include <packing>\n\n\tfloat getDepth( const in vec2 screenPosition ) {\n\n\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t}\n\n\tfloat getLinearDepth( const in vec2 screenPosition ) {\n\n\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;\n\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t#else\n\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t#endif\n\n\t}\n\n\tfloat getViewZ( const in float depth ) {\n\n\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\n\t\t#else\n\n\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\n\t\t#endif\n\n\t}\n\n\tvec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n\n\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n\n\t\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );\n\n\t\tclipPosition *= clipW; // unprojection.\n\n\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;\n\n\t}\n\n\tvec3 getViewNormal( const in vec2 screenPosition ) {\n\n\t\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );\n\n\t}\n\n\tvoid main() {\n\n\t\tfloat depth = getDepth( vUv );\n\t\tfloat viewZ = getViewZ( depth );\n\n\t\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );\n\t\tvec3 viewNormal = getViewNormal( vUv );\n\n\t\tvec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );\n\t\tvec3 random = vec3( texture2D( tNoise, vUv * noiseScale ).r );\n\n\t\t// compute matrix used to reorient a kernel vector\n\n\t\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );\n\t\tvec3 bitangent = cross( viewNormal, tangent );\n\t\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );\n\n\t float occlusion = 0.0;\n\n\t for ( int i = 0; i < KERNEL_SIZE; i ++ ) {\n\n\t\t\tvec3 sampleVector = kernelMatrix * kernel[ i ]; // reorient sample vector in view space\n\t\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius ); // calculate sample point\n\n\t\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 ); // project point and calculate NDC\n\t\t\tsamplePointNDC /= samplePointNDC.w;\n\n\t\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5; // compute uv coordinates\n\n\t\t\tfloat realDepth = getLinearDepth( samplePointUv ); // get linear depth from depth texture\n\t\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar ); // compute linear depth of the sample view Z value\n\t\t\tfloat delta = sampleDepth - realDepth;\n\n\t\t\tif ( delta > minDistance && delta < maxDistance ) { // if fragment is before sample point, increase occlusion\n\n\t\t\t\tocclusion += 1.0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );\n\n\t}"},uh={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:"varying vec2 vUv;\n\n\tvoid main() {\n\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t}",fragmentShader:"uniform sampler2D tDepth;\n\n\tuniform float cameraNear;\n\tuniform float cameraFar;\n\n\tvarying vec2 vUv;\n\n\t#include <packing>\n\n\tfloat getLinearDepth( const in vec2 screenPosition ) {\n\n\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;\n\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t#else\n\n\t\t\treturn texture2D( tDepth, screenPosition ).x;\n\n\t\t#endif\n\n\t}\n\n\tvoid main() {\n\n\t\tfloat depth = getLinearDepth( vUv );\n\t\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );\n\n\t}"},ph={uniforms:{tDiffuse:{value:null},resolution:{value:new be.Vector2}},vertexShader:"varying vec2 vUv;\n\n\tvoid main() {\n\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t}",fragmentShader:"uniform sampler2D tDiffuse;\n\n\tuniform vec2 resolution;\n\n\tvarying vec2 vUv;\n\n\tvoid main() {\n\n\t\tvec2 texelSize = ( 1.0 / resolution );\n\t\tfloat result = 0.0;\n\n\t\tfor ( int i = - 2; i <= 2; i ++ ) {\n\n\t\t\tfor ( int j = - 2; j <= 2; j ++ ) {\n\n\t\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;\n\t\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );\n\n\t}"};class mh extends $l{constructor(t,e,i,r){super(),this.width=void 0!==i?i:512,this.height=void 0!==r?r:512,this.clear=!0,this.camera=e,this.scene=t,this.kernelRadius=8,this.kernelSize=32,this.kernel=[],this.noiseTexture=null,this.output=0,this.minDistance=.005,this.maxDistance=.1,this._visibilityCache=new Map,this.generateSampleKernel(),this.generateRandomKernelRotations();const n=new be.DepthTexture;n.format=be.DepthStencilFormat,n.type=be.UnsignedInt248Type,this.beautyRenderTarget=new be.WebGLRenderTarget(this.width,this.height),this.normalRenderTarget=new be.WebGLRenderTarget(this.width,this.height,{minFilter:be.NearestFilter,magFilter:be.NearestFilter,depthTexture:n}),this.ssaoRenderTarget=new be.WebGLRenderTarget(this.width,this.height),this.blurRenderTarget=this.ssaoRenderTarget.clone(),this.ssaoMaterial=new be.ShaderMaterial({defines:Object.assign({},dh.defines),uniforms:be.UniformsUtils.clone(dh.uniforms),vertexShader:dh.vertexShader,fragmentShader:dh.fragmentShader,blending:be.NoBlending}),this.ssaoMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssaoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssaoMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.ssaoMaterial.uniforms.tNoise.value=this.noiseTexture,this.ssaoMaterial.uniforms.kernel.value=this.kernel,this.ssaoMaterial.uniforms.cameraNear.value=this.camera.near,this.ssaoMaterial.uniforms.cameraFar.value=this.camera.far,this.ssaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.normalMaterial=new be.MeshNormalMaterial,this.normalMaterial.blending=be.NoBlending,this.blurMaterial=new be.ShaderMaterial({defines:Object.assign({},ph.defines),uniforms:be.UniformsUtils.clone(ph.uniforms),vertexShader:ph.vertexShader,fragmentShader:ph.fragmentShader}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new be.ShaderMaterial({defines:Object.assign({},uh.defines),uniforms:be.UniformsUtils.clone(uh.uniforms),vertexShader:uh.vertexShader,fragmentShader:uh.fragmentShader,blending:be.NoBlending}),this.depthRenderMaterial.uniforms.tDepth.value=this.normalRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new be.ShaderMaterial({uniforms:be.UniformsUtils.clone(Kl.uniforms),vertexShader:Kl.vertexShader,fragmentShader:Kl.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:be.DstColorFactor,blendDst:be.ZeroFactor,blendEquation:be.AddEquation,blendSrcAlpha:be.DstAlphaFactor,blendDstAlpha:be.ZeroFactor,blendEquationAlpha:be.AddEquation}),this.fsQuad=new ih(null),this.originalClearColor=new be.Color}dispose(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}render(t,e){switch(!1===t.capabilities.isWebGL2&&(this.noiseTexture.format=be.LuminanceFormat),t.setRenderTarget(this.beautyRenderTarget),t.clear(),t.render(this.scene,this.camera),this.overrideVisibility(),this.renderOverride(t,this.normalMaterial,this.normalRenderTarget,7829503,1),this.restoreVisibility(),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(t,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(t,this.blurMaterial,this.blurRenderTarget),this.output){case mh.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=be.NoBlending,this.renderPass(t,this.copyMaterial,this.renderToScreen?null:e);break;case mh.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=be.NoBlending,this.renderPass(t,this.copyMaterial,this.renderToScreen?null:e);break;case mh.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=be.NoBlending,this.renderPass(t,this.copyMaterial,this.renderToScreen?null:e);break;case mh.OUTPUT.Depth:this.renderPass(t,this.depthRenderMaterial,this.renderToScreen?null:e);break;case mh.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=be.NoBlending,this.renderPass(t,this.copyMaterial,this.renderToScreen?null:e);break;case mh.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=be.NoBlending,this.renderPass(t,this.copyMaterial,this.renderToScreen?null:e),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=be.CustomBlending,this.renderPass(t,this.copyMaterial,this.renderToScreen?null:e);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}renderPass(t,e,i,r,n){t.getClearColor(this.originalClearColor);const s=t.getClearAlpha(),o=t.autoClear;t.setRenderTarget(i),t.autoClear=!1,null!=r&&(t.setClearColor(r),t.setClearAlpha(n||0),t.clear()),this.fsQuad.material=e,this.fsQuad.render(t),t.autoClear=o,t.setClearColor(this.originalClearColor),t.setClearAlpha(s)}renderOverride(t,e,i,r,n){t.getClearColor(this.originalClearColor);const s=t.getClearAlpha(),o=t.autoClear;t.setRenderTarget(i),t.autoClear=!1,r=e.clearColor||r,n=e.clearAlpha||n,null!=r&&(t.setClearColor(r),t.setClearAlpha(n||0),t.clear()),this.scene.overrideMaterial=e,t.render(this.scene,this.camera),this.scene.overrideMaterial=null,t.autoClear=o,t.setClearColor(this.originalClearColor),t.setClearAlpha(s)}setSize(t,e){this.width=t,this.height=e,this.beautyRenderTarget.setSize(t,e),this.ssaoRenderTarget.setSize(t,e),this.normalRenderTarget.setSize(t,e),this.blurRenderTarget.setSize(t,e),this.ssaoMaterial.uniforms.resolution.value.set(t,e),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(t,e)}generateSampleKernel(){const t=this.kernelSize,e=this.kernel;for(let i=0;i<t;i++){const r=new be.Vector3;r.x=2*Math.random()-1,r.y=2*Math.random()-1,r.z=Math.random(),r.normalize();let n=i/t;n=be.Math.lerp(.1,1,n*n),r.multiplyScalar(n),e.push(r)}}generateRandomKernelRotations(){const t=new ch,e=new Float32Array(16);for(let i=0;i<16;i++){const r=2*Math.random()-1,n=2*Math.random()-1,s=0;e[i]=t.noise3d(r,n,s)}this.noiseTexture=new be.DataTexture(e,4,4,be.RedFormat,be.FloatType),this.noiseTexture.wrapS=be.RepeatWrapping,this.noiseTexture.wrapT=be.RepeatWrapping,this.noiseTexture.needsUpdate=!0}overrideVisibility(){const t=this.scene,e=this._visibilityCache;t.traverse((function(t){e.set(t,t.visible),(t.isPoints||t.isLine)&&(t.visible=!1)}))}restoreVisibility(){const t=this.scene,e=this._visibilityCache;t.traverse((function(t){const i=e.get(t);t.visible=i})),e.clear()}}mh.OUTPUT={Default:0,SSAO:1,Blur:2,Beauty:3,Depth:4,Normal:5};const fh=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];class gh extends $l{constructor(t,e,i,r){super(),this.scene=t,this.camera=e,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==i?i:0,this.clearAlpha=void 0!==r?r:0,this._oldClearColor=new be.Color,void 0===Kl&&console.error("THREE.SSAARenderPass relies on CopyShader");const n=Kl;this.copyUniforms=be.UniformsUtils.clone(n.uniforms),this.copyMaterial=new be.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:be.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.fsQuad=new ih(this.copyMaterial)}dispose(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)}setSize(t,e){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(t,e)}render(t,e,i){this.sampleRenderTarget||(this.sampleRenderTarget=new be.WebGLRenderTarget(i.width,i.height,{minFilter:be.LinearFilter,magFilter:be.LinearFilter,format:be.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");const r=fh[Math.max(0,Math.min(this.sampleLevel,5))],n=t.autoClear;t.autoClear=!1,t.getClearColor(this._oldClearColor);const s=t.getClearAlpha(),o=1/r.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;const a={fullWidth:i.width,fullHeight:i.height,offsetX:0,offsetY:0,width:i.width,height:i.height},l=Object.assign({},this.camera.view);l.enabled&&Object.assign(a,l);for(let i=0;i<r.length;i++){const n=r[i];this.camera.setViewOffset&&this.camera.setViewOffset(a.fullWidth,a.fullHeight,a.offsetX+.0625*n[0],a.offsetY+.0625*n[1],a.width,a.height);let s=o;if(this.unbiased){s+=.03125*((i+.5)/r.length-.5)}this.copyUniforms.opacity.value=s,t.setClearColor(this.clearColor,this.clearAlpha),t.setRenderTarget(this.sampleRenderTarget),t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(this.renderToScreen?null:e),0===i&&(t.setClearColor(0,0),t.clear()),this.fsQuad.render(t)}this.camera.setViewOffset&&l.enabled?this.camera.setViewOffset(l.fullWidth,l.fullHeight,l.offsetX,l.offsetY,l.width,l.height):this.camera.clearViewOffset&&this.camera.clearViewOffset(),t.autoClear=n,t.setClearColor(this._oldClearColor,s)}}const{Color:vh}=be;var yh={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new vh(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};class wh extends $l{constructor(t,e,i,r){super(),this.strength=void 0!==e?e:1,this.radius=i,this.threshold=r,this.resolution=void 0!==t?new be.Vector2(t.x,t.y):new be.Vector2(256,256),this.clearColor=new be.Color(0,0,0);const n={minFilter:be.LinearFilter,magFilter:be.LinearFilter,format:be.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new be.WebGLRenderTarget(s,o,n),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let t=0;t<this.nMips;t++){const e=new be.WebGLRenderTarget(s,o,n);e.texture.name="UnrealBloomPass.h"+t,e.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(e);const i=new be.WebGLRenderTarget(s,o,n);i.texture.name="UnrealBloomPass.v"+t,i.texture.generateMipmaps=!1,this.renderTargetsVertical.push(i),s=Math.round(s/2),o=Math.round(o/2)}void 0===yh&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const a=yh;this.highPassUniforms=be.UniformsUtils.clone(a.uniforms),this.highPassUniforms.luminosityThreshold.value=r,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new be.ShaderMaterial({uniforms:this.highPassUniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const l=[3,5,7,9,11];s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);for(let t=0;t<this.nMips;t++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(l[t])),this.separableBlurMaterials[t].uniforms.texSize.value=new be.Vector2(s,o),s=Math.round(s/2),o=Math.round(o/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=e,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0;this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new be.Vector3(1,1,1),new be.Vector3(1,1,1),new be.Vector3(1,1,1),new be.Vector3(1,1,1),new be.Vector3(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===Kl&&console.error("THREE.UnrealBloomPass relies on CopyShader");const h=Kl;this.copyUniforms=be.UniformsUtils.clone(h.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new be.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,blending:be.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new be.Color,this.oldClearAlpha=1,this.basic=new be.MeshBasicMaterial,this.fsQuad=new ih(null)}dispose(){for(let t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(let t=0;t<this.renderTargetsVertical.length;t++)this.renderTargetsVertical[t].dispose();this.renderTargetBright.dispose()}setSize(t,e){let i=Math.round(t/2),r=Math.round(e/2);this.renderTargetBright.setSize(i,r);for(let t=0;t<this.nMips;t++)this.renderTargetsHorizontal[t].setSize(i,r),this.renderTargetsVertical[t].setSize(i,r),this.separableBlurMaterials[t].uniforms.texSize.value=new be.Vector2(i,r),i=Math.round(i/2),r=Math.round(r/2)}render(t,e,i,r,n){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();const s=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),n&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=i.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=i.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);let o=this.renderTargetBright;for(let e=0;e<this.nMips;e++)this.fsQuad.material=this.separableBlurMaterials[e],this.separableBlurMaterials[e].uniforms.colorTexture.value=o.texture,this.separableBlurMaterials[e].uniforms.direction.value=wh.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[e]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[e].uniforms.colorTexture.value=this.renderTargetsHorizontal[e].texture,this.separableBlurMaterials[e].uniforms.direction.value=wh.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[e]),t.clear(),this.fsQuad.render(t),o=this.renderTargetsVertical[e];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,n&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(i),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=s}getSeperableBlurMaterial(t){return new be.ShaderMaterial({defines:{KERNEL_RADIUS:t,SIGMA:t},uniforms:{colorTexture:{value:null},texSize:{value:new be.Vector2(.5,.5)},direction:{value:new be.Vector2(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}",fragmentShader:"#include <common>\n\t\t\tvarying vec2 vUv;\n\t\t\tuniform sampler2D colorTexture;\n\t\t\tuniform vec2 texSize;\n\t\t\tuniform vec2 direction;\n\n\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t}\n\t\t\tvoid main() {\n\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\tfloat alphaNum = 0.0;\n\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\talphaNum += (texture2D( colorTexture, vUv + uvOffset).a + texture2D( colorTexture, vUv - uvOffset).a) * w;\n\t\t\t\t}\n\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, alphaNum/weightSum);\n\t\t\t}"})}getCompositeMaterial(t){return new be.ShaderMaterial({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\tvoid main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\tuniform sampler2D blurTexture1;\n\t\t\tuniform sampler2D blurTexture2;\n\t\t\tuniform sampler2D blurTexture3;\n\t\t\tuniform sampler2D blurTexture4;\n\t\t\tuniform sampler2D blurTexture5;\n\t\t\tuniform sampler2D dirtTexture;\n\t\t\tuniform float bloomStrength;\n\t\t\tuniform float bloomRadius;\n\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t}\n\n\t\t\tvoid main() {\n\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t}"})}}wh.BlurDirectionX=new be.Vector2(1,0),wh.BlurDirectionY=new be.Vector2(0,1);const xh={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:1},exposure:{value:0},gamma:{value:1},saturation:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float brightness;","uniform float contrast;","uniform float exposure;","uniform float gamma;","uniform float saturation;","const vec3 w = vec3(0.2125, 0.7154, 0.0721);","void main() {","vec4 tex = texture2D( tDiffuse, vUv );","vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);","color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);","color = clamp( color * pow(2.0, exposure), 0.0, 1.0);","color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);","float luminance = dot( color, w );","color = mix(vec3(luminance), color, saturation);","gl_FragColor = vec4(color, tex.a);","}"].join("\n")};const bh={uniforms:{tDiffuse:{value:null}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\t\t\t\tuniform sampler2D tDiffuse;\n\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\t\n\t\tvoid main() {\n\n\t\t\t\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\tgl_FragColor = LinearTosRGB( tex );\n\n\t\t}"};class _h extends ui{constructor(t,e,i,r){super(),this.viewer=r,this.renderer=t,this.camera=i,this.scene=e,this.enable=!1;const n=t.getSize(new be.Vector2);let s={minFilter:be.LinearFilter,magFilter:be.LinearFilter,format:be.RGBAFormat,type:be.FloatType,stencilBuffer:!0,encoding:be.sRGBEncoding};const o=new be.WebGLRenderTarget(n.width,n.height,s);o.samples=8,this.renderPass=new lh(e,i),this.renderPass.clearColor=new be.Color(0,0,0),this.renderPass.clearAlpha=0;const a=this.composer=new oh(t,o);a.addPass(this.renderPass),this.setBloomPass({enabled:!1}),this.setColorPass({enabled:!1}),this.setOutlinePass({enabled:!1}),this.setFXAAPass({enabled:!0}),this.setGammaCorrectionPass({enabled:!0}),a.readBuffer.texture.encoding=be.sRGBEncoding,a.writeBuffer.texture.encoding=be.sRGBEncoding,a.renderTarget1.texture.encoding=be.sRGBEncoding,a.renderTarget2.texture.encoding=be.sRGBEncoding}setBloomPass(t){if(!t)return;this.bloomPassOption||(this.bloomPassOption={enabled:!1,strength:.14,threshold:.1,radius:.4,selective:!1}),pt(this.bloomPassOption,t);const e=this.bloomPassOption;if(!this.bloomPass){const{width:t,height:n}=this.viewer.getSize();if(this.bloomPass=new wh(new be.Vector2(t,n),e.strength,e.radius,e.threshold),this.composer.addPass(this.bloomPass),e.selective){const t=this.bloomSelectPass=(i=this.composer,(r=new rh(new be.ShaderMaterial({uniforms:{baseTexture:{value:null},bloomTexture:{value:i.renderTarget2.texture}},vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",fragmentShader:"\nuniform sampler2D baseTexture;\nuniform sampler2D bloomTexture;\nvarying vec2 vUv;\nvoid main() {\n\t\tgl_FragColor = ( texture2D( baseTexture, vUv ) + vec4( 1.0 ) * texture2D( bloomTexture, vUv ) );\n}\n",defines:{}}),"baseTexture")).needsSwap=!0,r);this.composer.addPass(t),this.composer.renderToScreen=!1}else this.bloomSelectPass&&(this.composer.removePass(this.bloomSelectPass),this.bloomSelectPass=null)}var i,r;for(const t in e)this.bloomPass[t]=e[t]}setOutlinePass(t){if(!t)return;if(this.outlinePassOption||(this.outlinePassOption={enabled:!1,edgeStrength:5,edgeGlow:1,edgeThickness:1,pulsePeriod:0,visibleEdgeColor:"#ed2a2a",hiddenEdgeColor:"#190a05"}),pt(this.outlinePassOption,t),!this.outlinePass){const{width:t,height:e}=this.viewer.getSize();this.outlinePass=new hh(new be.Vector2(t,e),this.scene,this.camera),this.composer.addPass(this.outlinePass)}const e=this.outlinePassOption;for(const t in e)t.indexOf("Color")<0?this.outlinePass[t]=e[t]:this.outlinePass[t]=ni(e[t])}setSSAOPass(t){if(t){if(this.SSAOPassOption||(this.SSAOPassOption={enabled:!1,kernelRadius:.2,kernelSize:12,minDistance:.005,maxDistance:.1}),pt(this.SSAOPassOption,t),!this.ssaoPass){this.viewer.sceneManager.getScene();const{width:t,height:e}=this.viewer.getSize();this.ssaoPass=new mh(this.scene,this.camera,t,e),this.composer.addPass(this.ssaoPass)}for(const t in this.SSAOPassOption)this.ssaoPass[t]=this.SSAOPassOption[t]}}setFXAAPass(t){if(!t)return;if(this.effectFXAAOption||(this.effectFXAAOption={enabled:!1}),pt(this.effectFXAAOption,t),!this.effectFXAA){const{width:t,height:e}=this.viewer.getSize(),i=this.renderer.getPixelRatio();this.effectFXAA=new rh(ql);const r=this.effectFXAA;r.transparent=!0,r.uniforms.resolution.value.x=1/(t*i*2),r.uniforms.resolution.value.y=1/(e*i*2),this.composer.addPass(this.effectFXAA)}const e=this.effectFXAAOption;for(const t in e)this.effectFXAA[t]=e[t]}setSSAAPass(t){if(t){this.SSAAPassOption||(this.SSAAPassOption={sampleLevel:4,unbiased:!0}),pt(this.SSAAPassOption,t||{}),this.SSAAPass||(this.SSAAPass=new gh(this.scene,this.camera),this.composer.addPass(this.SSAAPass));for(const t in this.SSAAPassOption)this.SSAAPass[t]=this.SSAAPassOption[t]}}setGammaCorrectionPass(t){if(t){if(this.gammaCorrectionPassOption||(this.gammaCorrectionPassOption={enabled:!1}),pt(this.gammaCorrectionPassOption,t||{}),!this.gammaCorrectionPass){const t=this.gammaCorrectionPass=new rh(bh);this.composer.addPass(t)}for(const t in this.gammaCorrectionPassOption)this.gammaCorrectionPass[t]=this.gammaCorrectionPassOption[t]}}setColorPass(t){if(t){this.colorPassOption||(this.colorPassOption={enabled:!1,exposure:0,brightness:0,contrast:1,saturation:1,gamma:1}),pt(this.colorPassOption,t||{}),this.colorPass||(this.colorPass=new rh(xh),this.composer.addPass(this.colorPass));for(const t in this.colorPassOption){const e=this.colorPassOption[t];"enabled"===t?this.colorPass[t]=e:void 0!==this.colorPass.uniforms[t]&&(this.colorPass.uniforms[t].value=e)}}}setSize(t,e){this.composer.setSize(t,e);const i=this.renderer.getPixelRatio();this.effectFXAA&&this.effectFXAA.material.uniforms.resolution.value.set(1/t*i,1/e*i)}render(t,e){this.enable&&(this.renderPass.scene=e,this.composer.render(t),this.bloomSelectPass)}}const Ah={enable:!1,bloom:{enable:!1,strength:.14,radius:.4,threshold:.7},SSAO:{enable:!1,kernelRadius:.2,kernelSize:12},colorCorrection:{enable:!1,exposure:0,brightness:0,contrast:1,saturation:1,gamma:.6},FXAA:{enable:!0},outline:{enable:!0,edgeStrength:2,edgeGlow:.1,edgeThickness:.5,pulsePeriod:0,visibleEdgeColor:"#FF0000",hiddenEdgeColor:"#190a05"}};class Sh extends ui{constructor(t,e){super(),this.option=pt({forceRender:!1,fps:60,devicePixelRatio:window.devicePixelRatio||1,postEffect:et(Ah)},e),zt(),this.viewer=t,this.cssRenderer=this.viewer._cssRenderer,this._cssRendererEnable=!1,this.renderer=this._createRenderer(),this.needRender=!1,this.forceRender=this.option.forceRender,this.fps=this.option.fps,this.clock=new be.Clock,this.elapsedTime=this.clock.getElapsedTime(),this.currentFrame=0,this._renderTimeFlag=0,this.renderer.getContext().canvas.addEventListener("webglcontextlost",(function(t){t.preventDefault()}),!1),this.effectRenderer=null,this._initPmremGenerator(),this.setMainRendererEnable(this.option.postEffect.enable||!1)}get cssRendererEnable(){return this._cssRendererEnable}set cssRendererEnable(t){this._cssRendererEnable=t,this.cssRenderer.domElement.style.display=t?"block":"none"}_initPmremGenerator(){const t=new be.PMREMGenerator(this.renderer);t.compileEquirectangularShader(),this.pmremGenerator=t}loadHDR(t){return new Promise(((e,i)=>{(new tl).load(mo.transformUrl(t),(t=>{const i=this.pmremGenerator.fromEquirectangular(t).texture;i.encoding=be.sRGBEncoding,e(i)}))}))}getRenderer(){return this.effectRenderer||this.renderer}_createRenderer(){const{devicePixelRatio:t}=this.option;var e=new be.WebGLRenderer({preserveDrawingBuffer:!1,antialias:!0,premultipliedAlpha:!0,logarithmicDepthBuffer:!0,alpha:!0});e.setPixelRatio(t);var i=this.viewer.getSize();return e.setSize(i.width,i.height),e.sortObjects=!1,e.shadowMap.enabled=!0,e.shadowMap.type=be.PCFSoftShadowMap,e.outputEncoding=be.sRGBEncoding,e.autoClearDepth=!0,e.autoClearStencil=!0,e.setClearColor(0,0),e.autoClear=!1,e.physicallyCorrectLights=!0,e}_collectRenderStates(){if(!this.debugger.enable)return;var t=this.renderer.info.memory,e=this.renderer.info.render;const i=this.scene.getVerticesCount();this.debugger.renderStates=this.renderStates={geometries:t.geometries,textures:t.textures,frame:e.frame,calls:e.calls,triangles:e.triangles,points:e.points,lines:e.lines,vertices:i}}get fps(){return this._renderFPS}set fps(t){this._renderFPS=t||60,this._renderTime=1/this._renderFPS,this._renderTimeFlag=0}setMainRendererEnable(t){if(!this.effectRenderer){const t=this.viewer.sm.getScene(),e=this.viewer;this.effectRenderer=new _h(this.renderer,t,e.camera,e),this.effectRenderer.renderer.logarithmicDepthBuffer=!0,this.setPostEffect({...this.option.postEffect||{},enable:!0})}this.effectRenderer.enable=t}canUsePostEffect(){return this.effectRenderer&&this.effectRenderer.enable}render(){const{camera:t,cameraControl:e,sceneManager:i}=this.viewer;if(!i||!t)return;const r=i.getScene();if(!r)return;const n=this.deltaTime=this.clock.getDelta();if(this._renderTimeFlag+=n,this.needRender||this._renderTimeFlag>this._renderTime&&this.forceRender){const s=this.renderer,o=i.sceneHelpers;e.tick(n),r.update(n),Xt(),this.canUsePostEffect()?("OrthographicCamera"==t.type?this.effectRenderer.composer.renderer.render(r,t):this.effectRenderer.render(n,r),this.cssRenderer.render(r,t),s.clearDepth(),this.effectRenderer.composer.renderer.render(o,t)):(s.render(r,t),this.cssRenderer.render(r,t),s.clearDepth(),s.render(o,t)),r.csm&&r.csm.update(),this._renderTimeFlag=0,this.needRender=!1,this.dispatchEvent({type:"render",deltaTime:n,clock:this.clock})}this.viewer.debugger&&this.viewer.debugger.update()}enableRender(){this.forceRender||(this.needRender=!0)}start(){this.renderer.setAnimationLoop((()=>{this.render()})),this.needRender=!0}stop(){this.renderer.setAnimationLoop(null)}setSize(t,e){this.renderer.setSize(t,e),this.cssRenderer.setSize(t,e),this.effectRenderer&&this.effectRenderer.setSize(t,e)}closePostEffect(){this.setPostEffect({enable:!1})}setPostEffect(t){if(!t)return;pt(this.option.postEffect,t||{});const e=this.option.postEffect,{bloom:i,SSAO:r,colorCorrection:n,FXAA:s,enable:o,outline:a}=et(e);if(this.effectRenderer&&(this.effectRenderer.enable=o),!this.canUsePostEffect())return;const l=this.effectRenderer;i&&(i.enabled=o&&i.enable,delete i.enable,l.setBloomPass(i)),r&&(r.enabled=o&&r.enable,delete r.enable,l.setSSAOPass(r)),n&&(n.enabled=o&&n.enable,delete n.enable,l.setColorPass(n)),s&&(s.enabled=o&&s.enable,delete s.enable,l.setFXAAPass(s)),a&&(a.enabled=o&&a.enable,delete a.enable,l.setOutlinePass(a)),this.enableRender()}destroy(){this.renderer.dispose(),this.clock.stop(),this.clock=null}addOutlineObject(t){t&&!this.outlinePass.selectedObjects.includes(t)&&this.outlinePass.selectedObjects.push(t)}removeOutlineObject(t){this.outlinePass.selectedObjects=this.outlinePass.selectedObjects.filter((e=>e!==t))}setOutlineObject(t){this.outlinePass.selectedObjects=t?[t]:[]}clearOutlineObjects(){this.outlinePass.selectedObjects=[]}get outlinePass(){return this.effectRenderer.outlinePass}get bloom(){return this.effectRenderer.enable&&this.effectRenderer.bloomPass.enabled}set bloom(t){this.effectRenderer.setBloomPass({enabled:t})}get SSAO(){return this.effectRenderer.enable&&this.effectRenderer.ssaoPass.enabled}set SSAO(t){this.effectRenderer.setSSAOPass({enabled:t})}get outline(){return this.effectRenderer.enable&&this.effectRenderer.outlinePass.enabled}set outline(t){return this.effectRenderer.setOutlinePass({enabled:t})}get FXAA(){return this.effectRenderer.enable&&this.effectRenderer.effectFXAA.enabled}set FXAA(t){this.effectRenderer.setFXAAPass({enabled:t})}}class Th extends ui{constructor(t){super(),this.viewer=t,this.renderer=t.rendererManager.renderer,this._singleClickTimer=null,ht(["_createCommonEvent","_commonEventHandle"],this),this.commonEventTypes=[ne,oe,ae,le,se],this.commonEventTypes.forEach((t=>{this[`__${t}Event`]=this._createCommonEvent(t),this[`_${t}Event`]=ut(this[`__${t}Event`],0,this),this[`_${t}Object`]=null})),this._resizeEvent=ut(t.resize,300,t),this.hotkeysScope="default",this.addEventListener("scopeUpdate",(t=>{this.hotkeysScope=t.scope})),this.init()}init(){this.clear();const t=this.viewer,e=this.viewer.container;window.addEventListener(he,this._resizeEvent,!1),this.commonEventTypes.forEach((t=>{const i=this[`_${t}Event`];let r=t;t===ae&&(r="mousemove"),t===re&&(r="click"),e.addEventListener(r,i,!1)}));const i=t.cameraControl;i.control.addEventListener("control",(t=>{i.dispatchEvent({type:t.eventType,target:t.target}),i.dispatchEvent({type:"change",target:t.target}),"truck"==t.eventType&&i.dispatchEvent({target:t.target,type:"dragging"})})),i.control.addEventListener("controlstart",(t=>{i.dispatchEvent({type:t.eventType,target:t.target}),i.dispatchEvent({type:"changestart",target:t.target}),"truckstart"==t.eventType&&i.dispatchEvent({target:t.target,type:"dragstart"})})),i.control.addEventListener("controlend",(t=>{i.dispatchEvent({type:t.eventType,target:t.target}),i.dispatchEvent({type:"changeend",target:t.target}),"truckend"==t.eventType&&i.dispatchEvent({target:t.target,type:"dragend"})})),t.on("ready",(()=>{t.rendererManager.enableRender()}))}getEventStates(){const{selector:t,cameraControl:e,picker:i}=this.viewer;return{selector:{enabled:t.enabled},cameraControl:{enabled:e.enabled,firstPersonMode:e.firstPersonMode,keypress:e.keypress},picker:{enabled:i.enabled}}}setEventStates(t){if(!t||tt(t))return;const e=pt(this.getEventStates(),et(t||{}));for(const t in e){const i=e[t];for(const e in i)this.viewer[t][e]=i[e]}}trigger(t,e){this.commonEventTypes.includes(t)&&this[`_${t}Event`](e)}_commonEventHandle(t,e){if(!t||!e)return;let i=this[`_${t}Object`],{picked:r,raycasterPicked:n,raycasterSceneHelpersPicked:s}=this.viewer.picker.pick(e),o=r[0]||n[0]?.object||null,a=s[0]?.object||null;i===o&&(i=null);let l=this.viewer.coordScreenToWorldWithPick(e.clientX,e.clientY,0);this.viewer.dispatchEvent({type:t,originalEvent:e,object:o,previousObject:i,position:l,raycaster:n[0],sceneHelpersRaycaster:s[0],sceneHelpersObject:a}),o&&o.dispatchEvent({type:t,originalEvent:e,raycaster:n[0]}),this[`_${t}Object`]=o,this.viewer.rendererManager.enableRender()}_createCommonEvent(t){return e=>{if(this.viewer.hasEvent(t))if(t!==ae&&e.stopPropagation(),t===le&&clearTimeout(this._singleClickTimer),t===ne){clearTimeout(this._singleClickTimer);const i=this.viewer.hasEvent(le);this._singleClickTimer=setTimeout((()=>{this._commonEventHandle(t,e)}),i?250:0)}else this._commonEventHandle(t,e)}}clear(){window.removeEventListener(he,this._resizeEvent);const t=this.viewer.container;this.commonEventTypes.forEach((e=>{const i=this[`_${e}Event`];let r=e;e===ae&&(r="mousemove"),t.removeEventListener(r,i,!1)}))}}class Eh extends be.EventDispatcher{constructor(t){super(),this.viewer=t,this.offsetX=100,this.offsetY=100,this.waitTime=50,this.oldTime=0;const{width:e,height:i}=t.getSize();this.size={width:e,height:i},this.selected=[],this.renderTarget=new be.WebGLRenderTarget(e,i),this.depthMaterial=new be.ShaderMaterial({vertexShader:"\nprecision highp float;\n\nuniform float far;\n\nvarying float depth;\n\nvoid main() {\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n\t\tdepth = gl_Position.z / far;\n}\n",fragmentShader:"\nprecision highp float;\n\nvarying float depth;\n\nvoid main() {\n\n\t\tfloat hex = abs(depth) * 16777215.0; \n\n\t\tfloat r = floor(hex / 65535.0);\n\t\tfloat g = floor((hex - r * 65535.0) / 255.0);\n\t\tfloat b = floor(hex - r * 65535.0 - g * 255.0);\n\t\tfloat a = sign(depth) >= 0.0 ? 1.0 : 0.0; \n\n\t\tgl_FragColor = vec4(r / 255.0, g / 255.0, b / 255.0, a);\n}\n",uniforms:{far:{value:t.camera.far}}}),this.pickedObject=null}pick(t,e){return this.enabled=!0,this.offsetX=t,this.offsetY=e,this.update(),this.enabled=!1,this.selected}update(){if(!this.enabled)return;let t=(new Date).getTime();if(t-this.oldTime<this.waitTime)return;this.oldTime=t;let{scene:e,renderer:i,camera:r}=this.viewer;const{width:n,height:s}=this.size,o=e.background,a=e.overrideMaterial,l=i.getRenderTarget();e.background=null,e.overrideMaterial=null,r.setViewOffset(n,s,this.offsetX,this.offsetY,1,1),i.setRenderTarget(this.renderTarget);let h=[];e.root.traverseVisible((t=>{t instanceof be.Mesh&&t.material&&h.push(t)}));for(let t=0;t<h.length;t++){const e=h[t];e.oldMaterial=e.material,e.pickMaterial?e.material=e.pickMaterial:(e.pickColor=t+1,e.material=e.pickMaterial=(c=e.pickColor,new be.ShaderMaterial({vertexShader:"\nvoid main() {\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 pickColor;\n\nvoid main() {\n\t\tgl_FragColor = vec4(pickColor, 1.0);\n}\n",uniforms:{pickColor:{value:new be.Color(c)}}})))}var c;i.clear(),i.render(e,r),r.clearViewOffset();var d=new Uint8Array(4);i.readRenderTargetPixels(this.renderTarget,0,0,1,1,d);const u=65535*d[0]+255*d[1]+d[2];let p=null;for(let t=0;t<h.length;t++){const e=h[t];e.oldMaterial&&(e.material=e.oldMaterial,delete e.oldMaterial)}p=h[u],e.overrideMaterial=this.depthMaterial,i.clear(),e.background=o,e.overrideMaterial=a,i.setRenderTarget(l),this.selected=p?[p]:[],this.enabled=!1}resize(t,e){this.renderTarget.setSize(t,e),this.size={width:t,height:e}}}const Ph="raycaster",Mh="gpu";class Ch extends be.EventDispatcher{constructor(t){super(),this.viewer=t,this._enabled=!0,this.mode=Ph,this.raycaster=new be.Raycaster,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(pe.IGNORE_RAYCAST),this.gpuPicker=new Eh(t),this.filter=null}get enabled(){return this._enabled}set enabled(t){this._enabled=!!t}get picker(){return this.mode===Mh?this.gpuPicker:this.raycaster}setSize(t,e){this.gpuPicker&&this.gpuPicker.resize(t,e)}update(t){}_filterIntersects(t,e){function i(t,e){return e=e||0,t.isThing?{node:t,level:e}:t.parent?i(t.parent,e+1):{node:t,level:e}}t=t.map((t=>{const e=t.object?t.object:t,{node:r,level:n}=i(e);return null!=r.selectLevel&&(r.selectLevel<0||r.selectLevel>=n)?e:r})).filter((t=>(!t.parent||t.parent.visible)&&!1!==t.visible&&"helper"!=t._thing_tag&&!0!==t.userData.isLocked&&!t.isGroup&&"GridHelper"!=t.type&&!t.isScene));let r=!1,n=[];for(let e=0;e<t.length;e++){const i=t[e];if(i&&i.isBillboard&&!1!==i.visible){r=!0,n.push(i);break}}return t=ot(t=r?n:t.slice(0,1),((t,e)=>t.uuid==e.uuid)).filter((t=>!1!==t.visible)),this.filter&&Z(this.filter)&&(t=t.filter(this.filter)),e&&Z(e)&&(t=t.filter(e)),t}getIntersects(t,e){const i={picked:[],raycasterPicked:[]};if(!t||!J(t.clientX)||!J(t.clientY))return i;const{camera:r,scene:n,container:s,sceneHelpers:o,renderer:a}=this.viewer,{x:l,y:h,offsetX:c,offsetY:d}=z(s,t)||{};if(void 0===l||void 0===h)return i;const u=this.raycaster,p=new be.Vector3;p.set(l,h,.5),u.setFromCamera(p,r);const{mode:m,picker:f}=this;(new be.Layers).set(pe.IGNORE_RAYCAST);let g=[],v=[];if("gpu"===m);else{var y=[];n.traverseVisible((function(t){t.isGroup||y.push(t)})),g=u.intersectObjects(y,!1);var w=[];o.traverseVisible((function(t){"picker"===t.name&&w.push(t)})),v=u.intersectObjects(w,!1)}return{picked:this._filterIntersects(g,e),raycasterPicked:g,raycasterSceneHelpersPicked:v}}pick(t,e,i){if(!this._enabled)return{picked:[],raycasterPicked:[]};const r=tt(t)||void 0===t.clientX?{clientX:t,clientY:e}:t;return this.getIntersects(r,i)}}var Lh="undefined"!=typeof window&&void 0!==window.document?window.document:{},Rh=function(){for(var t,e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],i=0,r=e.length,n={};i<r;i++)if((t=e[i])&&t[1]in Lh){for(i=0;i<t.length;i++)n[e[0][i]]=t[i];return n}return!1}(),Oh={change:Rh.fullscreenchange,error:Rh.fullscreenerror},Fh={request:function(t,e){return new Promise(function(i,r){var n=function(){this.off("change",n),i()}.bind(this);this.on("change",n);var s=(t=t||Lh.documentElement)[Rh.requestFullscreen](e);s instanceof Promise&&s.then(n).catch(r)}.bind(this))},exit:function(){return new Promise(function(t,e){if(this.isFullscreen){var i=function(){this.off("change",i),t()}.bind(this);this.on("change",i);var r=Lh[Rh.exitFullscreen]();r instanceof Promise&&r.then(i).catch(e)}else t()}.bind(this))},toggle:function(t,e){return this.isFullscreen?this.exit():this.request(t,e)},onchange:function(t){this.on("change",t)},onerror:function(t){this.on("error",t)},on:function(t,e){var i=Oh[t];i&&Lh.addEventListener(i,e,!1)},off:function(t,e){var i=Oh[t];i&&Lh.removeEventListener(i,e,!1)},raw:Rh};Object.defineProperties(Fh,{isFullscreen:{get:function(){return Boolean(Lh[Rh.fullscreenElement])}},element:{enumerable:!0,get:function(){return Lh[Rh.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(Lh[Rh.fullscreenEnabled])}}});var Nh={container:null,debugger:{enable:!1,showFPS:!1,showMilliseconds:!1,showMemory:!1},view:{center:[0,0,0],far:1e5,near:.05,position:[6.2791192837739676,4.285399942474187,5.194127521520281],fov:45,aspect:null,isOrtho:!1},interact:{enabled:!0,mouseButtonLeft:"rotate",mouseButtonRight:"pan",mouseButtonWheel:"dolly",mouseButtonMiddle:"pan",dollySpeed:.5,truckSpeed:2},popupsAvoid:!1,popupsAvoidPadding:10,attributions:null,backwardEnabled:!0,devicePixelRatio:window.devicePixelRatio||1,renderer:{forceRender:!0,fps:60,devicePixelRatio:window.devicePixelRatio||1,postEffect:et(Ah)}},Dh=window;function Ih(t,e,i){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){kh(r.response,e,i)},r.onerror=function(){console.error("could not download file")},r.send()}function Uh(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function Bh(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(i){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}const kh=Dh.saveAs||("object"!=typeof window||window!==Dh?function(){}:"download"in HTMLAnchorElement.prototype?function(t,e,i){var r=Dh.URL||Dh.webkitURL,n=document.createElement("a");e=e||t.name||"download",n.download=e,n.rel="noopener","string"==typeof t?(n.href=t,n.origin!==location.origin?Uh(n.href)?Ih(t,e,i):Bh(n,n.target="_blank"):Bh(n)):(n.href=r.createObjectURL(t),setTimeout((function(){r.revokeObjectURL(n.href)}),4e4),setTimeout((function(){Bh(n)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,e,i){if(e=e||t.name||"download","string"==typeof t)if(Uh(t))Ih(t,e,i);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout((function(){Bh(r)}))}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,i),e)}:function(t,e,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof t)return Ih(t,e,i);var n="application/octet-stream"===t.type,s=/constructor/i.test(Dh.HTMLElement)||Dh.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||n&&s)&&"object"==typeof FileReader){var a=new FileReader;a.onloadend=function(){var t=a.result;t=o?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=t:location=t,r=null},a.readAsDataURL(t)}else{var l=Dh.URL||Dh.webkitURL,h=l.createObjectURL(t);r?r.location=h:location.href=h,r=null,setTimeout((function(){l.revokeObjectURL(h)}),4e4)}});class jh{constructor(t){this.id=-1,this.inMemory=!1,this.updatable=!1,this.type="",this.name="",this.editor=t}toJSON(){const t={};return t.type=this.type,t.id=this.id,t.name=this.name,t}fromJSON(t){this.inMemory=!0,this.type=t.type,this.id=t.id,this.name=t.name}}const Vh=be.ObjectLoader;class zh extends jh{constructor(t,e){super(t),this.type="AddObjectCommand",this.object=e,void 0!==e&&(this.name=`Add Object: ${e.name}`)}execute(){this.editor.addObject(this.object),this.object.isGroup||this.editor.select(this.object)}undo(){this.editor.removeObject(this.object),this.editor.deselect()}toJSON(){const t=super.toJSON(this);return t.object=this.object.toJSON(),t}fromJSON(t){if(super.fromJSON(t),this.object=this.editor.objectByUuid(t.object.object.uuid),void 0===this.object){const e=new Vh;this.object=e.parse(t.object)}}}class Gh extends jh{constructor(t,e,i,r){super(t),this.type="MoveObjectCommand",this.name="Move Object",this.object=e,this.oldParent=void 0!==e?e.parent:void 0,this.oldIndex=void 0!==this.oldParent?this.oldParent.children.indexOf(this.object):void 0,this.newParent=i,this.newIndex=void 0!==r?void 0!==i?i.children.indexOf(r):void 0:void 0!==i?i.children.length:void 0,this.oldParent===this.newParent&&this.newIndex>this.oldIndex&&this.newIndex--,this.newBefore=r}execute(){this.oldParent.remove(this.object);this.newParent.children.splice(this.newIndex,0,this.object),this.object.parent=this.newParent,this.object.dispatchEvent({type:"added"}),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.newParent.remove(this.object);this.oldParent.children.splice(this.oldIndex,0,this.object),this.object.parent=this.oldParent,this.object.dispatchEvent({type:"added"}),this.editor.signals.sceneGraphChanged.dispatch()}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.newParentUuid=this.newParent.uuid,t.oldParentUuid=this.oldParent.uuid,t.newIndex=this.newIndex,t.oldIndex=this.oldIndex,t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.oldParent=this.editor.objectByUuid(t.oldParentUuid),void 0===this.oldParent&&(this.oldParent=this.editor.scene),this.newParent=this.editor.objectByUuid(t.newParentUuid),void 0===this.newParent&&(this.newParent=this.editor.scene),this.newIndex=t.newIndex,this.oldIndex=t.oldIndex}}class Hh extends Mo{constructor(t){super(pt({points:[],material:{}},t)),this.type="LineMesh",this.isLineMesh=!0,this.needPoints=!0,this.type="Line",this.vertices=[],this.updateVertices(this.option.points);const e=this.createGeometry(this.vertices);this.line=new be.Line(e,new be.LineBasicMaterial),this.add(this.line),this.updateBy(this.option)}get length(){if(this.vertices.length<2)return 0;let t=0,e=ti(this.vertices[0]);return this.vertices.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}getPoints(){return this.vertices.map((t=>t.toArray()))}updatePoints(t){this.updateVertices(t)}updateVertices(t){if(t&&0!==t.length){this.vertices=[];for(let e=0;e<t.length;e++){let i=t[e];i&&this.vertices.push(ti(i))}this.updateGeometry()}}createGeometry(t){return(new be.BufferGeometry).setFromPoints(t||[])}updateGeometry(){if(!this.line)return;this.line.geometry.dispose();const t=this.createGeometry(this.vertices);this.line.geometry=t}addPoint(t){t&&(this.vertices.push(ti(t)),this.updateGeometry())}setPoint(t,e){return!(void 0===t||!e||t>=this.vertices.length)&&(this.vertices[t]=ti(e),this.line.geometry.verticesNeedUpdate=!0,this.updateGeometry(),!0)}removePoint(t){t>=this.vertices.length||(this.vertices.splice(t,1),this.updateGeometry())}clear(){this.vertices=[],this.updateGeometry()}}const Xh=new be.Box3,Wh=new be.Vector3;class Yh extends be.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new be.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new be.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),i.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const i=new be.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new be.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new be.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const i=new be.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new be.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new be.InterleavedBufferAttribute(i,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new be.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new be.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),Xh.setFromBufferAttribute(e),this.boundingBox.union(Xh))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new be.Sphere),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let r=0;for(let n=0,s=t.count;n<s;n++)Wh.fromBufferAttribute(t,n),r=Math.max(r,i.distanceToSquared(Wh)),Wh.fromBufferAttribute(e,n),r=Math.max(r,i.distanceToSquared(Wh));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}Yh.prototype.isLineSegmentsGeometry=!0,be.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new be.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},be.ShaderLib.line={uniforms:be.UniformsUtils.merge([be.UniformsLib.common,be.UniformsLib.fog,be.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass\tendcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segements overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class Qh extends be.ShaderMaterial{constructor(t){super({type:"LineMaterial",uniforms:be.UniformsUtils.clone(be.ShaderLib.line.uniforms),vertexShader:be.ShaderLib.line.vertexShader,fragmentShader:be.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(t){Boolean(t)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("USE_ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===t?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}}Qh.prototype.isLineMaterial=!0;const Jh=new be.Vector3,Zh=new be.Vector3,qh=new be.Vector4,Kh=new be.Vector4,$h=new be.Vector4,tc=new be.Vector3,ec=new be.Matrix4,ic=new be.Line3,rc=new be.Vector3,nc=new be.Box3,sc=new be.Sphere,oc=new be.Vector4;function ac(t,e,i,r){return oc.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),oc.multiplyScalar(1/oc.w),oc.x=i/r.width,oc.y=i/r.height,oc.applyMatrix4(t.projectionMatrixInverse),oc.multiplyScalar(1/oc.w),Math.abs(Math.max(oc.x,oc.y))}class lc extends be.Mesh{constructor(t=new Yh,e=new Qh({color:16777215*Math.random()})){super(t,e),this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let t=0,n=0,s=e.count;t<s;t++,n+=2)Jh.fromBufferAttribute(e,t),Zh.fromBufferAttribute(i,t),r[n]=0===n?0:r[n-1],r[n+1]=r[n]+Jh.distanceTo(Zh);const n=new be.InstancedInterleavedBuffer(r,2,1);return t.setAttribute("instanceDistanceStart",new be.InterleavedBufferAttribute(n,1,0)),t.setAttribute("instanceDistanceEnd",new be.InterleavedBufferAttribute(n,1,1)),this}raycast(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');const i=void 0!==t.params.Line2&&t.params.Line2.threshold||0,r=t.ray,n=t.camera,s=n.projectionMatrix,o=this.matrixWorld,a=this.geometry,l=this.material,h=l.resolution,c=l.linewidth+i,d=a.attributes.instanceStart;if(!d)return null;const u=a.attributes.instanceEnd,p=-n.near;null===a.boundingSphere&&a.computeBoundingSphere(),sc.copy(a.boundingSphere).applyMatrix4(o);const m=ac(n,Math.max(n.near,sc.distanceToPoint(r.origin)),c,h);if(sc.radius+=m,!1===t.ray.intersectsSphere(sc))return;null===a.boundingBox&&a.computeBoundingBox(),nc.copy(a.boundingBox).applyMatrix4(o);const f=ac(n,Math.max(n.near,nc.distanceToPoint(r.origin)),c,h);if(nc.max.x+=f,nc.max.y+=f,nc.max.z+=f,nc.min.x-=f,nc.min.y-=f,nc.min.z-=f,!1!==t.ray.intersectsBox(nc)){r.at(1,$h),$h.w=1,$h.applyMatrix4(n.matrixWorldInverse),$h.applyMatrix4(s),$h.multiplyScalar(1/$h.w),$h.x*=h.x/2,$h.y*=h.y/2,$h.z=0,tc.copy($h),ec.multiplyMatrices(n.matrixWorldInverse,o);for(let t=0,i=d.count;t<i;t++){if(qh.fromBufferAttribute(d,t),Kh.fromBufferAttribute(u,t),qh.w=1,Kh.w=1,qh.applyMatrix4(ec),Kh.applyMatrix4(ec),qh.z>p&&Kh.z>p)continue;if(qh.z>p){const t=qh.z-Kh.z,e=(qh.z-p)/t;qh.lerp(Kh,e)}else if(Kh.z>p){const t=Kh.z-qh.z,e=(Kh.z-p)/t;Kh.lerp(qh,e)}qh.applyMatrix4(s),Kh.applyMatrix4(s),qh.multiplyScalar(1/qh.w),Kh.multiplyScalar(1/Kh.w),qh.x*=h.x/2,qh.y*=h.y/2,Kh.x*=h.x/2,Kh.y*=h.y/2,ic.start.copy(qh),ic.start.z=0,ic.end.copy(Kh),ic.end.z=0;const i=ic.closestPointToPointParameter(tc,!0);ic.at(i,rc);const n=be.MathUtils.lerp(qh.z,Kh.z,i),a=n>=-1&&n<=1,l=tc.distanceTo(rc)<.5*c;if(a&&l){ic.start.fromBufferAttribute(d,t),ic.end.fromBufferAttribute(u,t),ic.start.applyMatrix4(o),ic.end.applyMatrix4(o);const i=new be.Vector3,n=new be.Vector3;r.distanceSqToSegment(ic.start,ic.end,n,i),e.push({point:n,pointOnLine:i,distance:r.origin.distanceTo(n),object:this,face:null,faceIndex:t,uv:null,uv2:null})}}}}}lc.prototype.isLineSegments2=!0;class hc extends Yh{constructor(){super(),this.type="LineGeometry"}setPositions(t){for(var e=t.length-3,i=new Float32Array(2*e),r=0;r<e;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return super.setPositions(i),this}setColors(t){for(var e=t.length-3,i=new Float32Array(2*e),r=0;r<e;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return super.setColors(i),this}fromLine(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}}hc.prototype.isLineGeometry=!0;class cc extends Mo{constructor(t){super(pt({points:[],material:{linewidth:1,worldUnits:!1}},t)),this.type="Line2Mesh",this.isLine2Mesh=!0,this.needPoints=!0,this.vertices=[],this.mesh=new lc(new hc,new Qh),this.add(this.mesh),this.updateBy(this.option),this.addEventListener(te,(t=>{if(t.scene){const e=t.scene.viewer.getSize();this.mesh.material.resolution.set(e.width,e.height)}}))}get length(){if(this.vertices.length<2)return 0;let t=0,e=ti(this.vertices[0]);return this.vertices.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}getPoints(){return this.vertices.map((t=>t.toArray()))}updatePoints(t){if(t&&0!==t.length){this.vertices=[];for(let e=0;e<t.length;e++){let i=t[e]?ti(t[e]):null;i&&this.vertices.push(i)}this._updateGeometry()}}_updateGeometry(){let t=[];for(let e=0;e<this.vertices.length;e++){let i=this.vertices[e];t.push(i.x),t.push(i.y),t.push(i.z)}if(0==t.length)return;const e=new hc;e.setPositions(t),this.mesh.geometry.dispose(),this.mesh.geometry=e,this.mesh.computeLineDistances()}addPoint(t){t&&(this.vertices.push(ti(t)),this._updateGeometry())}setPoint(t,e){return!(void 0===t||!e||t>=this.vertices.length)&&(this.vertices[t]=ti(e),this._updateGeometry(),!0)}removePoint(t){t>=this.vertices.length||(this.vertices.splice(t,1),this._updateGeometry())}clear(){this.vertices=[],this._updateGeometry()}}cc.prototype.isLine2=!0;var dc=function(){this.pos=new be.Vector3,this.dir=new be.Vector3,this.right=new be.Vector3,this.up=new be.Vector3,this.dist=0,this.widthScale=1};dc.prototype.lerpPathPoints=function(t,e,i){this.pos.lerpVectors(t.pos,e.pos,i),this.dir.lerpVectors(t.dir,e.dir,i),this.up.lerpVectors(t.up,e.up,i),this.right.lerpVectors(t.right,e.right,i),this.dist=(e.dist-t.dist)*i+t.dist,this.widthScale=(e.widthScale-t.widthScale)*i+t.widthScale},dc.prototype.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale};const uc=new be.Vector3,pc=new be.Vector3,mc=new be.Vector3,fc=new be.Matrix4,gc=new be.QuadraticBezierCurve3;class vc{constructor(){this.array=[],this.count=0}set(t,e=.1,i=10,r=null,n=!1){if((t=t.slice(0)).length<2)this.count=0;else{n&&!t[0].equals(t[t.length-1])&&t.push((new be.Vector3).copy(t[0]));for(let s=0,o=t.length;s<o;s++)if(0===s)this._start(t[s],t[s+1],r);else if(s===o-1)if(n){this._corner(t[s],t[1],e,i,r);const n=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=n}else this._end(t[s]);else this._corner(t[s],t[s+1],e,i,r)}}distance(){return this.count>0?this.array[this.count-1].dist:0}_getByIndex(t){return this.array[t]||(this.array[t]=new dc),this.array[t]}_start(t,e,i){this.count=0;const r=this._getByIndex(this.count);if(r.pos.copy(t),r.dir.subVectors(e,t),i)r.up.copy(i);else{let t=Number.MAX_VALUE;const e=Math.abs(r.dir.x),i=Math.abs(r.dir.y),n=Math.abs(r.dir.z);e<t&&(t=e,r.up.set(1,0,0)),i<t&&(t=i,r.up.set(0,1,0)),n<t&&r.up.set(0,0,1)}r.right.crossVectors(r.dir,r.up).normalize(),r.up.crossVectors(r.right,r.dir).normalize(),r.dist=0,r.widthScale=1,r.sharp=!1,r.dir.normalize(),this.count++}_end(t){const e=this.array[this.count-1],i=this._getByIndex(this.count);i.pos.copy(t),i.dir.subVectors(t,e.pos);const r=i.dir.length();i.dir.normalize(),i.up.copy(e.up);const n=uc.crossVectors(e.dir,i.dir);if(n.length()>Number.EPSILON){n.normalize();const t=Math.acos(Math.min(Math.max(e.dir.dot(i.dir),-1),1));i.up.applyMatrix4(fc.makeRotationAxis(n,t))}i.right.crossVectors(i.dir,i.up).normalize(),i.dist=e.dist+r,i.widthScale=1,i.sharp=!1,this.count++}_corner(t,e,i,r,n){if(i>0&&r>0){const s=function(t,e,i,r,n,s){const o=uc.subVectors(e,t),a=pc.subVectors(i,e),l=o.length(),h=a.length();o.normalize(),a.normalize();const c=Math.min(.999999*(n?l/2:l),r);s.v0.copy(e).sub(o.multiplyScalar(c)),s.v1.copy(e);const d=Math.min(h/2*.999999,r);return s.v2.copy(e).add(a.multiplyScalar(d)),s}(this.array[this.count-1].pos,t,e,i,this.count-1==0,gc),o=s.getPoints(r);for(let t=0;t<r;t++)this._sharpCorner(o[t],o[t+1],n,0===t?1:0);o[r].equals(e)||this._sharpCorner(o[r],e,n,2)}else this._sharpCorner(t,e,n,0,!0)}_sharpCorner(t,e,i,r=0,n=!1){const s=this.array[this.count-1],o=this._getByIndex(this.count),a=uc.subVectors(t,s.pos),l=pc.subVectors(e,t),h=a.length();if(a.normalize(),l.normalize(),o.pos.copy(t),1===r?o.dir.copy(a):2===r?o.dir.copy(l):(o.dir.addVectors(a,l),o.dir.normalize()),i)1===o.dir.dot(i)?o.right.crossVectors(l,i).normalize():o.right.crossVectors(o.dir,i).normalize(),o.up.crossVectors(o.right,o.dir).normalize();else{o.up.copy(s.up);const t=mc.crossVectors(s.dir,o.dir);if(t.length()>Number.EPSILON){t.normalize();const e=Math.acos(Math.min(Math.max(s.dir.dot(o.dir),-1),1));o.up.applyMatrix4(fc.makeRotationAxis(t,e))}o.right.crossVectors(o.dir,o.up).normalize()}o.dist=s.dist+h;const c=a.dot(l);o.widthScale=Math.min(1/Math.sqrt((1+c)/2),1.415)||1,o.sharp=Math.abs(c-1)>.05&&n,this.count++}}var yc=function(){this._drawing=!1,this._includeDrawingPoint=!1,this._points=[],this._lastPoint=new be.Vector3,this._lastFixedPoint=new be.Vector3,this.fixRadius=.5,this.height=.1,this._cornerRadius=.2,this._cornerSplit=10,this._pathPointList=new vc,this._dirty=!0,this.up=new be.Vector3(0,1,0)};Object.defineProperty(yc.prototype,"cornerRadius",{set:function(t){this._cornerRadius=t,this._dirty=!0},get:function(){return this._cornerRadius}}),Object.defineProperty(yc.prototype,"cornerSplit",{set:function(t){this._cornerSplit=t,this._dirty=!0},get:function(){return this._cornerSplit}}),yc.prototype.getPoints=function(){if(this._includeDrawingPoint&&(this._points.pop(),this._includeDrawingPoint=!1),this._drawing&&this._points.length>0){var t=this._getLastFixedPoint();t&&(this._points.push(t),this._includeDrawingPoint=!0)}return this._points},yc.prototype.getPathPointList=function(){return(this._drawing||this._dirty)&&(this._pathPointList.set(this.getPoints(),this._cornerRadius,this._cornerSplit,this.up),this._dirty=!1),this._pathPointList},yc.prototype.update=function(t){this._lastPoint.copy(t),this._lastPoint.y+=this.height},yc.prototype.confirm=function(){this._drawing=!0;var t=this._getLastFixedPoint();t&&(this._includeDrawingPoint&&(this._points.pop(),this._includeDrawingPoint=!1),this._points.push(t.clone())),this._dirty=!0},yc.prototype.start=function(){this._drawing=!0,this._dirty=!0},yc.prototype.stop=function(){this._drawing=!1,this._dirty=!0},yc.prototype.clear=function(){this._drawing=!1,this._includeDrawingPoint=!1,this._points=[],this._dirty=!0};var wc=new be.Vector3;var xc=new be.Vector3,bc=new be.Vector3;yc.prototype._getLastFixedPoint=function(){if(this._lastFixedPoint.copy(this._lastPoint),this._points.length>0){var t=this._includeDrawingPoint?this._points[this._points.length-2]:this._points[this._points.length-1];if(function(t,e){return wc.copy(e).sub(t).length()}(t,this._lastFixedPoint)<this.fixRadius&&(wc.normalize().multiplyScalar(this.fixRadius),this._lastFixedPoint.copy(t).add(wc)),this._includeDrawingPoint?this._points.length>2:this._points.length>1){var e=this._includeDrawingPoint?this._points[this._points.length-3]:this._points[this._points.length-2];if(xc.subVectors(t,e),bc.subVectors(this._lastFixedPoint,t),xc.normalize(),bc.normalize(),xc.multiplyScalar(-1).dot(bc)>.99)return null}}return this._lastFixedPoint};class _c extends be.BufferGeometry{constructor(t=3e3,e=!1){super(),isNaN(t)?this._initByData(t.pathPointList,t.options,t.usage,e):this._initByMaxVertex(t,e)}_initByMaxVertex(t,e){this.setAttribute("position",new be.BufferAttribute(new Float32Array(3*t),3).setUsage(be.DynamicDrawUsage)),this.setAttribute("normal",new be.BufferAttribute(new Float32Array(3*t),3).setUsage(be.DynamicDrawUsage)),this.setAttribute("uv",new be.BufferAttribute(new Float32Array(2*t),2).setUsage(be.DynamicDrawUsage)),e&&this.setAttribute("uv2",new be.BufferAttribute(new Float32Array(2*t),2).setUsage(be.DynamicDrawUsage)),this.drawRange.start=0,this.drawRange.count=0,this.setIndex(t>65536?new be.Uint32BufferAttribute(3*t,1):new be.Uint16BufferAttribute(3*t,1))}_initByData(t,e={},i,r){const n=Ac(t,e,r);n&&0!==n.count?(this.setAttribute("position",new be.BufferAttribute(new Float32Array(n.position),3).setUsage(i||be.StaticDrawUsage)),this.setAttribute("normal",new be.BufferAttribute(new Float32Array(n.normal),3).setUsage(i||be.StaticDrawUsage)),this.setAttribute("uv",new be.BufferAttribute(new Float32Array(n.uv),2).setUsage(i||be.StaticDrawUsage)),r&&this.setAttribute("uv2",new be.BufferAttribute(new Float32Array(n.uv2),2).setUsage(i||be.StaticDrawUsage)),this.setIndex(n.position.length/3>65536?new be.Uint32BufferAttribute(n.indices,1):new be.Uint16BufferAttribute(n.indices,1))):this._initByMaxVertex(2,r)}update(t,e={}){const i=!!this.getAttribute("uv2"),r=Ac(t,e,i);r?(this._updateAttributes(r.position,r.normal,r.uv,i?r.uv2:null,r.indices),this.drawRange.count=r.count):this.drawRange.count=0}_resizeAttribute(t,e){let i=this.getAttribute(t);for(;i.array.length<e;){const e=i.array.length,r=new be.BufferAttribute(new Float32Array(2*e),i.itemSize,i.normalized);r.name=i.name,r.usage=i.usage,this.setAttribute(t,r),i=r}}_resizeIndex(t){let e=this.getIndex();for(;e.array.length<t;){const t=e.array.length,i=new be.BufferAttribute(2*t>65535?new Uint32Array(2*t):new Uint16Array(2*t),1);i.name=e.name,i.usage=e.usage,this.setIndex(i),e=i}}_updateAttributes(t,e,i,r,n){this._resizeAttribute("position",t.length);const s=this.getAttribute("position");s.array.set(t,0),s.updateRange.count=t.length,s.needsUpdate=!0,this._resizeAttribute("normal",e.length);const o=this.getAttribute("normal");o.array.set(e,0),o.updateRange.count=e.length,o.needsUpdate=!0,this._resizeAttribute("uv",i.length);const a=this.getAttribute("uv");if(a.array.set(i,0),a.updateRange.count=i.length,a.needsUpdate=!0,r){this._resizeAttribute("uv2",r.length);const t=this.getAttribute("uv2");t.array.set(r,0),t.updateRange.count=r.length,t.needsUpdate=!0}this._resizeIndex(n.length);const l=this.getIndex();l.set(n,0),l.updateRange.count=n.length,l.needsUpdate=!0}}function Ac(t,e,i=!1){const r=e.width||.1,n=void 0!==e.progress?e.progress:1,s=void 0===e.arrow||e.arrow,o=void 0!==e.side?e.side:"both",a=r/2,l="both"!==o?r/2:r,h=t.distance(),c=n*h;if(0==h)return null;const d=a/l,u=a/h;let p=0;const m=[],f=[],g=[],v=[],y=[];let w=0;const x=new be.Vector3,b=new be.Vector3,_=new be.Vector3,A=new be.Vector3,S=new be.Vector3,T=new be.Vector3;function E(t){const e=0===m.length,r=t.sharp&&!e,n=t.dist/l,s=t.dist/h,c=t.dir,E=t.up,P=t.right;if("left"!==o?x.copy(P).multiplyScalar(a*t.widthScale):x.set(0,0,0),"right"!==o?b.copy(P).multiplyScalar(-a*t.widthScale):b.set(0,0,0),x.add(t.pos),b.add(t.pos),r){_.fromArray(m,m.length-6).sub(b),A.fromArray(m,m.length-3).sub(x);const t=_.length()-A.length();let e,r;t>0?(e=_,r=b):(e=A,r=x),S.copy(e).setLength(Math.abs(t)).add(r);let o=T.copy(r).sub(S).normalize().dot(c)*T.copy(r).sub(S).length()*2;T.copy(c).setLength(o).add(S),t>0?(m.push(S.x,S.y,S.z,x.x,x.y,x.z,b.x,b.y,b.z,x.x,x.y,x.z,T.x,T.y,T.z,x.x,x.y,x.z),w+=6,y.push(w-6,w-8,w-7,w-6,w-7,w-5,w-4,w-6,w-5,w-2,w-4,w-1),p+=12):(m.push(b.x,b.y,b.z,S.x,S.y,S.z,b.x,b.y,b.z,x.x,x.y,x.z,b.x,b.y,b.z,T.x,T.y,T.z),w+=6,y.push(w-6,w-8,w-7,w-6,w-7,w-5,w-6,w-5,w-3,w-2,w-3,w-1),p+=12),f.push(E.x,E.y,E.z,E.x,E.y,E.z,E.x,E.y,E.z,E.x,E.y,E.z,E.x,E.y,E.z,E.x,E.y,E.z),g.push(n-d,0,n-d,1,n,0,n,1,n+d,0,n+d,1),i&&v.push(s-u,0,s-u,1,s,0,s,1,s+u,0,s+u,1)}else m.push(b.x,b.y,b.z,x.x,x.y,x.z),f.push(E.x,E.y,E.z,E.x,E.y,E.z),g.push(n,0,n,1),i&&v.push(s,0,s,1),w+=2,e||(y.push(w-2,w-4,w-3,w-2,w-3,w-1),p+=6)}const P=new be.Vector3;let M;if(c>0)for(let e=0;e<t.count;e++){const i=t.array[e];if(i.dist>c){const r=t.array[e-1];M=new dc;const n=(c-r.dist)/(i.dist-r.dist);M.lerpPathPoints(r,i,n),E(M);break}E(i)}else M=t.array[0];return s&&(M=M||t.array[t.count-1],function(t){const e=t.dir,n=t.up,s=t.right,c=t.dist/l,d=t.dist/h;"left"!==o?x.copy(s).multiplyScalar(2*a):x.set(0,0,0),"right"!==o?b.copy(s).multiplyScalar(2*-a):b.set(0,0,0),P.copy(e).setLength(3*a),x.add(t.pos),b.add(t.pos),P.add(t.pos),m.push(b.x,b.y,b.z,x.x,x.y,x.z,P.x,P.y,P.z),f.push(n.x,n.y,n.z,n.x,n.y,n.z,n.x,n.y,n.z),g.push(c,"both"!==o?"right"!==o?-2:0:-.5,c,"both"!==o?"left"!==o?2:0:1.5,c+1.5,"both"!==o?0:.5),i&&v.push(d,"both"!==o?"right"!==o?-2:0:-.5,d,"both"!==o?"left"!==o?2:0:1.5,d+1.5*r/h,"both"!==o?0:.5),w+=3,y.push(w-1,w-3,w-2),p+=3}(M)),{position:m,normal:f,uv:g,uv2:v,indices:y,count:p}}class Sc extends _c{constructor(t=1e3,e=!1){super(t,e)}_initByData(t,e={},i,r){const n=Tc(t,e,r);n&&0!==n.count?(this.setAttribute("position",new be.BufferAttribute(new Float32Array(n.position),3).setUsage(i||be.StaticDrawUsage)),this.setAttribute("normal",new be.BufferAttribute(new Float32Array(n.normal),3).setUsage(i||be.StaticDrawUsage)),this.setAttribute("uv",new be.BufferAttribute(new Float32Array(n.uv),2).setUsage(i||be.StaticDrawUsage)),r&&this.setAttribute("uv2",new be.BufferAttribute(new Float32Array(n.uv2),2).setUsage(i||be.StaticDrawUsage)),this.setIndex(n.position.length/3>65536?new be.Uint32BufferAttribute(n.indices,1):new be.Uint16BufferAttribute(n.indices,1))):this._initByMaxVertex(2,r)}update(t,e={}){const i=!!this.getAttribute("uv2"),r=Tc(t,e,i);r?(this._updateAttributes(r.position,r.normal,r.uv,i?r.uv2:null,r.indices),this.drawRange.count=r.count):this.drawRange.count=0}}function Tc(t,e,i=!1){const r=e.radius||.1,n=void 0!==e.progress?e.progress:1,s=Math.max(2,e.radialSegments||8),o=e.startRad||0,a=2*r*Math.PI,l=t.distance(),h=n*l;if(0==h)return null;let c=0;const d=[],u=[],p=[],m=[],f=[];let g=0;const v=new be.Vector3;function y(t,e,r){const n=0===d.length,s=t.dist/a,h=t.dist/l;for(let n=0;n<=r;n++){let a=n;a==r&&(a=0),v.copy(t.up).applyAxisAngle(t.dir,o+2*Math.PI*a/r).normalize(),d.push(t.pos.x+v.x*e*t.widthScale,t.pos.y+v.y*e*t.widthScale,t.pos.z+v.z*e*t.widthScale),u.push(v.x,v.y,v.z),p.push(s,n/r),i&&m.push(h,n/r),g++}if(!n){const t=g-2*(r+1),e=g-(r+1);for(let i=0;i<r;i++)f.push(e+i,t+i,t+i+1,e+i,t+i+1,e+i+1),c+=6}}if(h>0)for(let e=0;e<t.count;e++){const i=t.array[e];if(i.dist>h){const n=t.array[e-1],o=new dc,a=(h-n.dist)/(i.dist-n.dist);o.lerpPathPoints(n,i,a),y(o,r,s);break}y(i,r,s)}return{position:d,normal:u,uv:p,uv2:m,indices:f,count:c}}class Ec{constructor(t,e){if(this.data=t||[],this.length=this.data.length,this.compare=e||Pc,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,s=e[n];if(i(r,s)>=0)break;e[t]=s,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1),s=e[r];const o=r+1;if(o<this.length&&i(e[o],s)<0&&(r=o,s=e[o]),i(s,n)>=0)break;e[t]=s,t=r}e[t]=n}}function Pc(t,e){return t<e?-1:t>e?1:0}function Mc(t,e,i){var r,n,s,o;e=e||1;for(var a=0;a<t[0].length;a++){var l=t[0][a];(!a||l[0]<r)&&(r=l[0]),(!a||l[1]<n)&&(n=l[1]),(!a||l[0]>s)&&(s=l[0]),(!a||l[1]>o)&&(o=l[1])}var h=s-r,c=o-n,d=Math.min(h,c),u=d/2,p=new Ec(null,Cc);if(0===d)return[r,n];for(var m=r;m<s;m+=d)for(var f=n;f<o;f+=d)p.push(new Lc(m+u,f+u,u,t));var g=function(t){for(var e=0,i=0,r=0,n=t[0],s=0,o=n.length,a=o-1;s<o;a=s++){var l=n[s],h=n[a],c=l[0]*h[1]-h[0]*l[1];i+=(l[0]+h[0])*c,r+=(l[1]+h[1])*c,e+=3*c}return 0===e?new Lc(n[0][0],n[0][1],0,t):new Lc(i/e,r/e,0,t)}(t),v=new Lc(r+h/2,n+c/2,0,t);v.d>g.d&&(g=v);for(var y=p.length;p.length;){var w=p.pop();w.d>g.d&&(g=w,i&&console.log("found best %d after %d probes",Math.round(1e4*w.d)/1e4,y)),w.max-g.d<=e||(u=w.h/2,p.push(new Lc(w.x-u,w.y-u,u,t)),p.push(new Lc(w.x+u,w.y-u,u,t)),p.push(new Lc(w.x-u,w.y+u,u,t)),p.push(new Lc(w.x+u,w.y+u,u,t)),y+=4)}return i&&(console.log("num probes: "+y),console.log("best distance: "+g.d)),[g.x,g.y]}function Cc(t,e){return e.max-t.max}function Lc(t,e,i,r){this.x=t,this.y=e,this.h=i,this.d=function(t,e,i){for(var r=!1,n=1/0,s=0;s<i.length;s++)for(var o=i[s],a=0,l=o.length,h=l-1;a<l;h=a++){var c=o[a],d=o[h];c[1]>e!=d[1]>e&&t<(d[0]-c[0])*(e-c[1])/(d[1]-c[1])+c[0]&&(r=!r),n=Math.min(n,Rc(t,e,c,d))}return(r?1:-1)*Math.sqrt(n)}(t,e,r),this.max=this.d+this.h*Math.SQRT2}function Rc(t,e,i,r){var n=i[0],s=i[1],o=r[0]-n,a=r[1]-s;if(0!==o||0!==a){var l=((t-n)*o+(e-s)*a)/(o*o+a*a);l>1?(n=r[0],s=r[1]):l>0&&(n+=o*l,s+=a*l)}return(o=t-n)*o+(a=e-s)*a}class Oc extends Mo{constructor(t){super(pt({points:[],geometry:{width:.1},material:{}},t)),this.isPointsBase=!0,this._points=[],this._pointNodes=[],this._activePlane="",this.internalUserData={},this._editPointNode=new be.Group,this.add(this._editPointNode)}_updateByPoints(){}_createPolygonVertices(t){for(var e=[],i=0;i<this._points.length;i++){(o=this._points[i].clone()).y=o.z,o.z=0,e.push(o)}be.ShapeUtils.isClockWise(e)||(e=e.reverse());var r=[],n=be.ShapeUtils.triangulateShape(e,[]);for(i=0;i<n.length;i++)r.push(new be.Face3(n[i][0],n[i][1],n[i][2]));var s=new be.Matrix4;if(this.updateMatrixWorld(),s.copy(this.matrixWorld).invert(),!t)for(i=0;i<e.length;i++){var o=e[i];t||(o.z=o.y,o.y=0),o.applyMatrix4(s)}return{vertices:e,faces:r}}_createPolygonGeometry(t,e){var i=new be.Geometry;return i.vertices=t,i.faces=e,hi(i),i}clearPathPoints(){this._points=[],this._updateByPoints()}insertPoint(t,e){if(!e)return;const i=ti(e);this._points.splice(t,0,i),this.insertPathNode(t,i),this._updateByPoints()}setPoint(t,e){if(!e)return;if(t>=this._points.length)return!1;if(!e)return!1;const i=ti(e);return this._points[t]=i,this._updateByPoints(),!0}getPoint(t){return t>=this._points.length?null:this._points[t].toArray()}addPoint(t){if(!t)return-1;const e=ti(t);return this._points.push(e),this._updateByPoints(),this._points.length-1}addPoints(t){if(t&&W(t)){for(var e=0;e<t.length;e++){var i=ti(t[e]);this._points.push(i)}this._updateByPoints()}}removePoint(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._points.splice(t,e),this._updateByPoints()}_createPathNode(t){if(!this.internalUserData.editable)return null;const{width:e,depth:i,height:r}=this.option.geometry;var n=new be.MeshStandardMaterial,s=new be.BoxGeometry(e,i,r),o=new be.Mesh(s,n);return o.updateBy({material:this.option.material}),o.userData={pos:t,subNode:!0,isNode:!0,id:this.id,activePlane:this._activePlane},o.position.copy(t),this._editPointNode.add(o),o}createPathNode(t){var e=this._createPathNode(t);return e?(this._pointNodes.push(e),e):null}insertPathNode(t,e){var i=this._createPathNode(e);return i?(this._pointNodes.splice(t,0,i),i):null}removePathNode(t,e,i){for(var r=Math.min(this._pointNodes.length-t,e),n=t+r,s=t;s<n;s++){var o=this._pointNodes[s];o.parent&&o.parent.remove(o)}this._pointNodes.splice(t,r)}synPathNodes(){if(this.internalUserData.editable){for(var t=!1,e=0;e<this._pointNodes.length;e++){var i=this._pointNodes[e],r=i.userData;if(i.parent!=this._editPointNode){var n=new be.Vector3;i.getWorldPosition(n),this._editPointNode.worldToLocal(n);var s=r.pos;s&&!n.equals(s)&&(s.copy(n),t=!0)}}t&&this._updateByPoints()}else this._pointNodes=[]}getSubNodeIndex(t){for(var e=0;e<this._pointNodes.length;e++){if(this._pointNodes[e]==t)return e}return-1}getSubNodesNumber(){return this._pointNodes.length}removeSubNodeByIndex(t){var e=this._pointNodes[t];return this._points.splice(t,1),this.removePathNode(t,1,!0),this._updateByPoints(),e}insertSubNode(t,e){if(e){this._pointNodes.splice(t,0,e),this._editPointNode.insert(t,e);var i=e.position.clone();this._points.splice(t,0,i),e.userData.pos=i,this._updateByPoints()}}createSubNode(t){var e=0===t?this._points.length-1:t-1,i=t===this._points.length?0:t,r=this._points[e],n=this._points[i],s=new be.Vector3((r.x+n.x)/2,(r.y+n.y)/2,(r.z+n.z)/2);this.insertPoint(t,s),this.synPathNodes()}inside(t){for(var e=this.planePoints,i=t[0],r=t[1],n=!1,s=0,o=e.length,a=o-1;s<o;a=s,s++){var l=e[s][0],h=e[s][1],c=e[a][0],d=e[a][1];if((l===i&&h===r||c===i&&d===r)&&(n=!n),h<r&&d>=r||h>=r&&d<r){var u=l+(r-h)*(c-l)/(d-h);u===i&&(n=!n),u>i&&(n=!n)}}return!!n}destroy(){this.removePathNode(0,this._pointNodes.length),Node.prototype.destroy.call(this)}update(t){this.synPathNodes()}isRunning(){return!!this.internalUserData.editable}getPoints(){return this._points.map((t=>t.toArray()))}toJSON(t){const e=super.toJSON();return e.config.points=this.getPoints(),e.config.src=this.option.src,e.config.type=this.option.type,e}}function Fc(t){let e,i,r,n=0;for(let s=0;s<t.length;++s){const o=t[s];if(o.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===e&&(e=o.array.constructor),e!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===i&&(i=o.itemSize),i!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.normalized must be consistent across matching attributes."),null;n+=o.array.length}const s=new e(n);let o=0;for(let e=0;e<t.length;++e)s.set(t[e].array,o),o+=t[e].array.length;return new THREE.BufferAttribute(s,i,r)}Mt(Oc,[{key:"pointNodeColor",set:function(t){this._pointNodeColor=t;for(var e=0;e<this._pointNodes.length;e++){this._pointNodes[e].material.color=this._pointNodeColor}},get:function(){return this._pointNodeColor}},{key:"showDetail",set:function(t){this._editPointNode.visible=t}},{key:"editPointNode",get:function(){return this._editPointNode}},{key:"subNodeRoot",get:function(){return this._editPointNode}},{key:"points",get:function(){for(var t=[],e=0;e<this._points.length;e++)t.push(this._points[e].toArray());return t}},{key:"planePoints",get:function(){for(var t=[],e=0;e<this._points.length;e++){var i=this._points[e];t.push([i.x,i.z])}return t}},{key:"area",get:function(){for(var t=[],e=0;e<this._points.length;e++){var i=this._points[e];t.push(new be.Vector2(i.x,i.z))}var r=be.ShapeUtils.area(t);return Math.abs(r)}},{key:"centerPos",get:function(){return new Mc([this.planePoints])}},{key:"avgHeight",get:function(){if(!this._points.length)return 0;for(var t=0,e=0;e<this._points.length;e++){t+=this._points[e].y}return t/this._points.length}}]);const Nc={computeMorphedAttributes:function(t){if(!0!==t.geometry.isBufferGeometry)return console.error("THREE.BufferGeometryUtils: Geometry is not of type THREE.BufferGeometry."),null;const e=new THREE.Vector3,i=new THREE.Vector3,r=new THREE.Vector3,n=new THREE.Vector3,s=new THREE.Vector3,o=new THREE.Vector3,a=new THREE.Vector3,l=new THREE.Vector3,h=new THREE.Vector3;function c(t,c,d,u,p,m,f,g,v){e.fromBufferAttribute(d,m),i.fromBufferAttribute(d,f),r.fromBufferAttribute(d,g);const y=t.morphTargetInfluences;if(c.morphTargets&&u&&y){a.set(0,0,0),l.set(0,0,0),h.set(0,0,0);for(let t=0,c=u.length;t<c;t++){const c=y[t],d=u[t];0!==c&&(n.fromBufferAttribute(d,m),s.fromBufferAttribute(d,f),o.fromBufferAttribute(d,g),p?(a.addScaledVector(n,c),l.addScaledVector(s,c),h.addScaledVector(o,c)):(a.addScaledVector(n.sub(e),c),l.addScaledVector(s.sub(i),c),h.addScaledVector(o.sub(r),c)))}e.add(a),i.add(l),r.add(h)}t.isSkinnedMesh&&(t.boneTransform(m,e),t.boneTransform(f,i),t.boneTransform(g,r)),v[3*m+0]=e.x,v[3*m+1]=e.y,v[3*m+2]=e.z,v[3*f+0]=i.x,v[3*f+1]=i.y,v[3*f+2]=i.z,v[3*g+0]=r.x,v[3*g+1]=r.y,v[3*g+2]=r.z}const d=t.geometry,u=t.material;let p,m,f;const g=d.index,v=d.attributes.position,y=d.morphAttributes.position,w=d.morphTargetsRelative,x=d.attributes.normal,b=d.morphAttributes.position,_=d.groups,A=d.drawRange;let S,T,E,P,M,C,L,R;const O=new Float32Array(v.count*v.itemSize),F=new Float32Array(x.count*x.itemSize);if(null!==g)if(Array.isArray(u))for(S=0,E=_.length;S<E;S++)for(M=_[S],C=u[M.materialIndex],L=Math.max(M.start,A.start),R=Math.min(M.start+M.count,A.start+A.count),T=L,P=R;T<P;T+=3)p=g.getX(T),m=g.getX(T+1),f=g.getX(T+2),c(t,C,v,y,w,p,m,f,O),c(t,C,x,b,w,p,m,f,F);else for(L=Math.max(0,A.start),R=Math.min(g.count,A.start+A.count),S=L,E=R;S<E;S+=3)p=g.getX(S),m=g.getX(S+1),f=g.getX(S+2),c(t,u,v,y,w,p,m,f,O),c(t,u,x,b,w,p,m,f,F);else if(void 0!==v)if(Array.isArray(u))for(S=0,E=_.length;S<E;S++)for(M=_[S],C=u[M.materialIndex],L=Math.max(M.start,A.start),R=Math.min(M.start+M.count,A.start+A.count),T=L,P=R;T<P;T+=3)p=T,m=T+1,f=T+2,c(t,C,v,y,w,p,m,f,O),c(t,C,x,b,w,p,m,f,F);else for(L=Math.max(0,A.start),R=Math.min(v.count,A.start+A.count),S=L,E=R;S<E;S+=3)p=S,m=S+1,f=S+2,c(t,u,v,y,w,p,m,f,O),c(t,u,x,b,w,p,m,f,F);return{positionAttribute:v,normalAttribute:x,morphedPositionAttribute:new THREE.Float32BufferAttribute(O,3),morphedNormalAttribute:new THREE.Float32BufferAttribute(F,3)}},computeTangents:function(t){t.computeTangents(),console.warn("THREE.BufferGeometryUtils: .computeTangents() has been removed. Use THREE.BufferGeometry.computeTangents() instead.")},estimateBytesUsed:function(t){let e=0;for(const i in t.attributes){const r=t.getAttribute(i);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const i=t.getIndex();return e+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,i=0,r=0;for(let n=0,s=t.length;n<s;++n){const s=t[n];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;i+=s.array.length,r+=s.itemSize}const n=new THREE.InterleavedBuffer(new e(i),r);let s=0;const o=[],a=["getX","getY","getZ","getW"],l=["setX","setY","setZ","setW"];for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.itemSize,h=i.count,c=new THREE.InterleavedBufferAttribute(n,r,s,i.normalized);o.push(c),s+=r;for(let t=0;t<h;t++)for(let e=0;e<r;e++)c[l[e]](t,i[a[e]](t))}return o},mergeBufferAttributes:Fc,mergeBufferGeometries:function(t,e=!1){const i=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),n=new Set(Object.keys(t[0].morphAttributes)),s={},o={},a=t[0].morphTargetsRelative,l=new THREE.BufferGeometry;let h=0;for(let c=0;c<t.length;++c){const d=t[c];let u=0;if(i!==(null!==d.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in d.attributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===s[t]&&(s[t]=[]),s[t].push(d.attributes[t]),u++}if(u!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(a!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in d.morphAttributes){if(!n.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+c+".\t.morphAttributes must be consistent throughout all geometries."),null;void 0===o[t]&&(o[t]=[]),o[t].push(d.morphAttributes[t])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(d.userData),e){let t;if(i)t=d.index.count;else{if(void 0===d.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;t=d.attributes.position.count}l.addGroup(h,t,c),h+=t}}if(i){let e=0;const i=[];for(let r=0;r<t.length;++r){const n=t[r].index;for(let t=0;t<n.count;++t)i.push(n.getX(t)+e);e+=t[r].attributes.position.count}l.setIndex(i)}for(const t in s){const e=Fc(s[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+t+" attribute."),null;l.setAttribute(t,e)}for(const t in o){const e=o[t][0].length;if(0===e)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[t]=[];for(let i=0;i<e;++i){const e=[];for(let r=0;r<o[t].length;++r)e.push(o[t][r][i]);const r=Fc(e);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+t+" morphAttribute."),null;l.morphAttributes[t].push(r)}}return l},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const i={},r=t.getIndex(),n=t.getAttribute("position"),s=r?r.count:n.count;let o=0;const a=Object.keys(t.attributes),l={},h={},c=[],d=["getX","getY","getZ","getW"];for(let e=0,i=a.length;e<i;e++){const i=a[e];l[i]=[];const r=t.morphAttributes[i];r&&(h[i]=new Array(r.length).fill().map((()=>[])))}const u=Math.log10(1/e),p=Math.pow(10,u);for(let e=0;e<s;e++){const n=r?r.getX(e):e;let s="";for(let e=0,i=a.length;e<i;e++){const i=a[e],r=t.getAttribute(i),o=r.itemSize;for(let t=0;t<o;t++)s+=~~(r[d[t]](n)*p)+","}if(s in i)c.push(i[s]);else{for(let e=0,i=a.length;e<i;e++){const i=a[e],r=t.getAttribute(i),s=t.morphAttributes[i],o=r.itemSize,c=l[i],u=h[i];for(let t=0;t<o;t++){const e=d[t];if(c.push(r[e](n)),s)for(let t=0,i=s.length;t<i;t++)u[t].push(s[t][e](n))}}i[s]=o,c.push(o),o++}}const m=t.clone();for(let e=0,i=a.length;e<i;e++){const i=a[e],r=t.getAttribute(i),n=new r.array.constructor(l[i]),s=new THREE.BufferAttribute(n,r.itemSize,r.normalized);if(m.setAttribute(i,s),i in h)for(let e=0;e<h[i].length;e++){const r=t.morphAttributes[i][e],n=new r.array.constructor(h[i][e]),s=new THREE.BufferAttribute(n,r.itemSize,r.normalized);m.morphAttributes[i][e]=s}}return m.setIndex(c),m},toTrianglesDrawMode:function(t,e){if(e===THREE.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===THREE.TriangleFanDrawMode||e===THREE.TriangleStripDrawMode){let i=t.getIndex();if(null===i){const e=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),i=t.getIndex()}const r=i.count-2,n=[];if(e===THREE.TriangleFanDrawMode)for(let t=1;t<=r;t++)n.push(i.getX(0)),n.push(i.getX(t)),n.push(i.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(n.push(i.getX(t)),n.push(i.getX(t+1)),n.push(i.getX(t+2))):(n.push(i.getX(t+2)),n.push(i.getX(t+1)),n.push(i.getX(t)));n.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=t.clone();return s.setIndex(n),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t},setPoint:function(t,e,i){var r=t.attributes;if(r){var n=r.position;if(e==n.count)return e*=n.itemSize,n.array[e+0]=i.x,n.array[e+1]=i.y,void(n.array[e+2]=i.z);if(e<n.count)for(var s=0;s<n.count;s++)if(s==e){n.setXYZ(s,i.x,i.y,i.z);break}}else{var o=t.vertices;o&&(o[e]=i)}},addPoint:function(t,e){var i=t.attributes;if(i){var r=i.position;let t=r.count;return r.array[t+0]=e.x,r.array[t+1]=e.y,void(r.array[t+2]=e.z)}t.vertices&&t.vertices.push(e)},getPoint:function(t,e){if(!t.geometry)return null;const i=t.geometry;var r=i.attributes;if(r){for(var n=r.position,s=0;s<n.count;s++)if(e==s)return ti([n.getX(s),n.getY(s),n.getZ(s)])}else{var o=i.vertices;if(o)for(s=0;s<o.length;s++)if(e==s){var a=o[s].clone();return a.applyMatrix4(t.matrixWorld),a.toArray()}}return null},getVerticesLength:function(t){var e=t.attributes;return e?e.position.count:t.vertices?t.vertices.length:0}};class Dc extends Oc{constructor(t){super(pt({points:[],material:{side:2},geometry:{arrow:!1,side:"both",width:.1,cornerRadius:.1,cornerSplit:10}},t)),this.isLineBase=!0,this.pathGeometry=null,this.pathTexture=null,this.playingSpeed=1,this.playingProgress=0,this.isPlaying=!1,this.playingCompleteCallback=null,this.pathPointList=new vc,this.createLine()}createLine(){if(!this.pathGeometry)return;const t=this.option.points;if(t&&t.length>0&&this.addPoints(t),Nc.toTrianglesDrawMode(this.pathGeometry,be.TriangleStripDrawMode),!this.line){var e=new be.Mesh(this.pathGeometry,new be.MeshStandardMaterial);e.updateBy({material:this.option.material}),this.line=e,this.add(e)}this.updateGeometry()}_updateByPoints(){this.updateGeometry()}updateGeometry(t){pt(this.option.geometry,t);const e=this.option.geometry;if(this.pathPointList.set(this._points,e.cornerRadius,e.cornerSplit,this.pathUp),this.line&&this.line.geometry){this.line.geometry.dispose();var i=new _c;Nc.toTrianglesDrawMode(i,be.TriangleStripDrawMode),i.update(this.pathPointList,{width:e.width,arrow:e.arrow,side:e.side}),i.computeBoundingSphere(),this.line.geometry=i}}updatePath(){if(!this.isPlaying)return;const{pathGeometry:t,pathPointList:e}=this,{scrollUv:i,scrollSpeed:r,width:n,arrow:s,side:o}=this.option.geometry;var a=e.distance();let l=!1;a>0?(this.playingProgress+=this.playingSpeed/a,this.playingProgress>=1&&(this.playingProgress=1,l=!0)):l=!0,t.update(e,{width:n,arrow:s,side:o,progress:this.playingProgress}),l&&(this.playingCompleteCallback&&this.playingCompleteCallback(this),this.isPlaying=!1)}update(){this.updatePath()}isRunning(){return this.isPlaying}play(t,e){this.playingSpeed=t||this.playingSpeed,this.playingProgress=0,this.isPlaying=!0,this.playingCompleteCallback=e}stop(){this.playingSpeed=1,this.playingProgress=1,this.isPlaying=!1,this.playingCompleteCallback=null}get points(){return this._points.map((t=>t.toArray()))}set points(t){this.updatePoints(t)}}class Ic extends Dc{constructor(t){super(pt({points:[],geometry:{width:.1,cornerRadius:.1,cornerSplit:10,arrow:!1},material:{worldUnits:!0}},t)),this.isRouteLine=!0,this.type="RouteLine",this.needPoints=!0,this.pathGeometry=new _c,this.createLine()}get length(){if(this._points.length<2)return 0;let t=0,e=ti(this._points[0]);return this._points.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}updatePoints(t){this._points=t.map((t=>ti(t))),this._updateByPoints()}createGeometry(t){const e=this.option.geometry;this.pathPointList.set(t,e.cornerRadius,e.cornerSplit,this.pathUp);var i=new _c;return Nc.toTrianglesDrawMode(i,be.TriangleStripDrawMode),i.update(this.pathPointList,{width:e.width,arrow:e.arrow,side:e.side}),i.computeBoundingSphere(),i}}class Uc extends Dc{constructor(t){super(pt({points:[],geometry:{radius:.5,radialSegments:20,startRad:0,cornerRadius:.5}},t)),this.isTubeLine=!0,this.type="TubeLine",this.needPoints=!0,this.pathGeometry=new Sc,this.createLine()}get length(){if(this._points.length<2)return 0;let t=0,e=ti(this._points[0]);return this._points.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}createGeometry(t){const e=this.option.geometry;this.pathPointList.set(t,e.cornerRadius,e.cornerSplit,this.pathUp);var i=new Sc;return Nc.toTrianglesDrawMode(i,be.TriangleStripDrawMode),i.update(this.pathPointList,{radius:e.radius,radialSegments:e.radialSegments,startRad:e.startRad}),i.computeBoundingSphere(),i}updatePoints(t){if(t&&0!==t.length){this._points=[];for(let e=0;e<t.length;e++){let i=t[e]?ti(t[e]):null;i&&this._points.push(i)}this.updateGeometry()}}updateGeometry(t){pt(this.option.geometry,t),this.line&&this.line.geometry&&(this.line.geometry.dispose(),this.line.geometry=this.createGeometry(this._points))}}class Bc extends Mo{constructor(t){super(pt({geometry:{startPosition:null,endPosition:null,heightRatio:1,pointNumber:50,flipY:!1},line:{material:{color:"#FF9900",linewidth:1,opacity:1,transparent:!0,dashed:!1,dashOffset:void 0,dashScale:1,dashSize:.2,gapSize:.2,worldUnits:!1}},arrow:{visible:!1,length:.1,headLength:.2,headWidth:.3,material:{color:"#FF9900"}}},t||{})),this.isCurveLine=!0,this.type="CurveLine",this.needPoints=!0,this.curve=null,this._points=[],this.lineMesh=new cc(new hc,new Qh),this.updateGeometry(this.option.geometry),this.updateLine({material:this.option.line.material}),this.add(this.lineMesh),this.arrowHelper=new be.ArrowHelper,this.updateArrow(this.option.arrow),this.add(this.arrowHelper)}updateArrow(t){pt(this.option.arrow,t);const{visible:e,length:i,headLength:r,headWidth:n,material:s}=t;this.arrowHelper&&(Lt(e)&&(this.arrowHelper.visible=!!e),this.arrowHelper.setLength(i,r,n),s&&this.arrowHelper.updateBy({material:s})),this._updateArrowStatus()}updateLine(t){pt(this.option.line,t);const{material:e}=t;e&&this.lineMesh.updateBy({material:e})}updateGeometry(t){pt(this.option.geometry,t);const e=this.createGeometry(t);e&&(this.lineMesh.mesh.geometry=e,this.lineMesh.mesh.geometry&&this.lineMesh.mesh.computeLineDistances()),this._updateArrowStatus()}createGeometry(t){return t.startPosition&&(this._startPosition=t.startPosition?ti(t.startPosition):null),t.endPosition&&(this._endPosition=t.endPosition?ti(t.endPosition):null),this._startPosition&&this._endPosition?(this.curve=new be.QuadraticBezierCurve3(new be.Vector3(this._startPosition.x,this._startPosition.y,this._startPosition.z),ti(this.centerPoint),new be.Vector3(this._endPosition.x,this._endPosition.y,this._endPosition.z)),this._points=this.getCurvePoints(0,0,!0),this._createGeometry(this._points)):null}_createGeometry(t){let e=[];for(let i=0;i<t.length;i++){const{x:r,y:n,z:s}=t[i];e.push(r,n,s)}const i=new hc;return i.setPositions(e),i}getCurvePoints(t,e,i){if(!this.curve)return[];t=t||0;const{pointNumber:r}=this.option.geometry,n=this.curve.getPoints(be.Math.clamp(r,3,1e3));if(e=e||r,i)return n.slice(t,e);const s=[];for(let i=t;i<e;i++)s.push(n[i].toArray());return s}_play(t){if(!this.playing)return;var e=(t=t||{}).duration||1e3,i=t.complete;const{pointNumber:r}=this.option.geometry,n={step:this._points.length},s={step:r},o=this;this.playTween=new Wt.Tween(n).to(s,e).easing(Wt.Easing.Linear.None).onUpdate((function(t){o.playing&&(o._points=o.getCurvePoints(0,Math.round(this._object.step),!0),o.lineMesh.mesh.geometry=o._createGeometry(o._points),o.lineMesh.mesh.computeLineDistances(),o._updateArrowStatus())})).onComplete((function(){i&&i()})).start()}play(t){this.playing=!0,this._points=[],this._play(t)}stop(){this.playing=!1,this.playTween=null}_updateArrowStatus(){const t=this._points.length;if(t<3)return;const e=this._points[t-2].clone();let i=this._points[t-1].clone();const r=new be.Vector3;r.subVectors(i,e),r.normalize();const n=this.arrowHelper;n&&(n.position.copy(i),n.setDirection(r))}}Mt(Bc,[{key:"startPoint",get(){return this._startPosition&&this._startPosition.toArray()},set(t){this.setStartPoint(t)}},{key:"endPoint",get(){return this._endPosition&&this._endPosition.toArray()},set(t){this.setEndPoint(t)}},{key:"curvePoints",get(){return this.getCurvePoints(0,0)}},{key:"centerPoint",get(){const{_startPosition:t,_endPosition:e}=this;if(!t||!e)return null;const{heightRatio:i,pointNumber:r,flipY:n,closed:s}=this.option.geometry;let o=(t.x+e.x)/2,a=(e.y+t.y)/2+i*t.distanceTo(e)/2;return n&&(a*=-1),[o,a,(t.z+e.z)/2]}}]);class kc extends Ro{constructor(t){super(pt({points:[],geometry:{tubularSegments:64,radius:1,radialSegments:8,closed:!1,curveType:"centripetal",tension:.5},material:{}},t)),this.isTubeLine2=!0,this.type="TubeLine2",this.needPoints=!0,this.updatePoints(this.option.points)}get length(){if(this._points.length<2)return 0;let t=0,e=ti(this._points[0]);return this._points.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}createGeometry(){if(!this._points)return new be.BufferGeometry;const t=this.option.geometry,e=new be.CatmullRomCurve3(this._points,t.closed,t.curveType,t.tension);return new be.TubeGeometry(e,t.tubularSegments,t.radius,t.radialSegments,t.closed)}updatePoints(t){if(t&&0!==t.length){this._points=[];for(let e=0;e<t.length;e++){let i=t[e]?ti(t[e]):null;i&&this._points.push(i)}this.updateGeometry(this.option.geometry)}}get points(){return this._points.map((t=>t.toArray()))}set points(t){this.updatePoints(t)}}var jc=Object.freeze({__proto__:null,Line:Hh,Line2:cc,RouteLine:Ic,TubeLine:Uc,CurveLine:Bc,TubeLine2:kc});class Vc extends be.Mesh{constructor(t,e={}){super(t);const i=this,r=void 0!==e.textureWidth?e.textureWidth:512,n=void 0!==e.textureHeight?e.textureHeight:512,s=void 0!==e.clipBias?e.clipBias:0,o=void 0!==e.alpha?e.alpha:1,a=void 0!==e.time?e.time:0,l=void 0!==e.waterNormals?e.waterNormals:null,h=void 0!==e.sunDirection?e.sunDirection:new be.Vector3(.70707,.70707,0),c=new be.Color(void 0!==e.sunColor?e.sunColor:16777215),d=new be.Color(void 0!==e.waterColor?e.waterColor:8355711),u=void 0!==e.eye?e.eye:new be.Vector3(0,0,0),p=void 0!==e.distortionScale?e.distortionScale:20,m=void 0!==e.side?e.side:be.FrontSide,f=void 0!==e.fog&&e.fog,g=void 0!==e.speed?e.speed:1,v=new be.Plane,y=new be.Vector3,w=new be.Vector3,x=new be.Vector3,b=new be.Matrix4,_=new be.Vector3(0,0,-1),A=new be.Vector4,S=new be.Vector3,T=new be.Vector3,E=new be.Vector4,P=new be.Matrix4,M=new be.PerspectiveCamera,C=new be.WebGLRenderTarget(r,n),L={uniforms:be.UniformsUtils.merge([be.UniformsLib.fog,be.UniformsLib.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new be.Matrix4},sunColor:{value:new be.Color(8355711)},sunDirection:{value:new be.Vector3(.70707,.70707,0)},eye:{value:new be.Vector3},waterColor:{value:new be.Color(5592405)},speed:{value:0}}]),vertexShader:"\n\t\t\t\tuniform mat4 textureMatrix;\n\t\t\t\tuniform float time;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <fog_pars_vertex>\n\t\t\t\t#include <shadowmap_pars_vertex>\n\t\t\t\t#include <logdepthbuf_pars_vertex>\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tmirrorCoord = modelMatrix * vec4( position, 1.0 );\n\t\t\t\t\tworldPosition = mirrorCoord.xyzw;\n\t\t\t\t\tmirrorCoord = textureMatrix * mirrorCoord;\n\t\t\t\t\tvec4 mvPosition =\tmodelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t\t#include <beginnormal_vertex>\n\t\t\t\t#include <defaultnormal_vertex>\n\t\t\t\t#include <logdepthbuf_vertex>\n\t\t\t\t#include <fog_vertex>\n\t\t\t\t#include <shadowmap_vertex>\n\t\t\t}",fragmentShader:"\n\t\t\t\tuniform sampler2D mirrorSampler;\n\t\t\t\tuniform float alpha;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform float size;\n\t\t\t\tuniform float distortionScale;\n\t\t\t\tuniform sampler2D normalSampler;\n\t\t\t\tuniform vec3 sunColor;\n\t\t\t\tuniform vec3 sunDirection;\n\t\t\t\tuniform vec3 eye;\n\t\t\t\tuniform vec3 waterColor;\n\n\t\t\t\tvarying vec4 mirrorCoord;\n\t\t\t\tvarying vec4 worldPosition;\n\n\t\t\t\tvec4 getNoise( vec2 uv ) {\n\t\t\t\t\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);\n\t\t\t\t\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );\n\t\t\t\t\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );\n\t\t\t\t\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );\n\t\t\t\t\tvec4 noise = texture2D( normalSampler, uv0 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv1 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv2 ) +\n\t\t\t\t\t\ttexture2D( normalSampler, uv3 );\n\t\t\t\t\treturn noise * 0.5 - 1.0;\n\t\t\t\t}\n\n\t\t\t\tvoid sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {\n\t\t\t\t\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );\n\t\t\t\t\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );\n\t\t\t\t\tspecularColor += pow( direction, shiny ) * sunColor * spec;\n\t\t\t\t\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <packing>\n\t\t\t\t#include <bsdfs>\n\t\t\t\t#include <fog_pars_fragment>\n\t\t\t\t#include <logdepthbuf_pars_fragment>\n\t\t\t\t#include <lights_pars_begin>\n\t\t\t\t#include <shadowmap_pars_fragment>\n\t\t\t\t#include <shadowmask_pars_fragment>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <logdepthbuf_fragment>\n\t\t\t\t\tvec4 noise = getNoise( worldPosition.xz * size );\n\t\t\t\t\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );\n\n\t\t\t\t\tvec3 diffuseLight = vec3(0.0);\n\t\t\t\t\tvec3 specularLight = vec3(0.0);\n\n\t\t\t\t\tvec3 worldToEye = eye-worldPosition.xyz;\n\t\t\t\t\tvec3 eyeDirection = normalize( worldToEye );\n\t\t\t\t\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );\n\n\t\t\t\t\tfloat distance = length(worldToEye);\n\n\t\t\t\t\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;\n\t\t\t\t\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );\n\n\t\t\t\t\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );\n\t\t\t\t\tfloat rf0 = 0.3;\n\t\t\t\t\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );\n\t\t\t\t\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;\n\t\t\t\t\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);\n\t\t\t\t\tvec3 outgoingLight = albedo;\n\t\t\t\t\tgl_FragColor = vec4( outgoingLight, alpha );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <fog_fragment>\n\t\t\t\t}"},R=new be.ShaderMaterial({fragmentShader:L.fragmentShader,vertexShader:L.vertexShader,uniforms:be.UniformsUtils.clone(L.uniforms),lights:!0,side:m,fog:f});R.uniforms.mirrorSampler.value=C.texture,R.uniforms.textureMatrix.value=P,R.uniforms.alpha.value=o,R.uniforms.time.value=a,R.uniforms.normalSampler.value=l,R.uniforms.sunColor.value=c,R.uniforms.waterColor.value=d,R.uniforms.sunDirection.value=h,R.uniforms.distortionScale.value=p,R.uniforms.eye.value=u,R.uniforms.speed.value=g,i.material=R,i.onBeforeRender=function(t,e,r){let n=R.uniforms.speed.value;if(n>0&&(R.uniforms.time.value+=n/600),w.setFromMatrixPosition(i.matrixWorld),x.setFromMatrixPosition(r.matrixWorld),b.extractRotation(i.matrixWorld),y.set(0,0,1),y.applyMatrix4(b),S.subVectors(w,x),S.dot(y)>0)return;S.reflect(y).negate(),S.add(w),b.extractRotation(r.matrixWorld),_.set(0,0,-1),_.applyMatrix4(b),_.add(x),T.subVectors(w,_),T.reflect(y).negate(),T.add(w),M.position.copy(S),M.up.set(0,1,0),M.up.applyMatrix4(b),M.up.reflect(y),M.lookAt(T),M.far=r.far,M.updateMatrixWorld(),M.projectionMatrix.copy(r.projectionMatrix),P.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),P.multiply(M.projectionMatrix),P.multiply(M.matrixWorldInverse),v.setFromNormalAndCoplanarPoint(y,w),v.applyMatrix4(M.matrixWorldInverse),A.set(v.normal.x,v.normal.y,v.normal.z,v.constant);const o=M.projectionMatrix;E.x=(Math.sign(A.x)+o.elements[8])/o.elements[0],E.y=(Math.sign(A.y)+o.elements[9])/o.elements[5],E.z=-1,E.w=(1+o.elements[10])/o.elements[14],A.multiplyScalar(2/A.dot(E)),o.elements[2]=A.x,o.elements[6]=A.y,o.elements[10]=A.z+1-s,o.elements[14]=A.w,u.setFromMatrixPosition(r.matrixWorld);const a=t.getRenderTarget(),l=t.xr.enabled,h=t.shadowMap.autoUpdate;i.visible=!1,t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(C),t.state.buffers.depth.setMask(!0),!1===t.autoClear&&t.clear(),t.render(e,M),i.visible=!0,t.xr.enabled=l,t.shadowMap.autoUpdate=h,t.setRenderTarget(a);const c=r.viewport;void 0!==c&&t.state.viewport(c)}}}Vc.prototype.isWater=!0;class zc extends Mo{constructor(t){super(pt({points:[],material:{side:2,uniforms:{textureWidth:512,textureHeight:512,waterNormals:"",time:0,clipBias:.8,alpha:.9,sunColor:16777215,waterColor:"#003399",distortionScale:1,fog:!0,speed:0}},geometryType:"Plane",geometry:{width:10,height:10}},t)),this.type="Water",this.isWater=!0,this.isSync=!0,this.mesh=null;const{geometryType:e,geometry:i,material:r,points:n}=this.option;"Polygon"==e?this.setPoints(n):this._setPlane(i)}setPoints(t){if(!t||!t.length)return;const e=this.points=t.map((t=>ti(t)));var i=new be.Shape(e.map((t=>new be.Vector2(t.x,t.z)))),r=new be.ShapeGeometry(i);this.setGeometry(r)}updateMaterial(t){pt(this.option.material,t);const e=this.option.material.uniforms;if(this.mesh){if(!t)return;const i=this.mesh.material.uniforms;for(const t in e){const r=e[t];if(void 0!==i[t])switch(t){case"waterNormals":r===e.waterNormals||i.normalSample.value||(i.normalSample.value=new be.TextureLoader(mo.loadingManager).load(mo.transformUrl(r),(t=>{t.wrapS=t.wrapT=be.RepeatWrapping})));break;case"waterColor":case"sunColor":i[t].value=new be.Color(r);break;case"eye":case"sunDirection":i[t].value=ti(r);break;default:i[t].value=r}}}else{if(!this._geometry||!e.waterNormals)return;const{waterNormals:t}=e;this.mesh=new Vc(this._geometry,{side:this.option.material.side,...e,waterNormals:(new be.TextureLoader).load(mo.transformUrl(t),(t=>{t.wrapS=t.wrapT=be.RepeatWrapping,this.dispatchEvent({type:"loaded"})}))}),this.mesh.rotation.x=-Math.PI/2,this.add(this.mesh)}}get material(){return this.mesh?this.mesh.material:null}set material(t){this.mesh&&(this.mesh.material=t)}updateGeometry(t){pt(this.option.geometry,t);const{geometryType:e}=this.option;"Plane"===e&&(this._setPlane(t),this.updateMaterial(this.option.material)),"Points"===e&&Array.isArray(t)&&this.setPoints(t)}updatePoints(t){const{geometryType:e}=this.option;"Polygon"===e&&Array.isArray(t)&&this.setPoints(t)}_setPlane(t){pt(this.option.geometry,t);const{geometryType:e,geometry:i}=this.option;this.plane=Mf(e,this.name+"_water",{geometry:i}),this.setGeometry(this.plane)}setGeometry(t){if(!t)return;let e=t;t.isThing&&(e=t.getGeometry()),e&&(this._geometry=e,this.updateMaterial(),this.mesh&&(this.mesh.geometry=e))}getPoints(){return this.points?this.points.map((t=>t.toArray())):[]}}class Gc extends Oc{constructor(t){super(pt({points:[],polygon:{material:{color:"#708090",opacity:.5,side:2}},line:{material:{color:de,dashed:!1,dashScale:1,dashSize:1,dashOffset:1,gapSize:1,opacity:1,linewidth:1,worldUnits:!1}}},t)),this.type="Polygon",this.isPolygon=!0,this.needPoints=!0,this.vertices=[],this._points=[],this.line=new cc({points:[],material:this.option.line.material}),this.add(this.line),this.setPoints(this.option.points),this.updateLine(),this.updatePolygon()}updatePolygon(t){this.mesh&&(pt(this.option.polygon,t),this.mesh.updateBy(this.option.polygon))}updateLine(t){this.line&&(pt(this.option.line,t),this.line.updateBy(this.option.line))}updatePoints(t){this.setPoints(t)}addPoint(t){if(!t)return-1;const e=ti(t);return this.position.y=e.y,e.y=0,this._points.push(e),this._updateByPoints(),this._points.length-1}addPoints(t){if(t&&W(t)){for(var e=0;e<t.length;e++){var i=ti(t[e]);i.y=0,this._points.push(i)}this._updateByPoints()}}setPoints(t){t=t||[],this._points=[];let e=[];for(let i=0;i<t.length;i++){let r=t[i];r.isVector2||2===r.length?(r=$e(r),r=new be.Vector3(r.x,0,r.y)):(r=ti(r),r=new be.Vector3(r.x,0,r.z)),e.push(r)}this.addPoints(e||[])}_createGeometry(){var t=this._createPolygonVertices();this.vertices=t.vertices;let e=[],i=0;for(let t=0,r=this._points.length;t<r;t++){const r=this._points[t];0==i&&0!=r.y&&(i=r.y),e.push(new be.Vector2(r.x,r.z))}this.vertices.forEach((t=>t.y=i));const r=new be.ShapeGeometry(new be.Shape(e));return r.uvsNeedUpdate=!0,r}_updateByPoints(){if(this._points.length>0&&this.line.updatePoints(this._points.concat(this._points[0])),this._points.length<3)return;const t=this._createGeometry();if(this.mesh)this.mesh.geometry=t;else{const e=this.mesh=new be.Mesh(t,new be.MeshStandardMaterial);e.updateBy({material:this.option.polygon.material}),this.line.updateBy({material:this.option.line.material}),this.add(e),this.mesh.rotation.x=Math.PI/2}}clear(){this._points=[],this.vertices=[],this._updateByPoints()}get points(){return this._points.map((t=>t.toArray()))}set points(t){this.updatePoints(t)}get length(){if(this._points.length<2)return 0;let t=0,e=ti(this._points[0]);return this._points.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}}Mt(Gc,[{key:"area",get:function(){var t=be.ShapeUtils.area(this.points_2d);return Math.abs(t)}},{key:"centeriod",get:function(){for(var t=[],e=[],i=0;i<this.points_2d.length;i++)e.push([this.points_2d[i].x,this.points_2d[i].y]);return t.push(e),new Mc(t)}},{key:"points_2d",get:function(){for(var t=[],e=this.vertices||[],i=0;i<e.length;i++){const r=e[i];r.hasOwnProperty("x")?r.hasOwnProperty("z")?t.push(new be.Vector2(r.x,r.z)):t.push(new be.Vector2(r.x,r.y)):2==r.length?t.push(new be.Vector2(r[0],r[1])):3==r.length&&t.push(new be.Vector2(r[0],r[2]))}return t}}]);function Hc(t,e,i){i=i||2;var r,n,s,o,a,l,h,c=e&&e.length,d=c?e[0]*i:t.length,u=Xc(t,0,d,i,!0),p=[];if(!u||u.next===u.prev)return p;if(c&&(u=function(t,e,i,r){var n,s,o,a=[];for(n=0,s=e.length;n<s;n++)(o=Xc(t,e[n]*r,n<s-1?e[n+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),a.push(id(o));for(a.sort(Kc),n=0;n<a.length;n++)i=Wc(i=$c(a[n],i),i.next);return i}(t,e,u,i)),t.length>80*i){r=s=t[0],n=o=t[1];for(var m=i;m<d;m+=i)(a=t[m])<r&&(r=a),(l=t[m+1])<n&&(n=l),a>s&&(s=a),l>o&&(o=l);h=0!==(h=Math.max(s-r,o-n))?1/h:0}return Yc(u,p,i,r,n,h),p}function Xc(t,e,i,r,n){var s,o;if(n===fd(t,e,i,r)>0)for(s=e;s<i;s+=r)o=ud(s,t[s],t[s+1],o);else for(s=i-r;s>=e;s-=r)o=ud(s,t[s],t[s+1],o);return o&&od(o,o.next)&&(pd(o),o=o.next),o}function Wc(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!od(r,r.next)&&0!==sd(r.prev,r,r.next))r=r.next;else{if(pd(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function Yc(t,e,i,r,n,s,o){if(t){!o&&s&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=ed(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,s,o,a,l,h=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,r=i,a=0,e=0;e<h&&(a++,r=r.nextZ);e++);for(l=h;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=r}s.nextZ=null,h*=2}while(o>1)}(n)}(t,r,n,s);for(var a,l,h=t;t.prev!==t.next;)if(a=t.prev,l=t.next,s?Jc(t,r,n,s):Qc(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),pd(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?Yc(t=Zc(Wc(t),e,i),e,i,r,n,s,2):2===o&&qc(t,e,i,r,n,s):Yc(Wc(t),e,i,r,n,s,1);break}}}function Qc(t){var e=t.prev,i=t,r=t.next;if(sd(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(rd(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&sd(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Jc(t,e,i,r){var n=t.prev,s=t,o=t.next;if(sd(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,h=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,c=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,d=ed(a,l,e,i,r),u=ed(h,c,e,i,r),p=t.prevZ,m=t.nextZ;p&&p.z>=d&&m&&m.z<=u;){if(p!==t.prev&&p!==t.next&&rd(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&sd(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==t.prev&&m!==t.next&&rd(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&sd(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=d;){if(p!==t.prev&&p!==t.next&&rd(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&sd(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=u;){if(m!==t.prev&&m!==t.next&&rd(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&sd(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Zc(t,e,i){var r=t;do{var n=r.prev,s=r.next.next;!od(n,s)&&ad(n,r,r.next,s)&&cd(n,s)&&cd(s,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(s.i/i),pd(r),pd(r.next),r=t=s),r=r.next}while(r!==t);return Wc(r)}function qc(t,e,i,r,n,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&nd(o,a)){var l=dd(o,a);return o=Wc(o,o.next),l=Wc(l,l.next),Yc(o,e,i,r,n,s),void Yc(l,e,i,r,n,s)}a=a.next}o=o.next}while(o!==t)}function Kc(t,e){return t.x-e.x}function $c(t,e){var i=function(t,e){var i,r=e,n=t.x,s=t.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!i)return null;if(n===o)return i;var l,h=i,c=i.x,d=i.y,u=1/0;r=i;do{n>=r.x&&r.x>=c&&n!==r.x&&rd(s<d?n:o,s,c,d,s<d?o:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),cd(r,t)&&(l<u||l===u&&(r.x>i.x||r.x===i.x&&td(i,r)))&&(i=r,u=l)),r=r.next}while(r!==h);return i}(t,e);if(!i)return e;var r=dd(i,t),n=Wc(i,i.next);return Wc(r,r.next),e===i?n:e}function td(t,e){return sd(t.prev,t,e.prev)<0&&sd(e.next,t,t.next)<0}function ed(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function id(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function rd(t,e,i,r,n,s,o,a){return(n-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(r-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function nd(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ad(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(cd(t,e)&&cd(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(sd(t.prev,t,e.prev)||sd(t,e.prev,e))||od(t,e)&&sd(t.prev,t,t.next)>0&&sd(e.prev,e,e.next)>0)}function sd(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function od(t,e){return t.x===e.x&&t.y===e.y}function ad(t,e,i,r){var n=hd(sd(t,e,i)),s=hd(sd(t,e,r)),o=hd(sd(i,r,t)),a=hd(sd(i,r,e));return n!==s&&o!==a||(!(0!==n||!ld(t,i,e))||(!(0!==s||!ld(t,r,e))||(!(0!==o||!ld(i,t,r))||!(0!==a||!ld(i,e,r)))))}function ld(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function hd(t){return t>0?1:t<0?-1:0}function cd(t,e){return sd(t.prev,t,t.next)<0?sd(t,e,t.next)>=0&&sd(t,t.prev,e)>=0:sd(t,e,t.prev)<0||sd(t,t.next,e)<0}function dd(t,e){var i=new md(t.i,t.x,t.y),r=new md(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function ud(t,e,i,r){var n=new md(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function pd(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function md(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function fd(t,e,i,r){for(var n=0,s=e,o=i-r;s<i;s+=r)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}Hc.deviation=function(t,e,i,r){var n=e&&e.length,s=n?e[0]*i:t.length,o=Math.abs(fd(t,0,s,i));if(n)for(var a=0,l=e.length;a<l;a++){var h=e[a]*i,c=a<l-1?e[a+1]*i:t.length;o-=Math.abs(fd(t,h,c,i))}var d=0;for(a=0;a<r.length;a+=3){var u=r[a]*i,p=r[a+1]*i,m=r[a+2]*i;d+=Math.abs((t[u]-t[m])*(t[p+1]-t[u+1])-(t[u]-t[p])*(t[m+1]-t[u+1]))}return 0===o&&0===d?0:Math.abs((d-o)/o)},Hc.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var s=0;s<t[n].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[n][s][o]);n>0&&(r+=t[n-1].length,i.holes.push(r))}return i};var gd=Hc;function vd(t,e,i){var r=e[0],n=e[1],s=i[0]-r,o=i[1]-n;if(0!==s||0!==o){var a=((t[0]-r)*s+(t[1]-n)*o)/(s*s+o*o);a>1?(r=i[0],n=i[1]):a>0&&(r+=s*a,n+=o*a)}return(s=t[0]-r)*s+(o=t[1]-n)*o}function yd(t,e,i,r,n){for(var s,o=r,a=e+1;a<i;a++){var l=vd(t[a],t[e],t[i]);l>o&&(s=a,o=l)}o>r&&(s-e>1&&yd(t,e,s,r,n),n.push(t[s]),i-s>1&&yd(t,s,i,r,n))}function wd(t,e){var i=t.length-1,r=[t[0]];return yd(t,0,i,e,r),r.push(t[i]),r}function xd(t,e,i){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=i?t:function(t,e){for(var i,r,n,s,o,a=t[0],l=[a],h=1,c=t.length;h<c;h++)i=t[h],n=a,s=void 0,o=void 0,s=(r=i)[0]-n[0],o=r[1]-n[1],s*s+o*o>e&&(l.push(i),a=i);return a!==i&&l.push(i),l}(t,r),t=wd(t,r)}function bd(t,e){return t[0]*e[0]+t[1]*e[1]}function _d(t,e){var i=e[0],r=e[1],n=Math.sqrt(i*i+r*r);return t[0]=i/n,t[1]=r/n,t}function Ad(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t}function Sd(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function Td(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Ed(t,e){var i=e[0],r=e[1],n=e[2],s=Math.sqrt(i*i+r*r+n*n);return t[0]=i/s,t[1]=r/s,t[2]=n/s,t}function Pd(t,e,i){var r=e[0],n=e[1],s=e[2],o=i[0],a=i[1],l=i[2];return t[0]=n*l-s*a,t[1]=s*o-r*l,t[2]=r*a-n*o,t}var Md=[];function Cd(t,e,i,r){var n=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(e,i),s=Math.acos(n)*r;return Ad(Md,i,e,-n),function(t,e){var i=e[0],r=e[1],n=e[2],s=Math.sqrt(i*i+r*r+n*n);t[0]=i/s,t[1]=r/s,t[2]=n/s}(Md,Md),function(t,e,i){t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i}(t,e,Math.cos(s)),Ad(t,t,Md,Math.sin(s)),t}function Ld(t,e,i,r,n,s,o,a,l,h){var c=o-n,d=a-s,u=(c*(e-s)-d*(t-n))/(d*(i-t)-c*(r-e));return l&&(l[h=h||0]=t+u*(i-t),l[h+1]=e+u*(r-e)),u}function Rd(t,e,i){if(i-e<3)return 0;for(var r=0,n=2*(i-1),s=2*e;s<2*i;){var o=t[n],a=t[n+1],l=t[s],h=t[s+1];n=s,s+=2,r+=o*h-l*a}return r}function Od(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return gd(t,e,i)}var Fd=[],Nd=[],Dd=[];function Id(t,e,i,r,n,s,o,a,l){var h,c,d,u=null!=o,p=n,m=null;u&&(m=new Uint32Array(r-i));for(var f=[],g=i;g<r;g++){var v=g===r-1?i:g+1,y=g===i?r-1:g-1,w=t[2*y],x=t[2*y+1],b=t[2*g],_=t[2*g+1],A=t[2*v],S=t[2*v+1];Fd[0]=b-w,Fd[1]=_-x,Nd[0]=A-b,Nd[1]=S-_,_d(Fd,Fd),_d(Nd,Nd),u&&(m[g]=p);var T=!1,E=void 0,P=void 0;if(a||g!==i)if(a||g!==r-1){Sd(Dd,Nd,Fd);var M=Dd[1];Dd[1]=-Dd[0],Dd[0]=M,_d(Dd,Dd);var C=bd(Dd,Nd),L=Math.sqrt(1-C*C),R=s*Math.min(10,1/L);if(u&&1/L>o&&s*C<0){var O=b+Dd[0]*s,F=_+Dd[1]*s,N=Math.acos(L)/2,D=Math.tan(N)*Math.abs(s);e[2*p]=O+Dd[1]*D,e[2*p+1]=F-Dd[0]*D,e[2*++p]=O-Dd[1]*D,e[2*p+1]=F+Dd[0]*D,p++}else E=b+Dd[0]*R,P=_+Dd[1]*R,T=!0;if(T){if(l&&null!=h){var I=Ld(w,x,h,c,b,_,E,P,f,0);I>=-.01&&I<=1.01&&(e[2*d]=E=f[0],e[2*d+1]=P=f[1])}h=e[2*p]=E,c=e[2*p+1]=P,d=p,p++}}else Dd[0]=Fd[1],Dd[1]=-Fd[0],_d(Dd,Dd),E=b+Dd[0]*s,P=_+Dd[1]*s,T=!0;else Dd[0]=Nd[1],Dd[1]=-Nd[0],_d(Dd,Dd),h=e[2*p]=b+Dd[0]*s,c=e[2*p+1]=_+Dd[1]*s,d=p,p++}return m}function Ud(t,e,i,r,n){var s=null!=r?[]:new Float32Array(t.length);if(Id(t,s,0,e&&e.length?e[0]:t.length/2,0,i,r,n,!0),e)for(var o=0;o<e.length;o++){var a=e[o];Id(t,s,a,e[o+1]||t.length/2,null!=r?s.length/2:a,i,r,n,!1)}return s}function Bd(t,e,i,r){for(var n=0;n<Math.floor((r-i)/2);n++)for(var s=0;s<e;s++){var o=(n+i)*e+s,a=(r-n-1)*e+s,l=t[o];t[o]=t[a],t[a]=l}return t}function kd(t,e){var i=t.length/2,r=0,n=e&&e.length?e[0]:i;Rd(t,r,n)>0&&Bd(t,2,r,n);for(var s=1;s<(e?e.length:0)+1;s++)Rd(t,r=e[s-1],n=e[s]||i)<0&&Bd(t,2,r,n)}var jd=[[0,0],[1,0],[1,1],[0,0],[1,1],[0,1]];function Vd(t,e,i,r,n,s){var o=e.vertices,a=e.topVertices,l=e.splittedMap,h=e.depth,c=e.rect,d=r-i,u=s.smoothBevel?1:2,p=Math.min(h/2,s.bevelSize),m=s.bevelSegments,f=n.vertex,g=Math.max(c.width,c.height,h),v=l?function(t){var e=(t+1)%d;return l[t+i]===l[e+i]}:function(t){return!1};if(p>0)for(var y=[0,0,1],w=[],x=[0,0,-1],b=[],_=0,A=new Float32Array(d),S=0;S<2;S++)for(var T=0===S?h-p:p,E=0;E<=m*u;E++){for(var P=0,M=void 0,C=void 0,L=0;L<d;L++){var R=2*(L%d+i),O=l?2*l[R/2]:R;w[0]=o[R]-a[O],w[1]=o[R+1]-a[O+1],w[2]=0;var F=Math.sqrt(w[0]*w[0]+w[1]*w[1]);w[0]/=F,w[1]/=F;var N=(Math.floor(E/u)+E%u)/m;0===S?Cd(b,y,w,N):Cd(b,w,x,N);var D=0===S?N:1-N,I=p*Math.sin(D*Math.PI/2),U=F*Math.cos(D*Math.PI/2),B=p*F/Math.sqrt(I*I+U*U),k=b[0]*B+a[O],j=b[1]*B+a[O+1],V=b[2]*B+T;if(t.position[3*n.vertex]=k,t.position[3*n.vertex+1]=j,t.position[3*n.vertex+2]=V,L>0&&(P+=Math.sqrt((M-k)*(M-k)+(C-j)*(C-j))),E>0||S>0){var z=3*(n.vertex-d),G=t.position[z],H=t.position[z+1],X=t.position[z+2];A[L]+=Math.sqrt((G-k)*(G-k)+(H-j)*(H-j)+(X-V)*(X-V))}if(t.uv[2*n.vertex]=P/g,t.uv[2*n.vertex+1]=A[L]/g,M=k,C=j,n.vertex++,!v(L)&&(u>1&&E%u||1===u&&E>=1))for(var W=0;W<6;W++){var Y=(jd[W][0]+L)%d,Q=jd[W][1]+_;t.indices[n.index++]=(Q-1)*d+Y+f}}_++}else for(var J=0;J<2;J++)for(var Z=0===J?h:0,q=0,K=void 0,$=void 0,tt=0;tt<d;tt++){var et=2*(tt+i),it=o[et],rt=o[et+1],nt=3*n.vertex,st=2*n.vertex;t.position[nt]=it,t.position[nt+1]=rt,t.position[nt+2]=Z,tt>0&&(q+=Math.sqrt((K-it)*(K-it)+($-rt)*($-rt))),t.uv[st]=q/g,t.uv[st+1]=Z/g,K=it,$=rt,n.vertex++}for(var ot=p>0?m*u+1:1,at=0;at<d;at++)if(!v(at))for(var lt=0;lt<6;lt++){var ht=(jd[lt][0]+at)%d,ct=jd[lt][1]+ot;t.indices[n.index++]=(ct-1)*d+ht+f}}function zd(t,e,i,r){var n=t.indices,s=t.topVertices,o=t.rect,a=t.depth;if(!(s.length<=4)){for(var l=i.vertex,h=n.length,c=0;c<h;c++)e.indices[i.index++]=l+n[c];for(var d=Math.max(o.width,o.height),u=0;u<(r.excludeBottom?1:2);u++)for(var p=0;p<s.length;p+=2){var m=s[p],f=s[p+1],g=3*i.vertex,v=2*i.vertex;e.position[g]=m,e.position[g+1]=f,e.position[g+2]=(1-u)*a,e.uv[v]=(m-o.x)/d,e.uv[v+1]=(f-o.y)/d,i.vertex++}if(!r.excludeBottom)for(var y=s.length/2,w=0;w<h;w+=3)for(var x=0;x<3;x++)e.indices[i.index++]=l+y+n[w+2-x]}}function Gd(t,e,i,r){var n=null==i||"auto"===i;if(!0===i)return{vertices:t,holes:e};for(var s=[],o=e&&[],a=t.length/2,l=[],h=[],c=[],d=0,u=0,p=(e?e.length:0)+1,m=0;m<p;m++){0===m?u=e&&e.length?e[0]:a:(d=e[m-1],u=e[m]||a);for(var f=d;f<u;f++){var g=t[2*f],v=t[2*f+1],y=f===u-1?d:f+1,w=t[2*y],x=t[2*y+1];if(n){var b=f===d?u-1:f-1,_=t[2*b],A=t[2*b+1];l[0]=_-g,l[1]=A-v,h[0]=w-g,h[1]=x-v,_d(l,l),_d(h,h),1-(.5*bd(l,h)+.5)>r?(s.push(g,v),c.push(f)):(s.push(g,v,g,v),c.push(f,f))}else s.push(g,v,g,v),c.push(f,f)}m<p-1&&o&&o.push(s.length/2)}return{vertices:new Float32Array(s),splittedMap:c,holes:o}}function Hd(t,e){for(var i=0,r=0,n=0;n<t.length;n++){var s=t[n],o=s.indices,a=s.vertices,l=s.splittedMap,h=s.topVertices,c=s.holes,d=s.depth,u=Math.min(d/2,e.bevelSize)>0?e.bevelSegments:0;c=c||[],i+=o.length*(e.excludeBottom?1:2),r+=h.length/2*(e.excludeBottom?1:2);for(var p=2+2*u,m=0,f=0,g=0;g<c.length+1;g++){0===g?f=c.length?c[0]:a.length/2:(m=c[g-1],f=c[g]||a.length/2),i+=6*((l?l[f-1]+1:f)-(l?l[m]:m))*(p-1);var v=f-m;r+=v*p+(e.smoothBevel?0:u*v*2)}}for(var y={position:new Float32Array(3*r),indices:new(r>65535?Uint32Array:Uint16Array)(i),uv:new Float32Array(2*r)},w={vertex:0,index:0},x=0;x<t.length;x++)zd(t[x],y,w,e);for(var b=0;b<t.length;b++){var _=t[b],A=_.holes,S=_.vertices.length/2,T=0,E=A&&A.length?A[0]:S;if(Vd(y,t[b],T,E,w,e),A)for(var P=0;P<A.length;P++)T=A[P],E=A[P+1]||S,Vd(y,t[b],T,E,w,e)}for(var M=0;M<y.uv.length;M++){var C=y.uv[M];C>0&&Math.round(C)===C?y.uv[M]=1:y.uv[M]=C%1}return y.normal=function(t,e){function i(t,e,i,r){t[0]=e,t[1]=i,t[2]=r}for(var r=[],n=[],s=[],o=[],a=[],l=[],h=t.length,c=new Float32Array(e.length),d=0;d<h;){var u=3*t[d++],p=3*t[d++],m=3*t[d++];i(r,e[u],e[u+1],e[u+2]),i(n,e[p],e[p+1],e[p+2]),i(s,e[m],e[m+1],e[m+2]),Td(o,r,n),Td(a,n,s),Pd(l,o,a);for(var f=0;f<3;f++)c[u+f]=c[u+f]+l[f],c[p+f]=c[p+f]+l[f],c[m+f]=c[m+f]+l[f]}for(var g=0;g<c.length;)i(l,c[g],c[g+1],c[g+2]),Ed(l,l),c[g++]=l[0],c[g++]=l[1],c[g++]=l[2];return c}(y.indices,y.position),y.boundingRect=t[0]&&t[0].rect,y}function Xd(t,e){for(var i=[],r=0;r<t.length;r++){for(var n=t[r],s=[],o=n.length,a=n[o-1][0],l=n[o-1][1],h=0,c=0;c<o;c++){var d=n[c][0],u=n[c][1],p=d-a,m=u-l;(h+=Math.sqrt(p*p+m*m))>e&&(s.push(n[c]),h=0),a=d,l=u}s.length>=3&&i.push(s)}return i.length>0?i:null}function Wd(t,e){for(var i=[],r=0;r<t.length;r++){var n=t[r];(n=xd(n,e,!0)).length>=3&&i.push(n)}return i.length>0?i:null}function Yd(t,e){e=Object.assign({},e);for(var i=[1/0,1/0],r=[-1/0,-1/0],n=0;n<t.length;n++)Qd(t[n][0],i,r);e.boundingRect=e.boundingRect||{x:i[0],y:i[1],width:r[0]-i[0],height:r[1]-i[1]},function(t){t.depth=t.depth||1,t.bevelSize=t.bevelSize||0,t.bevelSegments=null==t.bevelSegments?2:t.bevelSegments,t.smoothBevel=t.smoothBevel||!1,t.simplify=t.simplify||0,null==t.smoothSide&&(t.smoothSide="auto"),null==t.smoothSideThreshold&&(t.smoothSideThreshold=.9),"number"==typeof t.depth&&(t.bevelSize=Math.min(t.bevelSegments>0?t.bevelSize:0,t.depth/2)),t.bevelSize>0||(t.bevelSegments=0),t.bevelSegments=Math.round(t.bevelSegments);var e=t.boundingRect;if(t.translate=t.translate||[0,0],t.scale=t.scale||[1,1],t.fitRect){var i=null==t.fitRect.x?e.x||0:t.fitRect.x,r=null==t.fitRect.y?e.y||0:t.fitRect.y,n=t.fitRect.width,s=t.fitRect.height;null==n?null!=s?n=s/e.height*e.width:(n=e.width,s=e.height):null==s&&(s=n/e.width*e.height),t.scale=[n/e.width,s/e.height],t.translate=[(i-e.x)*t.scale[0],(r-e.y)*t.scale[1]]}}(e);for(var s=[],o=e.translate||[0,0],a=e.scale||[1,1],l=e.boundingRect,h={x:l.x*a[0]+o[0],y:l.y*a[1]+o[1],width:l.width*a[0],height:l.height*a[1]},c=Math.min(l.width,l.height)/1e5,d=0;d<t.length;d++){var u=Xd(t[d],c);if(u){var p=e.simplify/Math.max(a[0],a[1]);if(p>0&&(u=Wd(u,p)),u){for(var m=gd.flatten(u),f=m.vertices,g=m.holes,v=m.dimensions,y=0;y<f.length;)f[y]=f[y++]*a[0]+o[0],f[y]=f[y++]*a[1]+o[1];if(kd(f,g),2!==v)throw new Error("Only 2D polygon points are supported");var w=e.bevelSize>0?Ud(f,g,e.bevelSize,null,!0):f,x=Od(w,g,v),b=Gd(f,g,e.smoothSide,e.smoothSideThreshold);s.push({indices:x,vertices:b.vertices,rawVertices:f,topVertices:w,holes:b.holes,splittedMap:b.splittedMap,rect:h,depth:"function"==typeof e.depth?e.depth(d):e.depth})}}}return Hd(s,e)}function Qd(t,e,i){for(var r=0;r<t.length;r++)e[0]=Math.min(t[r][0],e[0]),e[1]=Math.min(t[r][1],e[1]),i[0]=Math.max(t[r][0],i[0]),i[1]=Math.max(t[r][1],i[1])}var Jd,Zd={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},qd=function(){var t=function(t){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=t.xField||t.defaultXField,this._yField=t.yField||t.defaultYField,this._valueField=t.valueField||t.defaultValueField,t.radius&&(this._cfgRadius=t.radius)},e=Zd.defaultRadius;return t.prototype={_organiseData:function(t,i){var r=t[this._xField],n=t[this._yField],s=this._radi,o=this._data,a=this._max,l=this._min,h=t[this._valueField]||1,c=t.radius||this._cfgRadius||e;return o[r]||(o[r]=[],s[r]=[]),o[r][n]?o[r][n]+=h:(o[r][n]=h,s[r][n]=c),o[r][n]>a?(i?this.setDataMax(o[r][n]):this._max=o[r][n],!1):{x:r,y:n,value:h,radius:c,min:l,max:a}},_unOrganizeData:function(){var t=[],e=this._data,i=this._radi;for(var r in e)for(var n in e[r])t.push({x:r,y:n,radius:i[r][n],value:e[r][n]});return{min:this._min,max:this._max,data:t}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var t=arguments[0],e=t.length;e--;)this.addData.call(this,t[e]);else{var i=this._organiseData(arguments[0],!0);i&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[i]})}return this},setData:function(t){var e=t.data,i=e.length;this._data=[],this._radi=[];for(var r=0;r<i;r++)this._organiseData(e[r],!1);return this._max=t.max,this._min=t.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(t){return this._max=t,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(t){return this._min=t,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(t){this._coordinator=t},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},t}(),Kd=function(){var t=function(t){var e=t.gradient||t.defaultGradient,i=document.createElement("canvas"),r=i.getContext("2d");i.width=256,i.height=1;var n=r.createLinearGradient(0,0,256,1);for(var s in e)n.addColorStop(s,e[s]);return r.fillStyle=n,r.fillRect(0,0,256,1),r.getImageData(0,0,256,1).data},e=function(t,e){var i=document.createElement("canvas"),r=i.getContext("2d"),n=t,s=t;if(i.width=i.height=2*t,1==e)r.beginPath(),r.arc(n,s,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill();else{var o=r.createRadialGradient(n,s,t*e,n,s,t);o.addColorStop(0,"rgba(0,0,0,1)"),o.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=o,r.fillRect(0,0,2*t,2*t)}return i};function i(e){var i=this.shadowCanvas=document.createElement("canvas"),r=this.canvas=e.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0],r.className="heatmap-canvas",this._width=r.width=i.width=e.width,this._height=r.height=i.height=e.height,this.shadowCtx=i.getContext("2d"),this.ctx=r.getContext("2d"),r.style.cssText=i.style.cssText="position:absolute;left:0;top:0;",this._palette=t(e),this._templates={},this._setStyles(e)}return i.prototype={renderPartial:function(t){t.data.length>0&&(this._drawAlpha(t),this._colorize())},renderAll:function(t){this._clear(),t.data.length>0&&(this._drawAlpha(function(t){for(var e=[],i=t.min,r=t.max,n=t.radi,s=(t=t.data,Object.keys(t)),o=s.length;o--;)for(var a=s[o],l=Object.keys(t[a]),h=l.length;h--;){var c=l[h],d=t[a][c],u=n[a][c];e.push({x:a,y:c,value:d,radius:u})}return{min:i,max:r,data:e}}(t)),this._colorize())},_updateGradient:function(e){this._palette=t(e)},updateConfig:function(t){t.gradient&&this._updateGradient(t),this._setStyles(t)},setDimensions:function(t,e){this._width=t,this._height=e,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=e},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(t){this._blur=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=t.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=t.height||this._height,this._opacity=255*(t.opacity||0),this._maxOpacity=255*(t.maxOpacity||t.defaultMaxOpacity),this._minOpacity=255*(t.minOpacity||t.defaultMinOpacity),this._useGradientOpacity=!!t.useGradientOpacity},_drawAlpha:function(t){for(var i=this._min=t.min,r=this._max=t.max,n=(t=t.data||[]).length,s=1-this._blur;n--;){var o,a=t[n],l=a.x,h=a.y,c=a.radius,d=Math.min(a.value,r),u=l-c,p=h-c,m=this.shadowCtx;this._templates[c]?o=this._templates[c]:this._templates[c]=o=e(c,s);var f=(d-i)/(r-i);m.globalAlpha=f<.01?.01:f,m.drawImage(o,u,p),u<this._renderBoundaries[0]&&(this._renderBoundaries[0]=u),p<this._renderBoundaries[1]&&(this._renderBoundaries[1]=p),u+2*c>this._renderBoundaries[2]&&(this._renderBoundaries[2]=u+2*c),p+2*c>this._renderBoundaries[3]&&(this._renderBoundaries[3]=p+2*c)}},_colorize:function(){var t=this._renderBoundaries[0],e=this._renderBoundaries[1],i=this._renderBoundaries[2]-t,r=this._renderBoundaries[3]-e,n=this._width,s=this._height,o=this._opacity,a=this._maxOpacity,l=this._minOpacity,h=this._useGradientOpacity;t<0&&(t=0),e<0&&(e=0),t+i>n&&(i=n-t),e+r>s&&(r=s-e);for(var c=this.shadowCtx.getImageData(t,e,i,r),d=c.data,u=d.length,p=this._palette,m=3;m<u;m+=4){var f,g=d[m],v=4*g;if(v)f=o>0?o:g<a?g<l?l:g:a,d[m-3]=p[v],d[m-2]=p[v+1],d[m-1]=p[v+2],d[m]=h?p[v+3]:f}try{c.data=d}catch(t){}this.ctx.putImageData(c,t,e),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(t){var e=this.shadowCtx.getImageData(t.x,t.y,1,1).data[3],i=this._max,r=this._min;return Math.abs(i-r)*(e/255)>>0},getDataURL:function(){return this.canvas.toDataURL()}},i}(),$d=(Jd=!1,"canvas2d"===Zd.defaultRenderer&&(Jd=Kd),Jd),tu=function(){for(var t={},e=arguments.length,i=0;i<e;i++){var r=arguments[i];for(var n in r)t[n]=r[n]}return t},eu=function(){var t=function(){function t(){this.cStore={}}return t.prototype={on:function(t,e,i){var r=this.cStore;r[t]||(r[t]=[]),r[t].push((function(t){return e.call(i,t)}))},emit:function(t,e){var i=this.cStore;if(i[t])for(var r=i[t].length,n=0;n<r;n++){(0,i[t][n])(e)}}},t}(),e=function(t){var e=t._renderer,i=t._coordinator,r=t._store;i.on("renderpartial",e.renderPartial,e),i.on("renderall",e.renderAll,e),i.on("extremachange",(function(e){t._config.onExtremaChange&&t._config.onExtremaChange({min:e.min,max:e.max,gradient:t._config.gradient||t._config.defaultGradient})})),r.setCoordinator(i)};function i(){var i=this._config=tu(Zd,arguments[0]||{});if(this._coordinator=new t,i.plugin){var r=i.plugin;if(!Zd.plugins[r])throw new Error("Plugin '"+r+"' not found. Maybe it was not registered.");var n=Zd.plugins[r];this._renderer=new n.renderer(i),this._store=new n.store(i)}else this._renderer=new $d(i),this._store=new qd(i);e(this)}return i.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(t){return this._config=tu(this._config,t),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(t){return this._store.getValueAt?this._store.getValueAt(t):this._renderer.getValueAt?this._renderer.getValueAt(t):null}},i}();class iu extends Vo{constructor(t,e){super(pt({geometry:{width:1,height:1},material:{side:0,transparent:!0}},e)),this.type="CanvasPlane",this.isCanvasPlane=!0,this._canvas=null,this.setCanvas(t)}setCanvas(t){this._canvas=t;const e=this.mesh;e.material.map=t?new be.CanvasTexture(t):null,t&&(e.material.map.encoding=be.sRGBEncoding)}get canvas(){return this._canvas}set canvas(t){this.setCanvas(t)}}class ru extends be.Mesh{constructor(t,e={}){super(t),this.type="Reflector";const i=this,r=void 0!==e.color?new be.Color(e.color):new be.Color(8355711),n=e.textureWidth||512,s=e.textureHeight||512,o=e.clipBias||0,a=e.shader||ru.ReflectorShader,l=new be.Plane,h=new be.Vector3,c=new be.Vector3,d=new be.Vector3,u=new be.Matrix4,p=new be.Vector3(0,0,-1),m=new be.Vector4,f=new be.Vector3,g=new be.Vector3,v=new be.Vector4,y=new be.Matrix4,w=new be.PerspectiveCamera,x={minFilter:be.LinearFilter,magFilter:be.LinearFilter,format:be.RGBFormat},b=new be.WebGLRenderTarget(n,s,x);be.MathUtils.isPowerOfTwo(n)&&be.MathUtils.isPowerOfTwo(s)||(b.texture.generateMipmaps=!1);const _=new be.ShaderMaterial({uniforms:be.UniformsUtils.clone(a.uniforms),fragmentShader:a.fragmentShader,vertexShader:a.vertexShader});_.uniforms.tDiffuse.value=b.texture,_.uniforms.color.value=r,_.uniforms.textureMatrix.value=y,_.uniforms.opacity.value=e.opacity,this.material=_,this.onBeforeRender=function(t,e,r){if(c.setFromMatrixPosition(i.matrixWorld),d.setFromMatrixPosition(r.matrixWorld),u.extractRotation(i.matrixWorld),h.set(0,0,1),h.applyMatrix4(u),f.subVectors(c,d),f.dot(h)>0)return;f.reflect(h).negate(),f.add(c),u.extractRotation(r.matrixWorld),p.set(0,0,-1),p.applyMatrix4(u),p.add(d),g.subVectors(c,p),g.reflect(h).negate(),g.add(c),w.position.copy(f),w.up.set(0,1,0),w.up.applyMatrix4(u),w.up.reflect(h),w.lookAt(g),w.far=r.far,w.updateMatrixWorld(),w.projectionMatrix.copy(r.projectionMatrix),y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(w.projectionMatrix),y.multiply(w.matrixWorldInverse),y.multiply(i.matrixWorld),l.setFromNormalAndCoplanarPoint(h,c),l.applyMatrix4(w.matrixWorldInverse),m.set(l.normal.x,l.normal.y,l.normal.z,l.constant);const n=w.projectionMatrix;v.x=(Math.sign(m.x)+n.elements[8])/n.elements[0],v.y=(Math.sign(m.y)+n.elements[9])/n.elements[5],v.z=-1,v.w=(1+n.elements[10])/n.elements[14],m.multiplyScalar(2/m.dot(v)),n.elements[2]=m.x,n.elements[6]=m.y,n.elements[10]=m.z+1-o,n.elements[14]=m.w,b.texture.encoding=t.outputEncoding,i.visible=!1;const s=t.getRenderTarget(),a=t.xr.enabled,x=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(b),t.state.buffers.depth.setMask(!0),!1===t.autoClear&&t.clear(),t.render(e,w),t.xr.enabled=a,t.shadowMap.autoUpdate=x,t.setRenderTarget(s);const _=r.viewport;void 0!==_&&t.state.viewport(_),i.visible=!0},this.getRenderTarget=function(){return b}}}ru.prototype.isReflector=!0,ru.ReflectorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null},opacity:{value:null}},vertexShader:"\n\tuniform mat4 textureMatrix;\n\tvarying vec4 vUv;\n\n\t#include <common>\n\t#include <logdepthbuf_pars_vertex>\n\n\tvoid main() {\n\n\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t#include <logdepthbuf_vertex>\n\n\t}",fragmentShader:"\n\tuniform vec3 color;\n\tuniform float opacity;\n\tuniform sampler2D tDiffuse;\n\tvarying vec4 vUv;\n\n\t#include <logdepthbuf_pars_fragment>\n\n\tfloat blendOverlay( float base, float blend ) {\n\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\t}\n\n\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\t}\n\n\tvoid main() {\n\t\t#include <logdepthbuf_fragment>\n\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), opacity );\n\t}"};class nu extends Mo{constructor(t){super(pt({name:"ReflectorPlane",geometry:{width:10,height:10,widthSegments:1,heightSegments:1},material:{uniforms:{textureHeight:window.innerHeight*window.devicePixelRatio,textureWidth:window.innerWidth*window.devicePixelRatio,opacity:.3,color:"#7F7F7F"}}},t)),this.isReflectorPlane=!0,this.type="ReflectorPlane",this.updateGeometry(this.option.geometry),this.updateMaterial(this.option.material)}updateGeometry(t){return pt(this.option.geometry,t||{}),this._geometry=new Vo({geometry:this.option.geometry}).getGeometry(),this.reflector&&(this.reflector.geometry=this._geometry),this._geometry}updateMaterial(t){if(t)if(pt(this.option.material,t),this.reflector){const e=t.uniforms;if(!e)return;if(e.textureWidth||e.textureHeight){const t=this.reflector.getRenderTarget();t.setSize(e.textureWidth||t.width,e.textureHeight||t.height)}const i=this.reflector.material.uniforms;for(const t in e)"color"==t?i.color.value=ni(e[t]):void 0!==i[t]&&(i[t].value=e[t])}else{const t=this.option.material.uniforms,e=new ru(this._geometry,{...t});e.material.uniforms.opacity.value=t.opacity,this.reflector=e,this.add(e)}}get material(){return this.reflector?this.reflector.material:null}set material(t){this.reflector&&(this.reflector.material=t)}}class su extends be.Mesh{constructor(t,e={}){super(t),this.type="Refractor";const i=this,r=void 0!==e.color?new be.Color(e.color):new be.Color(8355711),n=e.textureWidth||512,s=e.textureHeight||512,o=e.clipBias||0,a=e.shader||su.RefractorShader,l=new be.PerspectiveCamera;l.matrixAutoUpdate=!1,l.userData.refractor=!0;const h=new be.Plane,c=new be.Matrix4,d=new be.WebGLRenderTarget(n,s);this.material=new be.ShaderMaterial({uniforms:be.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,transparent:!0}),this.material.uniforms.color.value=r,this.material.uniforms.tDiffuse.value=d.texture,this.material.uniforms.textureMatrix.value=c;const u=function(){const t=new be.Vector3,e=new be.Vector3,r=new be.Matrix4,n=new be.Vector3,s=new be.Vector3;return function(o){return t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(o.matrixWorld),n.subVectors(t,e),r.extractRotation(i.matrixWorld),s.set(0,0,1),s.applyMatrix4(r),n.dot(s)<0}}(),p=function(){const t=new be.Vector3,e=new be.Vector3,r=new be.Quaternion,n=new be.Vector3;return function(){i.matrixWorld.decompose(e,r,n),t.set(0,0,1).applyQuaternion(r).normalize(),t.negate(),h.setFromNormalAndCoplanarPoint(t,e)}}(),m=function(){const t=new be.Plane,e=new be.Vector4,i=new be.Vector4;return function(r){l.matrixWorld.copy(r.matrixWorld),l.matrixWorldInverse.copy(l.matrixWorld).invert(),l.projectionMatrix.copy(r.projectionMatrix),l.far=r.far,t.copy(h),t.applyMatrix4(l.matrixWorldInverse),e.set(t.normal.x,t.normal.y,t.normal.z,t.constant);const n=l.projectionMatrix;i.x=(Math.sign(e.x)+n.elements[8])/n.elements[0],i.y=(Math.sign(e.y)+n.elements[9])/n.elements[5],i.z=-1,i.w=(1+n.elements[10])/n.elements[14],e.multiplyScalar(2/e.dot(i)),n.elements[2]=e.x,n.elements[6]=e.y,n.elements[10]=e.z+1-o,n.elements[14]=e.w}}();this.onBeforeRender=function(t,e,r){d.texture.encoding=t.outputEncoding,!0!==r.userData.refractor&&!0!=!u(r)&&(p(),function(t){c.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),c.multiply(t.projectionMatrix),c.multiply(t.matrixWorldInverse),c.multiply(i.matrixWorld)}(r),m(r),function(t,e,r){i.visible=!1;const n=t.getRenderTarget(),s=t.xr.enabled,o=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(d),!1===t.autoClear&&t.clear(),t.render(e,l),t.xr.enabled=s,t.shadowMap.autoUpdate=o,t.setRenderTarget(n);const a=r.viewport;void 0!==a&&t.state.viewport(a),i.visible=!0}(t,e,r))},this.getRenderTarget=function(){return d},this.dispose=function(){d.dispose(),i.material.dispose()}}}su.prototype.isRefractor=!0,su.RefractorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:"\n\n\tuniform mat4 textureMatrix;\n\n\tvarying vec4 vUv;\n\n\tvoid main() {\n\n\t\tvUv = textureMatrix * vec4( position, 1.0 );\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t}",fragmentShader:"\n\n\tuniform vec3 color;\n\tuniform sampler2D tDiffuse;\n\n\tvarying vec4 vUv;\n\n\tfloat blendOverlay( float base, float blend ) {\n\n\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t}\n\n\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t}\n\n\tvoid main() {\n\n\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t}"};class ou extends Vo{constructor(t){super(pt({name:"imagePlane",rotation:[-90/be.MathUtils.RAD2DEG,0,0],geometry:{width:0,height:0},material:{map:null,side:2}},t)),this.type="ImagePlane",this.isImagePlane=!0,this.isSync=!0,this.loaded=!1,this._image=null,this.option.material.map,this.mesh.material.addEventListener("resource.loaded",(t=>{this.loaded=!0;const e=t.resource.data?.image;if(e){this._image=e;const t=e.width/e.height,i=this.option.geometry;0==i.width&&0==i.height&&(i.width=1,i.height=1/t),i.width&&0==i.height&&(i.height=i.width/t),i.height&&0==i.width&&(i.width=i.height*t),this.updateGeometry(i)}this.dispatchEvent({type:"loaded"})}))}get image(){let t=this._image;return t?t.src:""}}class au extends Vo{constructor(t){super(pt({geometry:{width:1,height:1},material:{},video:{src:""}},t)),this.type="VideoPlane",this.isVideoPlane=!0,this._video=null,this.addEventListener("removed",(()=>{this.pause(),this.removeVideo()}))}removeVideo(){this.resource&&(this.video&&this.video.pause(),mo.delete(Kt.VIDEO,this.option.video.src))}updateVideo(t){this.removeVideo(),this.resource=mo.set({type:Kt.VIDEO,id:t.src,object:this,config:t}),this.option.video.src=t.src,this._video=this.resource.data,this.mesh.material.map=this.resource.data}get video(){return this.mesh.material.map?.image}play(){this.video.play()}pause(){this.video.pause()}}class lu{constructor(){this.polygons=[]}clone(){let t=new lu;return t.polygons=this.polygons.map((t=>t.clone())),t}toPolygons(){return this.polygons}union(t){let e=new fu(this.clone().polygons),i=new fu(t.clone().polygons);return e.clipTo(i),i.clipTo(e),i.invert(),i.clipTo(e),i.invert(),e.build(i.allPolygons()),lu.fromPolygons(e.allPolygons())}subtract(t){let e=new fu(this.clone().polygons),i=new fu(t.clone().polygons);return e.invert(),e.clipTo(i),i.clipTo(e),i.invert(),i.clipTo(e),i.invert(),e.build(i.allPolygons()),e.invert(),lu.fromPolygons(e.allPolygons())}intersect(t){let e=new fu(this.clone().polygons),i=new fu(t.clone().polygons);return e.invert(),i.clipTo(e),i.invert(),e.clipTo(i),i.clipTo(e),e.build(i.allPolygons()),e.invert(),lu.fromPolygons(e.allPolygons())}inverse(){let t=this.clone();return t.polygons.forEach((t=>t.flip())),t}}lu.fromPolygons=function(t){let e=new lu;return e.polygons=t,e};class hu{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new hu(this.x,this.y,this.z)}negate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}times(t){return this.x*=t,this.y*=t,this.z*=t,this}dividedBy(t){return this.x/=t,this.y/=t,this.z/=t,this}lerp(t,e){return this.add(cu.copy(t).sub(this).times(e))}unit(){return this.dividedBy(this.length())}length(){return Math.sqrt(this.x**2+this.y**2+this.z**2)}normalize(){return this.unit()}cross(t){let e=this;const i=e.x,r=e.y,n=e.z,s=t.x,o=t.y,a=t.z;return this.x=r*a-n*o,this.y=n*s-i*a,this.z=i*o-r*s,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}}let cu=new hu,du=new hu;class uu{constructor(t,e,i,r){this.pos=(new hu).copy(t),this.normal=(new hu).copy(e),i&&(this.uv=(new hu).copy(i))&&(this.uv.z=0),r&&(this.color=(new hu).copy(r))}clone(){return new uu(this.pos,this.normal,this.uv,this.color)}flip(){this.normal.negate()}interpolate(t,e){return new uu(this.pos.clone().lerp(t.pos,e),this.normal.clone().lerp(t.normal,e),this.uv&&t.uv&&this.uv.clone().lerp(t.uv,e),this.color&&t.color&&this.color.clone().lerp(t.color,e))}}class pu{constructor(t,e){this.normal=t,this.w=e}clone(){return new pu(this.normal.clone(),this.w)}flip(){this.normal.negate(),this.w=-this.w}splitPolygon(t,e,i,r,n){let s=0,o=[];for(let e=0;e<t.vertices.length;e++){let i=this.normal.dot(t.vertices[e].pos)-this.w,r=i<-pu.EPSILON?2:i>pu.EPSILON?1:0;s|=r,o.push(r)}switch(s){case 0:(this.normal.dot(t.plane.normal)>0?e:i).push(t);break;case 1:r.push(t);break;case 2:n.push(t);break;case 3:let s=[],a=[];for(let e=0;e<t.vertices.length;e++){let i=(e+1)%t.vertices.length,r=o[e],n=o[i],l=t.vertices[e],h=t.vertices[i];if(2!=r&&s.push(l),1!=r&&a.push(2!=r?l.clone():l),3==(r|n)){let t=(this.w-this.normal.dot(l.pos))/this.normal.dot(cu.copy(h.pos).sub(l.pos)),e=l.interpolate(h,t);s.push(e),a.push(e.clone())}}s.length>=3&&r.push(new mu(s,t.shared)),a.length>=3&&n.push(new mu(a,t.shared))}}}pu.EPSILON=1e-5,pu.fromPoints=function(t,e,i){let r=cu.copy(e).sub(t).cross(du.copy(i).sub(t)).normalize();return new pu(r.clone(),r.dot(t))};class mu{constructor(t,e){this.vertices=t,this.shared=e,this.plane=pu.fromPoints(t[0].pos,t[1].pos,t[2].pos)}clone(){return new mu(this.vertices.map((t=>t.clone())),this.shared)}flip(){this.vertices.reverse().forEach((t=>t.flip())),this.plane.flip()}}class fu{constructor(t){this.plane=null,this.front=null,this.back=null,this.polygons=[],t&&this.build(t)}clone(){let t=new fu;return t.plane=this.plane&&this.plane.clone(),t.front=this.front&&this.front.clone(),t.back=this.back&&this.back.clone(),t.polygons=this.polygons.map((t=>t.clone())),t}invert(){for(let t=0;t<this.polygons.length;t++)this.polygons[t].flip();this.plane&&this.plane.flip(),this.front&&this.front.invert(),this.back&&this.back.invert();let t=this.front;this.front=this.back,this.back=t}clipPolygons(t){if(!this.plane)return t.slice();let e=[],i=[];for(let r=0;r<t.length;r++)this.plane.splitPolygon(t[r],e,i,e,i);return this.front&&(e=this.front.clipPolygons(e)),i=this.back?this.back.clipPolygons(i):[],e.concat(i)}clipTo(t){this.polygons=t.clipPolygons(this.polygons),this.front&&this.front.clipTo(t),this.back&&this.back.clipTo(t)}allPolygons(){let t=this.polygons.slice();return this.front&&(t=t.concat(this.front.allPolygons())),this.back&&(t=t.concat(this.back.allPolygons())),t}build(t){if(!t.length)return;this.plane||(this.plane=t[0].plane.clone());let e=[],i=[];for(let r=0;r<t.length;r++)this.plane.splitPolygon(t[r],this.polygons,this.polygons,e,i);e.length&&(this.front||(this.front=new fu),this.front.build(e)),i.length&&(this.back||(this.back=new fu),this.back.build(i))}}lu.fromJSON=function(t){return lu.fromPolygons(t.polygons.map((t=>new mu(t.vertices.map((t=>new uu(t.pos,t.normal,t.uv))),t.shared))))};let gu,vu,yu=!1,wu=0,xu={},bu=()=>yu?gu&&!gu.busy?(gu.busy=!0,{then:t=>t(gu)}):{then:function(){return this}}:(yu=!0,fetch("../csg-lib.js").then((function(t){return t.text().then((function(t){t=t.slice(0,t.lastIndexOf("export"));const e=new Blob([t+"\n\t\t\t\t\t\t\t\t\t\tself.onmessage=(message)=>{\n\t\t\t\t\t\t\t\t\t\tlet task = JSON.parse(message.data)\n\t\t\t\t\t\t\t\t\t\t//console.log(\"Got task:\"+task.op+' '+task.taskId)\n\t\t\t\t\t\t\t\t\t\tpostMessage(JSON.stringify({\n\t\t\t\t\t\t\t\t\t\t\t\ttaskId:task.taskId,\n\t\t\t\t\t\t\t\t\t\t\t\tresult : CSG.fromJSON(task.a)[task.op](CSG.fromJSON(task.b))\n\t\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconsole.log('CSG worker started!')"],{type:"application/javascript"});vu=URL.createObjectURL(e)})).then((()=>(()=>{const t=new Worker(vu);return t.onmessage=function(t){let e=JSON.parse(t.data),i=xu[e.taskId];delete xu[e.taskId],i.resolve(lu.fromJSON(e.result)),gu.busy=!1},gu={worker:t,busy:!1}})()))})));lu.doAsync=(t,e,i)=>bu().then((r=>{let n={a:t,op:e,b:i,taskId:wu};return xu[wu]=n,wu++,n.result=new Promise(((t,e)=>{n.resolve=t,r.busy=!0,r.worker.postMessage(JSON.stringify(n))})),n.result})),lu.fromGeometry=function(t,e){let i=[];if(t.isGeometry){let r=t.faces,n=t.vertices,s=["a","b","c"];for(let o=0;o<r.length;o++){let a=r[o],l=[];for(let e=0;e<3;e++)l.push(new uu(n[a[s[e]]],a.vertexNormals[e],t.faceVertexUvs[0][o][e]));i.push(new mu(l,e))}}else if(t.isBufferGeometry){let r,n=t.attributes.position,s=t.attributes.normal,o=t.attributes.uv,a=t.attributes.color;if(t.index)r=t.index.array;else{r=new Array(n.array.length/n.itemSize|0);for(let t=0;t<r.length;t++)r[t]=t}let l=r.length/3|0;i=new Array(l);for(let t=0,l=0,h=r.length;t<h;t+=3,l++){let h=new Array(3);for(let e=0;e<3;e++){let i=r[t+e],l=3*i,c=2*i,d=n.array[l],u=n.array[l+1],p=n.array[l+2],m=s.array[l],f=s.array[l+1],g=s.array[l+2];h[e]=new uu({x:d,y:u,z:p},{x:m,y:f,z:g},o&&{x:o.array[c],y:o.array[c+1],z:0},a&&{x:a.array[c],y:a.array[c+1],z:a.array[c+2]})}i[l]=new mu(h,e)}}else console.error("Unsupported CSG input type:"+t.type);return lu.fromPolygons(i)};let _u=new be.Vector3,Au=new be.Matrix3;lu.fromMesh=function(t,e){let i=lu.fromGeometry(t.geometry,e);Au.getNormalMatrix(t.matrix);for(let e=0;e<i.polygons.length;e++){let r=i.polygons[e];for(let e=0;e<r.vertices.length;e++){let i=r.vertices[e];i.pos.copy(_u.copy(i.pos).applyMatrix4(t.matrix)),i.normal.copy(_u.copy(i.normal).applyMatrix3(Au))}}return i};let Su=t=>({top:0,array:new Float32Array(t),write:function(t){this.array[this.top++]=t.x,this.array[this.top++]=t.y,this.array[this.top++]=t.z}}),Tu=t=>({top:0,array:new Float32Array(t),write:function(t){this.array[this.top++]=t.x,this.array[this.top++]=t.y}});lu.toGeometry=function(t,e=!0){let i,r=t.polygons;if(e){let t=0;r.forEach((e=>t+=e.vertices.length-2)),i=new be.BufferGeometry;let e,n,s=Su(3*t*3),o=Su(3*t*3),a=[];if(r.forEach((i=>{let r=i.vertices,l=r.length;void 0!==i.shared&&(a[i.shared]||(a[i.shared]=[])),l&&(void 0!==r[0].color&&(n||(n=Su(3*t*3))),void 0!==r[0].uv&&(e||(e=Tu(2*t*3))));for(let t=3;t<=l;t++)void 0!==i.shared&&a[i.shared].push(s.top/3,s.top/3+1,s.top/3+2),s.write(r[0].pos),s.write(r[t-2].pos),s.write(r[t-1].pos),o.write(r[0].normal),o.write(r[t-2].normal),o.write(r[t-1].normal),e&&r[0].uv&&(e.write(r[0].uv)||e.write(r[t-2].uv)||e.write(r[t-1].uv)),n&&(n.write(r[0].color)||n.write(r[t-2].color)||n.write(r[t-1].color))})),i.setAttribute("position",new be.BufferAttribute(s.array,3)),i.setAttribute("normal",new be.BufferAttribute(o.array,3)),e&&i.setAttribute("uv",new be.BufferAttribute(e.array,2)),n&&i.setAttribute("color",new be.BufferAttribute(n.array,3)),a.length){let t=[],e=0;for(let r=0;r<a.length;r++)i.addGroup(e,a[r].length,r),e+=a[r].length,t=t.concat(a[r]);i.setIndex(t)}}else{i=new Geometry;let t=i.vertices,e=i.faceVertexUvs[0];for(let n=0;n<r.length;n++){let s=r[n],o=s.vertices,a=t.length,l=o.length;for(let e=0;e<l;e++)t.push((new be.Vector3).copy(o[e].pos));for(let t=3;t<=l;t++){let r=new be.Face3,n=[];e.push(n);let l=r.vertexNormals;r.a=a,r.b=a+t-2,r.c=a+t-1,l.push((new be.Vector3).copy(o[0].normal)),l.push((new be.Vector3).copy(o[t-2].normal)),l.push((new be.Vector3).copy(o[t-1].normal)),n.push((new be.Vector3).copy(o[0].uv)),n.push((new be.Vector3).copy(o[t-2].uv)),n.push((new be.Vector3).copy(o[t-1].uv)),r.normal=(new be.Vector3).copy(s.plane.normal),i.faces.push(r)}}i=(new be.BufferGeometry).fromGeometry(i),i.verticesNeedUpdate=i.elementsNeedUpdate=i.normalsNeedUpdate=!0}return i},lu.toMesh=function(t,e,i){let r=lu.toGeometry(t),n=(new be.Matrix4).copy(e).invert();r.applyMatrix4(n),r.computeBoundingSphere(),r.computeBoundingBox();let s=new be.Mesh(r,i);return s.matrix.copy(e),s.matrix.decompose(s.position,s.quaternion,s.scale),s.rotation.setFromQuaternion(s.quaternion),s.updateMatrixWorld(),s.castShadow=s.receiveShadow=!0,s};const{ClampToEdgeWrapping:Eu,DataTexture:Pu,DataUtils:Mu,FloatType:Cu,HalfFloatType:Lu,LinearFilter:Ru,NearestFilter:Ou,RGBAFormat:Fu,UVMapping:Nu,UniformsLib:Du}=be;class Iu{static init(){const t=[1,0,0,2e-5,1,0,0,503905e-9,1,0,0,.00201562,1,0,0,.00453516,1,0,0,.00806253,1,0,0,.0125978,1,0,0,.018141,1,0,0,.0246924,1,0,0,.0322525,1,0,0,.0408213,1,0,0,.0503999,1,0,0,.0609894,1,0,0,.0725906,1,0,0,.0852058,1,0,0,.0988363,1,0,0,.113484,1,0,0,.129153,1,0,0,.145839,1,0,0,.163548,1,0,0,.182266,1,0,0,.201942,1,0,0,.222314,1,0,0,.241906,1,0,0,.262314,1,0,0,.285754,1,0,0,.310159,1,0,0,.335426,1,0,0,.361341,1,0,0,.387445,1,0,0,.412784,1,0,0,.438197,1,0,0,.466966,1,0,0,.49559,1,0,0,.523448,1,0,0,.549938,1,0,0,.57979,1,0,0,.608746,1,0,0,.636185,1,0,0,.664748,1,0,0,.69313,1,0,0,.71966,1,0,0,.747662,1,0,0,.774023,1,0,0,.799775,1,0,0,.825274,1,0,0,.849156,1,0,0,.873248,1,0,0,.89532,1,0,0,.917565,1,0,0,.937863,1,0,0,.958139,1,0,0,.976563,1,0,0,.994658,1,0,0,1.0112,1,0,0,1.02712,1,0,0,1.04189,1,0,0,1.05568,1,0,0,1.06877,1,0,0,1.08058,1,0,0,1.09194,1,0,0,1.10191,1,0,0,1.11161,1,0,0,1.1199,1,0,0,1.12813,.999547,-4.48815e-7,.0224417,199902e-10,.999495,-113079e-10,.0224406,503651e-9,.999496,-452317e-10,.0224406,.00201461,.999496,-101772e-9,.0224406,.00453287,.999495,-180928e-9,.0224406,.00805845,.999497,-282702e-9,.0224406,.0125914,.999496,-407096e-9,.0224406,.0181319,.999498,-554114e-9,.0224406,.02468,.999499,-723768e-9,.0224406,.0322363,.999495,-916058e-9,.0224405,.0408009,.999499,-.00113101,.0224408,.050375,.999494,-.00136863,.0224405,.0609586,.999489,-.00162896,.0224401,.0725537,.999489,-.00191201,.0224414,.0851619,.999498,-.00221787,.0224413,.0987867,.999492,-.00254642,.0224409,.113426,.999507,-.00289779,.0224417,.129088,.999494,-.0032716,.0224386,.145767,.999546,-.0036673,.0224424,.163472,.999543,-.00408166,.0224387,.182182,.999499,-.00450056,.0224338,.201843,.999503,-.00483661,.0224203,.222198,.999546,-.00452928,.022315,.241714,.999508,-.00587403,.0224329,.262184,.999509,-.00638806,.0224271,.285609,.999501,-.00691028,.0224166,.309998,.999539,-.00741979,.0223989,.335262,.999454,-.00786282,.0223675,.361154,.999529,-.00811928,.0222828,.387224,.999503,-.00799941,.0221063,.41252,.999561,-.00952753,.0223057,.438006,.999557,-.0099134,.0222065,.466735,.999541,-.0100935,.0220402,.495332,.999562,-.00996821,.0218067,.523197,.999556,-.0105031,.0217096,.550223,.999561,-.0114191,.0217215,.579498,.999588,-.0111818,.0213357,.608416,.999633,-.0107725,.0208689,.635965,.999527,-.0121671,.0210149,.664476,.999508,-.0116005,.020431,.692786,.999568,-.0115604,.0199791,.719709,.999671,-.0121117,.0197415,.74737,.999688,-.0110769,.0188846,.773692,.99962,-.0122368,.0188452,.799534,.999823,-.0110325,.0178001,.825046,.999599,-.0114923,.0174221,.849075,.999619,-.0105923,.0164345,.872999,.999613,-.0105988,.0158227,.895371,.99964,-.00979861,.0148131,.917364,.99977,-.00967238,.0140721,.938002,.999726,-.00869175,.0129543,.957917,.99973,-.00866872,.0122329,.976557,.999773,-.00731956,.0108958,.994459,.999811,-.00756027,.0102715,1.01118,.999862,-.00583732,.00878781,1.02701,.999835,-.00631438,.00827529,1.04186,.999871,-.00450785,.00674583,1.05569,.999867,-.00486079,.00621041,1.06861,.999939,-.00322072,.00478301,1.08064,.999918,-.00318199,.00406395,1.09181,1.00003,-.00193348,.00280682,1.10207,.999928,-.00153729,.00198741,1.11152,.999933,-623666e-9,917714e-9,1.12009,1,-102387e-11,9.07581e-7,1.12813,.997866,-8.96716e-7,.0448334,199584e-10,.997987,-225945e-10,.0448389,502891e-9,.997987,-903781e-10,.0448388,.00201156,.997985,-203351e-9,.0448388,.00452602,.997986,-361514e-9,.0448388,.00804629,.997987,-56487e-8,.0448389,.0125724,.997988,-813423e-9,.0448389,.0181045,.997984,-.00110718,.0448387,.0246427,.997985,-.00144616,.0448388,.0321875,.997987,-.00183038,.044839,.0407392,.997983,-.00225987,.0448387,.0502986,.997991,-.00273467,.0448389,.0608667,.997984,-.00325481,.0448384,.0724444,.998002,-.00382043,.044839,.0850348,.997997,-.00443145,.0448396,.0986372,.998007,-.00508796,.0448397,.113255,.998008,-.00578985,.04484,.128891,.998003,-.00653683,.0448384,.145548,.997983,-.00732713,.0448358,.163221,.997985,-.00815454,.0448358,.181899,.998005,-.00898985,.0448286,.201533,.998026,-.00964404,.0447934,.221821,.998055,-.00922677,.044611,.241282,.99804,-.0117361,.0448245,.261791,.998048,-.0127628,.0448159,.285181,.998088,-.0138055,.0447996,.30954,.998058,-.0148206,.0447669,.334751,.998099,-.0156998,.044697,.36061,.998116,-.0161976,.0445122,.386603,.998195,-.015945,.0441711,.411844,.998168,-.0183947,.0444255,.43773,.998184,-.0197913,.0443809,.466009,.998251,-.0201426,.0440689,.494574,.998305,-.0198847,.0435632,.522405,.998273,-.0210577,.043414,.549967,.998254,-.0227901,.0433943,.578655,.998349,-.0223108,.0426529,.60758,.99843,-.0223088,.042,.635524,.998373,-.0241141,.0418987,.663621,.998425,-.0231446,.0408118,.691906,.998504,-.0233684,.0400565,.719339,.998443,-.0241652,.0394634,.74643,.99848,-.0228715,.0380002,.773086,.998569,-.023519,.0372322,.798988,.998619,-.0223108,.0356468,.824249,.998594,-.0223105,.034523,.848808,.998622,-.0213426,.0328887,.87227,.998669,-.0207912,.0314374,.895157,.998705,-.0198416,.0296925,.916769,.998786,-.0189168,.0279634,.937773,.998888,-.0178811,.0261597,.957431,.99906,-.0166845,.0242159,.976495,.999038,-.0155464,.0222638,.994169,.999237,-.0141349,.0201967,1.01112,.999378,-.0129324,.0181744,1.02692,.999433,-.0113192,.0159898,1.04174,.999439,-.0101244,.0140385,1.05559,.999614,-.00837456,.0117826,1.06852,.999722,-.00721769,.00983745,1.08069,.999817,-.00554067,.00769002,1.09176,.99983,-.00426961,.005782,1.10211,.999964,-.00273904,.00374503,1.11152,1.00001,-.00136739,.00187176,1.12031,.999946,393227e-10,-28919e-9,1.12804,.995847,-13435e-10,.0671785,19916e-9,.995464,-338387e-10,.0671527,501622e-9,.99547,-135355e-9,.0671531,.00200649,.995471,-30455e-8,.0671532,.00451461,.99547,-541423e-9,.0671531,.008026,.995471,-84598e-8,.0671531,.0125407,.99547,-.00121823,.0671531,.0180589,.99547,-.00165817,.0671531,.0245806,.995463,-.00216583,.0671526,.0321062,.995468,-.00274127,.0671527,.0406366,.995474,-.00338447,.0671534,.0501717,.995473,-.00409554,.0671533,.0607131,.995478,-.00487451,.0671531,.0722618,.995476,-.00572148,.0671532,.0848191,.995477,-.00663658,.0671539,.0983882,.995498,-.00761986,.0671541,.112972,.995509,-.00867094,.0671542,.128568,.995509,-.00978951,.0671531,.145183,.995503,-.0109725,.0671491,.162808,.995501,-.012211,.0671465,.181441,.99553,-.0134565,.0671371,.201015,.99555,-.014391,.0670831,.221206,.99558,-.014351,.0668883,.240813,.995577,-.0173997,.0671055,.261257,.995602,-.0191111,.0671178,.284467,.995623,-.0206705,.0670946,.308765,.995658,-.022184,.0670472,.333905,.995705,-.0234832,.0669417,.359677,.995719,-.0241933,.0666714,.385554,.995786,-.0243539,.066266,.410951,.995887,-.0271866,.0664367,.437163,.995944,-.0296012,.0664931,.464842,.996004,-.0301045,.0660105,.49332,.996128,-.0298311,.0652694,.521131,.996253,-.0316426,.0650739,.549167,.996244,-.0339043,.0649433,.57737,.996309,-.033329,.0638926,.606073,.996417,-.0338935,.0630849,.634527,.996372,-.0353104,.0625083,.66256,.996542,-.0348942,.0611986,.690516,.996568,-.0351614,.060069,.718317,.996711,-.0354317,.0588522,.74528,.996671,-.0349513,.0571902,.772061,.996865,-.0345622,.0555321,.798089,.996802,-.0342566,.0537816,.823178,.996992,-.0330862,.0516095,.847949,.996944,-.0324666,.0495537,.871431,.997146,-.0309544,.0470302,.894357,.997189,-.0299372,.0446043,.916142,.997471,-.0281389,.0418812,.937193,.997515,-.0268702,.0391823,.957,.997812,-.0247166,.0361338,.975936,.998027,-.0233525,.0333945,.99391,.998233,-.0209839,.0301917,1.01075,.998481,-.0194309,.027271,1.02669,.998859,-.0169728,.0240162,1.04173,.99894,-.0152322,.0210517,1.05551,.999132,-.0127497,.0178632,1.06856,.999369,-.0108282,.014787,1.08054,.999549,-.00845886,.0116185,1.09185,.999805,-.0063937,.00867209,1.10207,.99985,-.00414582,.00566823,1.1117,.999912,-.00207443,.00277562,1.12022,1.00001,870226e-10,-53766e-9,1.12832,.991943,-178672e-11,.0893382,198384e-10,.991952,-450183e-10,.089339,499849e-9,.991956,-180074e-9,.0893394,.0019994,.991955,-405167e-9,.0893393,.00449867,.991953,-720298e-9,.0893391,.00799764,.991955,-.00112548,.0893393,.0124964,.991957,-.0016207,.0893395,.0179951,.991958,-.00220601,.0893396,.0244939,.991947,-.00288137,.0893385,.0319929,.991962,-.00364693,.0893399,.0404933,.991965,-.00450264,.0893399,.049995,.99198,-.00544862,.0893411,.0604995,.99197,-.00648491,.0893397,.0720074,.991976,-.00761164,.089341,.0845207,.99198,-.00882891,.0893405,.0980413,.991982,-.0101367,.0893396,.112571,.992008,-.011535,.0893415,.128115,.992026,-.0130228,.0893414,.144672,.992064,-.0145966,.0893418,.162241,.992041,-.0162421,.0893359,.180801,.992086,-.0178888,.0893214,.200302,.992157,-.0190368,.0892401,.220332,.992181,-.0195584,.0890525,.240144,.992175,-.0227257,.0892153,.260728,.99221,-.0254195,.089304,.283473,.99222,-.0274883,.0892703,.307673,.992317,-.0294905,.0892027,.332729,.992374,-.0311861,.0890577,.358387,.992505,-.0320656,.0886994,.384102,.992568,-.0329715,.0883198,.409767,.992675,-.036006,.0883602,.436145,.992746,-.0392897,.0884591,.463217,.992873,-.0399337,.0878287,.491557,.992934,-.040231,.0870108,.519516,.993091,-.0422013,.0865857,.547741,.993259,-.0443503,.0861937,.575792,.993455,-.0446368,.0851187,.604233,.993497,-.0454299,.0840576,.632925,.993694,-.0463296,.0829671,.660985,.993718,-.0470619,.0817185,.688714,.993973,-.0468838,.0800294,.716743,.994207,-.046705,.0781286,.74377,.994168,-.0469698,.0763337,.77042,.9945,-.0456816,.0738184,.796659,.994356,-.0455518,.0715545,.821868,.994747,-.0439488,.0686085,.846572,.994937,-.0430056,.065869,.870435,.995142,-.0413414,.0626446,.893272,.995451,-.0396521,.05929,.915376,.995445,-.0378453,.0558503,.936196,.995967,-.0355219,.0520949,.956376,.996094,-.0335146,.048377,.975327,.996622,-.030682,.0442575,.993471,.996938,-.0285504,.0404693,1.01052,.997383,-.0253399,.0360903,1.02637,.997714,-.0231651,.0322176,1.04139,.998249,-.0198138,.0278433,1.05542,.998596,-.0174337,.0238759,1.06846,.998946,-.0141349,.0195944,1.08056,.99928,-.0115603,.0156279,1.09181,.999507,-.00839065,.0114607,1.10213,.999697,-.005666,.00763325,1.11169,.999869,-.00269902,.00364946,1.12042,1.00001,623836e-10,-319288e-10,1.12832,.987221,-222675e-11,.111332,197456e-10,.98739,-561116e-10,.111351,497563e-9,.987448,-224453e-9,.111357,.00199031,.987441,-505019e-9,.111357,.0044782,.987442,-897816e-9,.111357,.00796129,.987442,-.00140284,.111357,.0124396,.987444,-.00202012,.111357,.0179132,.987442,-.00274964,.111357,.0243824,.987446,-.00359147,.111357,.0318474,.987435,-.00454562,.111356,.0403086,.987461,-.00561225,.111358,.0497678,.987458,-.00679125,.111358,.0602239,.987443,-.0080828,.111356,.0716792,.987476,-.0094872,.111358,.0841364,.98749,-.0110044,.111361,.097597,.987508,-.0126344,.111362,.112062,.987494,-.0143767,.111357,.127533,.987526,-.0162307,.111359,.144015,.987558,-.0181912,.111361,.161502,.987602,-.0202393,.111355,.179979,.987692,-.022273,.111346,.199386,.987702,-.0235306,.111215,.219183,.987789,-.0247628,.111061,.239202,.987776,-.0280668,.111171,.259957,.987856,-.0316751,.111327,.282198,.987912,-.0342468,.111282,.306294,.988,-.0367205,.111198,.331219,.988055,-.0387766,.110994,.356708,.988241,-.0397722,.110547,.382234,.988399,-.0416076,.110198,.408227,.988539,-.0448192,.110137,.434662,.988661,-.0483793,.110143,.461442,.988967,-.0495895,.109453,.489318,.989073,-.0506797,.108628,.517516,.989274,-.0526953,.108003,.545844,.989528,-.054578,.107255,.573823,.989709,-.0561503,.106294,.601944,.989991,-.056866,.104896,.630855,.990392,-.0572914,.103336,.658925,.990374,-.0586224,.10189,.686661,.990747,-.0584764,.099783,.714548,.991041,-.0582662,.0974309,.74186,.991236,-.0584118,.0951678,.768422,.991585,-.0573055,.0921581,.794817,.991984,-.0564241,.0891167,.820336,.9921,-.0553608,.085805,.84493,.992749,-.0533816,.0820354,.868961,.99288,-.0518661,.0782181,.891931,.993511,-.0492492,.0738935,.914186,.993617,-.0471956,.0696402,.93532,.99411,-.044216,.0649659,.95543,.994595,-.0416654,.0603177,.974685,.994976,-.0384314,.0553493,.992807,.995579,-.0353491,.0503942,1.00996,.996069,-.0319787,.0452123,1.02606,.996718,-.028472,.0400112,1.04114,.997173,-.0250789,.0349456,1.05517,.997818,-.0213326,.029653,1.0683,.998318,-.0178509,.024549,1.0805,.998853,-.0141118,.0194197,1.09177,.999218,-.0105914,.0143869,1.1022,.999594,-.00693474,.00943517,1.11175,.99975,-.00340478,.00464051,1.12056,1.00001,109172e-9,-112821e-9,1.12853,.983383,-266524e-11,.133358,196534e-10,.981942,-671009e-10,.133162,494804e-9,.981946,-268405e-9,.133163,.00197923,.981944,-603912e-9,.133163,.00445326,.981941,-.00107362,.133162,.00791693,.981946,-.00167755,.133163,.0123703,.981944,-.00241569,.133162,.0178135,.981945,-.00328807,.133163,.0242466,.981945,-.00429472,.133162,.03167,.981955,-.00543573,.133164,.0400846,.981951,-.00671105,.133163,.0494901,.981968,-.00812092,.133165,.0598886,.981979,-.00966541,.133166,.0712811,.981996,-.0113446,.133168,.083669,.982014,-.0131585,.133169,.0970533,.982011,-.0151073,.133167,.111438,.982062,-.0171906,.133172,.126826,.9821,-.0194067,.133175,.143215,.982149,-.0217502,.133176,.160609,.982163,-.0241945,.133173,.178981,.982247,-.0265907,.133148,.198249,.982291,-.027916,.132974,.217795,.982396,-.0299663,.132868,.238042,.982456,-.0334544,.132934,.258901,.982499,-.0378636,.133137,.280639,.982617,-.0409274,.133085,.304604,.98274,-.0438523,.132985,.329376,.982944,-.0462288,.132728,.354697,.98308,-.0475995,.132228,.380102,.983391,-.0501901,.131924,.406256,.983514,-.0535899,.131737,.432735,.98373,-.0571858,.131567,.459359,.984056,-.0592353,.130932,.486637,.984234,-.0610488,.130092,.51509,.984748,-.0630758,.12923,.543461,.985073,-.0647398,.128174,.571376,.985195,-.0671941,.127133,.599414,.985734,-.0681345,.125576,.628134,.986241,-.0686089,.123639,.656399,.986356,-.0698511,.121834,.684258,.986894,-.0700931,.119454,.711818,.987382,-.0698321,.116718,.739511,.988109,-.0693975,.113699,.766267,.988363,-.0689584,.110454,.792456,.989112,-.0672353,.106602,.81813,.989241,-.0662034,.10267,.842889,.990333,-.0638938,.0981381,.867204,.990591,-.0618534,.0935388,.89038,.991106,-.0593117,.088553,.912576,.991919,-.0562676,.0832187,.934118,.992111,-.0534085,.0778302,.954254,.992997,-.0495459,.0720453,.973722,.993317,-.0463707,.0663458,.991949,.994133,-.0421245,.0601883,1.00936,.994705,-.0384977,.0542501,1.02559,.995495,-.0340956,.0479862,1.04083,.996206,-.030105,.041887,1.05497,.996971,-.0256095,.0355355,1.06824,.997796,-.0213932,.0293655,1.08056,.998272,-.0169612,.0232926,1.09182,.998857,-.0126756,.0172786,1.10219,.99939,-.00832486,.0113156,1.11192,.999752,-.00410826,.00557892,1.12075,1,150957e-9,-119101e-9,1.12885,.975169,-309397e-11,.154669,195073e-10,.975439,-779608e-10,.154712,491534e-9,.975464,-311847e-9,.154716,.00196617,.975464,-701656e-9,.154716,.00442387,.975462,-.0012474,.154715,.0078647,.975461,-.00194906,.154715,.0122886,.975464,-.00280667,.154715,.0176959,.975468,-.00382025,.154716,.0240867,.975471,-.00498985,.154716,.0314612,.975472,-.00631541,.154717,.0398199,.975486,-.00779719,.154718,.0491639,.975489,-.00943505,.154718,.0594932,.975509,-.0112295,.154721,.0708113,.97554,-.0131802,.154724,.0831176,.975557,-.0152876,.154726,.096415,.975585,-.0175512,.154728,.110705,.975605,-.0199713,.154729,.125992,.975645,-.0225447,.154729,.142272,.975711,-.0252649,.154735,.159549,.975788,-.0280986,.154736,.177805,.975872,-.0308232,.154704,.196911,.975968,-.0324841,.154525,.216324,.976063,-.0351281,.154432,.236628,.976157,-.0388618,.15446,.257539,.976204,-.0437704,.154665,.278975,.976358,-.047514,.154652,.302606,.976571,-.0508638,.154535,.327204,.976725,-.0534995,.154221,.352276,.977013,-.0555547,.153737,.377696,.977294,-.0586728,.153403,.403855,.977602,-.0622715,.15312,.430333,.977932,-.0658166,.152755,.456855,.978241,-.0689877,.152233,.483668,.978602,-.0712805,.15132,.512097,.979234,-.0732775,.150235,.540455,.97977,-.075163,.148978,.568486,.979995,-.0778026,.147755,.596524,.98078,-.0791854,.146019,.624825,.981628,-.0799666,.143906,.653403,.982067,-.0808532,.141561,.681445,.98271,-.0816024,.139025,.708918,.983734,-.0812511,.135764,.736594,.98431,-.0806201,.132152,.763576,.985071,-.0801605,.12846,.789797,.98618,-.0784208,.124084,.815804,.986886,-.0766643,.1193,.840869,.987485,-.0747744,.114236,.864952,.988431,-.0716701,.108654,.888431,.988886,-.0691609,.102994,.910963,.990024,-.0654048,.0967278,.932629,.990401,-.0619765,.090384,.95313,.991093,-.0579296,.0837885,.972587,.992018,-.0536576,.0770171,.991184,.992536,-.0493719,.0701486,1.00863,.993421,-.0444813,.062953,1.02494,.993928,-.040008,.0560455,1.04017,.994994,-.0347982,.04856,1.05463,.995866,-.0301017,.0416152,1.06807,.996916,-.0248225,.0342597,1.08039,.997766,-.0199229,.0271668,1.09177,.998479,-.0147422,.0201387,1.10235,.99921,-.00980173,.0131944,1.11206,.999652,-.0047426,.00640712,1.12104,.999998,891673e-10,-10379e-8,1.12906,.967868,-351885e-11,.175947,193569e-10,.968001,-886733e-10,.175972,487782e-9,.96801,-354697e-9,.175973,.00195115,.968012,-798063e-9,.175974,.00439006,.968011,-.00141879,.175973,.00780461,.968011,-.00221686,.175973,.0121948,.968016,-.00319231,.175974,.0175607,.968019,-.00434515,.175974,.0239027,.968018,-.00567538,.175974,.0312208,.968033,-.00718308,.175977,.0395158,.968049,-.00886836,.175979,.0487885,.968047,-.0107312,.175978,.0590394,.968072,-.0127719,.175981,.0702705,.968108,-.0149905,.175986,.0824836,.968112,-.0173866,.175985,.0956783,.968173,-.0199611,.175993,.109862,.96827,-.0227128,.176008,.125033,.968292,-.025639,.17601,.141193,.968339,-.0287299,.176007,.158336,.968389,-.0319399,.176001,.176441,.968501,-.034941,.175962,.195359,.968646,-.0370812,.175793,.214686,.968789,-.0402329,.175708,.234973,.96886,-.0442601,.1757,.255871,.969013,-.049398,.175876,.277238,.969242,-.0539932,.17594,.300326,.969419,-.0577299,.175781,.324702,.969763,-.0605643,.175432,.349527,.970093,-.0634488,.174992,.374976,.970361,-.0670589,.174611,.401097,.970825,-.0708246,.174226,.427496,.971214,-.0742871,.173684,.453858,.971622,-.0782608,.173186,.480637,.972175,-.0813151,.172288,.508655,.972944,-.0832678,.170979,.536973,.973595,-.0855964,.169573,.565138,.974345,-.0882163,.168152,.593222,.975233,-.0901671,.166314,.621201,.976239,-.0912111,.163931,.649919,.977289,-.0916959,.161106,.678011,.978076,-.0927061,.158272,.705717,.979533,-.0925562,.15475,.733228,.980335,-.0918159,.150638,.760454,.981808,-.0908508,.146201,.786918,.983061,-.0896172,.141386,.812953,.984148,-.0871588,.135837,.838281,.985047,-.0850624,.130135,.862594,.986219,-.0818541,.123882,.88633,.987043,-.0784523,.117126,.908952,.988107,-.0749601,.110341,.930744,.988955,-.0703548,.102885,.951728,.989426,-.0662798,.0954167,.971166,.990421,-.0610834,.0876331,.989984,.991032,-.0562936,.0797785,1.00765,.992041,-.0508154,.0718166,1.02434,.992794,-.0454045,.0637125,1.03976,.993691,-.0398194,.0555338,1.05418,.994778,-.0341482,.0473388,1.06772,.995915,-.028428,.0391016,1.08028,.997109,-.022642,.0309953,1.09185,.998095,-.0168738,.0230288,1.10247,.998985,-.0111274,.0150722,1.11229,.999581,-.00543881,.00740605,1.12131,1.00003,162239e-9,-105549e-9,1.12946,.959505,-393734e-11,.196876,191893e-10,.959599,-992157e-10,.196895,483544e-9,.959641,-396868e-9,.196903,.0019342,.959599,-892948e-9,.196895,.00435193,.959603,-.00158747,.196896,.0077368,.959604,-.00248042,.196896,.0120888,.959605,-.00357184,.196896,.0174082,.959605,-.00486169,.196896,.0236949,.959613,-.00635008,.196897,.0309497,.959619,-.00803696,.196898,.0391725,.959636,-.00992255,.196901,.0483649,.959634,-.0120067,.1969,.0585266,.959675,-.0142898,.196906,.0696609,.959712,-.0167717,.196911,.0817678,.959752,-.0194524,.196918,.0948494,.959807,-.0223321,.196925,.10891,.959828,-.0254091,.196924,.123947,.959906,-.0286815,.196934,.139968,.960005,-.0321371,.196944,.156968,.960071,-.0357114,.196936,.17491,.960237,-.0389064,.196882,.193597,.960367,-.041623,.196731,.21285,.960562,-.0452655,.196654,.233075,.960735,-.0496207,.196643,.253941,.960913,-.0549379,.196774,.275278,.961121,-.0603414,.196893,.297733,.96139,-.0644244,.196717,.321877,.961818,-.067556,.196314,.346476,.962175,-.0712709,.195917,.371907,.96255,-.0752848,.1955,.397916,.963164,-.0792073,.195026,.424229,.963782,-.0828225,.194424,.450637,.964306,-.0873119,.193831,.477288,.964923,-.0911051,.192973,.504716,.966048,-.093251,.19151,.533053,.967024,-.0958983,.190013,.561366,.968038,-.09835,.188253,.589464,.969152,-.100754,.186257,.617433,.970557,-.102239,.183775,.645801,.972104,-.102767,.180645,.674278,.973203,-.103492,.177242,.702004,.975123,-.103793,.17345,.729529,.97641,-.102839,.168886,.756712,.978313,-.101687,.163892,.783801,.980036,-.100314,.158439,.809671,.981339,-.097836,.152211,.835402,.982794,-.0950006,.145679,.860081,.984123,-.0920994,.138949,.883757,.984918,-.0878641,.131283,.90685,.985999,-.083939,.123464,.928786,.987151,-.0791234,.115324,.94983,.987827,-.0739332,.106854,.96962,.988806,-.0688088,.0982691,.98861,.989588,-.0628962,.0893456,1.00667,.990438,-.0573146,.0805392,1.02344,.991506,-.0509433,.0713725,1.03933,.992492,-.0448724,.0623732,1.05378,.993663,-.0383497,.0530838,1.06747,.994956,-.0319593,.0439512,1.08007,.99634,-.025401,.0347803,1.09182,.99761,-.0189687,.0257954,1.1025,.99863,-.0124441,.0169893,1.11247,.99947,-.00614003,.00829498,1.12151,1.00008,216624e-9,-146107e-9,1.12993,.950129,-434955e-11,.217413,190081e-10,.950264,-10957e-8,.217444,47884e-8,.9503,-438299e-9,.217451,.00191543,.950246,-986124e-9,.21744,.00430951,.950246,-.00175311,.21744,.00766137,.950245,-.00273923,.21744,.011971,.950253,-.00394453,.217441,.0172385,.950258,-.00536897,.217442,.0234641,.950267,-.00701262,.217444,.030648,.950277,-.00887551,.217446,.038791,.950284,-.0109576,.217446,.0478931,.950312,-.0132591,.217451,.0579568,.950334,-.01578,.217454,.0689821,.950378,-.0185204,.217462,.0809714,.950417,-.0214803,.217467,.0939265,.950488,-.0246594,.217479,.10785,.950534,-.0280565,.217483,.122743,.950633,-.0316685,.217498,.138611,.950698,-.0354787,.217499,.155442,.950844,-.0394003,.217507,.173208,.950999,-.0426812,.217419,.191605,.951221,-.0461302,.217317,.21084,.951412,-.0502131,.217238,.230945,.951623,-.0549183,.21722,.251745,.951867,-.0604493,.217306,.273001,.952069,-.0665189,.217466,.294874,.952459,-.0709179,.217266,.318732,.952996,-.0746112,.216891,.34318,.953425,-.0789252,.216503,.36849,.953885,-.0833293,.216042,.394373,.954617,-.087371,.215469,.420505,.955429,-.0914054,.214802,.446907,.956068,-.0961671,.214146,.473522,.957094,-.10048,.213286,.50052,.958372,-.103248,.211796,.528715,.959654,-.106033,.21016,.557065,.961305,-.108384,.208149,.585286,.962785,-.111122,.206024,.613334,.964848,-.112981,.203442,.641334,.966498,-.113717,.19996,.669955,.968678,-.114121,.196105,.698094,.970489,-.114524,.191906,.725643,.972903,-.113792,.186963,.752856,.974701,-.112406,.181343,.780013,.976718,-.110685,.175185,.806268,.978905,-.108468,.168535,.832073,.980267,-.105061,.161106,.857149,.981967,-.101675,.153387,.881145,.983063,-.0974492,.145199,.904255,.984432,-.0925815,.136527,.926686,.985734,-.0877983,.127584,.947901,.986228,-.081884,.118125,.968111,.98719,-.0761208,.108594,.98719,.988228,-.0698196,.0989996,1.00559,.989046,-.0632739,.0890074,1.02246,.990242,-.056522,.0790832,1.03841,.991252,-.0495272,.0689182,1.05347,.992542,-.0425373,.0588592,1.06724,.994096,-.0353198,.0486833,1.08009,.995593,-.028235,.0385977,1.09177,.99711,-.0209511,.0286457,1.10274,.998263,-.0139289,.0188497,1.11262,.999254,-.0067359,.009208,1.12191,.999967,141846e-9,-657764e-10,1.13024,.935608,-474692e-11,.236466,187817e-10,.93996,-11971e-8,.237568,473646e-9,.939959,-478845e-9,.237567,.0018946,.939954,-.0010774,.237566,.00426284,.939956,-.00191538,.237566,.00757842,.939954,-.00299277,.237566,.0118413,.93996,-.00430961,.237567,.0170518,.939969,-.00586589,.237569,.02321,.939982,-.00766166,.237572,.0303164,.939987,-.00969686,.237572,.0383711,.939997,-.0119715,.237574,.0473751,.940031,-.0144858,.237581,.0573298,.940073,-.0172399,.237589,.0682366,.94012,-.0202335,.237598,.080097,.940162,-.0234663,.237604,.0929116,.940237,-.0269387,.237615,.106686,.940328,-.0306489,.237632,.121421,.940419,-.0345917,.237645,.137115,.940522,-.0387481,.237654,.153766,.940702,-.0429906,.237661,.17133,.940871,-.0465089,.237561,.189502,.941103,-.050531,.23748,.208616,.941369,-.0550657,.237423,.228595,.941641,-.0601337,.237399,.249287,.941903,-.0658804,.237443,.270467,.942224,-.0722674,.237597,.292024,.942633,-.0771788,.237419,.315272,.943172,-.0815623,.237068,.339579,.943691,-.0863973,.236682,.364717,.944382,-.0911536,.236213,.390435,.945392,-.0952967,.235562,.416425,.946185,-.0998948,.234832,.442772,.947212,-.104796,.234114,.469347,.948778,-.10928,.233222,.496162,.950149,-.113081,.231845,.523978,.951989,-.115893,.230005,.552295,.953921,-.11846,.227862,.580569,.955624,-.12115,.225439,.608698,.958234,-.123373,.222635,.636696,.960593,-.124519,.219093,.665208,.963201,-.124736,.214749,.693557,.965642,-.125012,.210059,.721334,.968765,-.124661,.204935,.748613,.971753,-.122996,.198661,.776224,.973751,-.120998,.191823,.802461,.976709,-.118583,.184359,.828399,.977956,-.115102,.176437,.853693,.979672,-.111077,.167681,.877962,.981816,-.10688,.158872,.901564,.98238,-.101469,.149398,.924057,.983964,-.0960013,.139436,.945751,.984933,-.0899626,.12943,.966272,.985694,-.0832973,.11894,.985741,.986822,-.0767082,.108349,1.00407,.987725,-.0693614,.0976026,1.02154,.98877,-.06211,.086652,1.03757,.990129,-.0544143,.0756182,1.05296,.991337,-.046744,.0645753,1.06683,.992978,-.0387931,.0534683,1.0798,.994676,-.030973,.0424137,1.09181,.99645,-.0230311,.0314035,1.10286,.997967,-.0152065,.0206869,1.11291,.99922,-.00744837,.010155,1.12237,1.00002,240209e-9,-752767e-10,1.13089,.922948,-515351e-11,.255626,186069e-10,.928785,-129623e-9,.257244,468009e-9,.928761,-51849e-8,.257237,.00187202,.928751,-.0011666,.257235,.00421204,.928751,-.00207395,.257234,.0074881,.928754,-.00324055,.257235,.0117002,.92876,-.00466639,.257236,.0168486,.928763,-.00635149,.257237,.0229334,.928774,-.00829584,.257239,.029955,.928791,-.0104995,.257243,.0379139,.928804,-.0129623,.257245,.0468108,.928847,-.0156846,.257255,.0566473,.92889,-.0186661,.257263,.0674246,.928924,-.0219067,.257268,.0791433,.928989,-.0254066,.257282,.0918076,.92909,-.0291651,.257301,.105419,.92918,-.0331801,.257316,.119978,.92929,-.0374469,.257332,.135491,.929453,-.041939,.257357,.151948,.929586,-.0464612,.257347,.169275,.929858,-.0503426,.257269,.187257,.930125,-.0548409,.257199,.206204,.930403,-.0598063,.257149,.22601,.930726,-.0652437,.257122,.246561,.931098,-.0712376,.257153,.267618,.931396,-.0777506,.257237,.288993,.931947,-.0832374,.257124,.311527,.932579,-.0883955,.25683,.335697,.933194,-.0937037,.256444,.360634,.934013,-.0987292,.255939,.386126,.935307,-.103215,.255282,.412018,.936374,-.108234,.254538,.438292,.93776,-.113234,.253728,.464805,.939599,-.118013,.25275,.491464,.941036,-.122661,.251404,.518751,.94337,-.125477,.249435,.547133,.945318,-.128374,.247113,.575456,.947995,-.130996,.244441,.60372,.950818,-.133438,.241352,.63174,.954378,-.135004,.237849,.659971,.957151,-.135313,.233188,.688478,.960743,-.13521,.228001,.716767,.964352,-.135007,.222249,.744349,.967273,-.133523,.21542,.771786,.969767,-.131155,.208039,.798639,.973195,-.128492,.200076,.824774,.975557,-.125094,.191451,.850222,.977692,-.120578,.18184,.874761,.98026,-.115882,.172102,.898497,.981394,-.110372,.161859,.921636,.982386,-.10415,.15108,.943467,.983783,-.0978128,.140407,.964045,.98422,-.0906171,.129058,.98398,.985447,-.0832921,.117614,1.00276,.986682,-.0754412,.10585,1.02047,.987326,-.0673885,.0940943,1.03678,.988707,-.0592565,.0822093,1.05218,.990185,-.050717,.070192,1.06652,.991866,-.0423486,.0582081,1.07965,.993897,-.0336118,.0460985,1.09188,.995841,-.0252178,.0342737,1.10307,.997605,-.0164893,.0224829,1.11324,.999037,-.00817112,.0110647,1.12262,1.00003,291686e-9,-168673e-9,1.13139,.915304,-552675e-11,.275999,183285e-10,.91668,-139285e-9,.276414,461914e-9,.916664,-55713e-8,.276409,.00184763,.916653,-.00125354,.276406,.00415715,.916651,-.00222851,.276405,.00739053,.916655,-.00348205,.276406,.0115478,.916653,-.00501414,.276405,.0166291,.916667,-.00682478,.276409,.0226346,.91668,-.00891398,.276412,.0295648,.91669,-.0112817,.276413,.0374199,.916727,-.013928,.276422,.0462016,.916759,-.0168528,.276429,.0559101,.916793,-.0200558,.276436,.0665466,.916849,-.0235373,.276448,.0781139,.916964,-.0272973,.276474,.0906156,.917047,-.0313344,.276491,.104051,.917152,-.0356465,.276511,.118424,.917286,-.0402271,.276533,.133736,.917469,-.0450408,.276564,.149978,.917686,-.0497872,.276563,.167057,.917953,-.0540937,.276493,.184846,.918228,-.0590709,.276437,.203614,.918572,-.0644277,.276398,.223212,.918918,-.0702326,.276362,.243584,.919356,-.076484,.276383,.264465,.919842,-.0830808,.276434,.285701,.920451,-.0892972,.276407,.307559,.921113,-.095016,.276128,.331501,.921881,-.100771,.275754,.356207,.923027,-.106029,.275254,.381477,.924364,-.111029,.274595,.40722,.925818,-.116345,.273841,.433385,.92746,-.121424,.272913,.459848,.929167,-.12657,.271837,.486493,.931426,-.131581,.270575,.513432,.934001,-.135038,.268512,.541502,.936296,-.138039,.266135,.569658,.939985,-.140687,.263271,.598375,.943516,-.143247,.260058,.626563,.94782,-.145135,.256138,.654711,.951023,-.145733,.251154,.683285,.955338,-.145554,.245562,.711831,.959629,-.145008,.239265,.739573,.963123,-.144003,.232064,.767027,.966742,-.141289,.224036,.794359,.969991,-.138247,.215305,.820361,.973403,-.134786,.206051,.846548,.975317,-.129966,.195914,.871541,.977647,-.12471,.185184,.895313,.980137,-.119086,.174161,.918398,.981031,-.112297,.162792,.940679,.982037,-.105372,.150952,.961991,.983164,-.097821,.138921,.981913,.983757,-.0897245,.126611,1.00109,.985036,-.0815974,.114228,1.01902,.986289,-.0727725,.101389,1.03604,.987329,-.0639323,.0886476,1.05149,.989193,-.0548109,.0756837,1.06619,.990716,-.045687,.0627581,1.07948,.992769,-.0364315,.0498337,1.09172,.99524,-.0271761,.0370305,1.1033,.997154,-.0179609,.0243959,1.11353,.998845,-.00878063,.0119567,1.12319,1.00002,259038e-9,-108146e-9,1.13177,.903945,-591681e-11,.295126,181226e-10,.903668,-148672e-9,.295037,455367e-9,.903677,-594683e-9,.29504,.00182145,.903673,-.00133805,.295039,.00409831,.903666,-.00237872,.295036,.00728584,.903668,-.00371676,.295037,.0113842,.903679,-.00535212,.29504,.0163936,.903684,-.00728479,.295041,.0223141,.903698,-.00951473,.295044,.0291462,.903718,-.0120419,.295049,.0368904,.903754,-.0148664,.295058,.0455477,.903801,-.017988,.29507,.0551194,.903851,-.0214064,.295082,.0656058,.903921,-.0251219,.295097,.0770109,.904002,-.0291337,.295116,.0893354,.904111,-.033441,.29514,.102583,.904246,-.0380415,.295169,.116755,.904408,-.0429258,.295202,.131853,.904637,-.0480468,.295245,.147869,.904821,-.0529208,.295214,.164658,.905163,-.0577748,.295185,.182274,.905469,-.0631763,.295143,.200828,.905851,-.068917,.295112,.2202,.906322,-.0750861,.295104,.240372,.906761,-.0815855,.295086,.261082,.90735,-.0882138,.295095,.282123,.908087,-.095082,.295139,.303563,.908826,-.101488,.29492,.327028,.909832,-.107577,.294577,.351464,.911393,-.113033,.294115,.376497,.912804,-.118629,.293446,.402115,.914081,-.124232,.292581,.428111,.91637,-.129399,.29166,.454442,.91814,-.134892,.290422,.481024,.921179,-.140069,.289194,.507924,.924544,-.144431,.287421,.535557,.927995,-.147498,.284867,.563984,.931556,-.150197,.281722,.5923,.935777,-.152711,.278207,.620832,.940869,-.154836,.274148,.649069,.945994,-.155912,.269057,.677746,.949634,-.155641,.262799,.706293,.955032,-.154809,.256097,.734278,.95917,-.153678,.248618,.761751,.962931,-.151253,.239794,.789032,.966045,-.147625,.230281,.815422,.96971,-.143964,.220382,.841787,.972747,-.139464,.209846,.867446,.975545,-.133459,.198189,.892004,.978381,-.127424,.186362,.915458,.979935,-.120506,.173964,.937948,.980948,-.11282,.161429,.959732,.982234,-.104941,.148557,.980118,.982767,-.0962905,.135508,.999463,.983544,-.0873625,.122338,1.01756,.984965,-.0783447,.108669,1.03492,.986233,-.0684798,.0949911,1.05087,.987796,-.0590867,.0811386,1.0656,.989885,-.0489145,.0673099,1.0794,.991821,-.0391,.0535665,1.09174,.99448,-.029087,.0397529,1.10341,.996769,-.019114,.0261463,1.11383,.998641,-.00947007,.0128731,1.1237,.999978,446316e-9,-169093e-9,1.13253,.888362,-627064e-11,.312578,178215e-10,.889988,-157791e-9,.313148,448451e-9,.889825,-631076e-9,.313092,.00179356,.88984,-.00141994,.313097,.00403554,.889828,-.0025243,.313092,.00717429,.889831,-.00394421,.313093,.0112099,.889831,-.00567962,.313093,.0161425,.889844,-.00773051,.313096,.0219724,.889858,-.0100968,.3131,.0286999,.889882,-.0127786,.313106,.0363256,.889918,-.0157757,.313116,.0448509,.889967,-.0190878,.313129,.0542758,.89003,-.022715,.313145,.0646032,.890108,-.0266566,.313165,.0758339,.890218,-.0309131,.313193,.0879729,.890351,-.0354819,.313226,.101019,.89051,-.0403613,.313263,.114979,.890672,-.0455385,.313294,.129848,.890882,-.0509444,.313333,.145616,.891189,-.0559657,.313324,.162122,.891457,-.0613123,.313281,.179524,.891856,-.0671488,.313281,.197855,.892312,-.0732732,.313268,.216991,.892819,-.0797865,.313263,.236924,.893369,-.0865269,.313247,.257433,.894045,-.0931592,.313205,.278215,.894884,-.100532,.313276,.299467,.895832,-.107716,.313205,.322276,.897043,-.114099,.312873,.34642,.898515,-.119941,.312331,.371187,.900191,-.126044,.311731,.396656,.90188,-.131808,.310859,.422488,.904359,-.137289,.309857,.448744,.906923,-.142991,.308714,.475239,.910634,-.148253,.307465,.501983,.914502,-.153332,.305774,.529254,.919046,-.156646,.303156,.557709,.923194,-.159612,.299928,.586267,.928858,-.162027,.296245,.614925,.934464,-.164203,.291832,.643187,.939824,-.165602,.286565,.671601,.944582,-.165383,.280073,.700213,.949257,-.164439,.272891,.728432,.954389,-.162953,.264771,.756082,.958595,-.161007,.255927,.78369,.962138,-.157243,.245769,.810769,.966979,-.152872,.235127,.836999,.969566,-.148209,.22347,.862684,.972372,-.142211,.211147,.887847,.975916,-.135458,.198606,.911843,.978026,-.128398,.185498,.934795,.979686,-.120313,.17171,.956787,.980748,-.11166,.158159,.978046,.981622,-.103035,.144399,.997693,.982356,-.0930328,.13001,1.01642,.983308,-.0834627,.115778,1.03366,.985037,-.0732249,.101327,1.05014,.986493,-.0628145,.086554,1.06507,.988484,-.0526556,.0720413,1.07907,.991051,-.0415744,.0571151,1.09189,.993523,-.0314275,.0426643,1.10369,.99628,-.0203603,.0279325,1.11423,.998344,-.0102446,.0138182,1.12421,.999997,42612e-8,-193628e-9,1.1333,.871555,-660007e-11,.329176,174749e-10,.875255,-166579e-9,.330571,441051e-9,.875644,-666394e-9,.330718,.00176441,.875159,-.00149903,.330536,.00396899,.87516,-.00266493,.330536,.007056,.875158,-.00416393,.330535,.0110251,.87516,-.00599598,.330535,.0158764,.875163,-.00816108,.330536,.0216101,.875174,-.0106591,.330538,.0282266,.875199,-.0134899,.330545,.0357266,.875257,-.0166538,.330563,.0441117,.875304,-.0201501,.330575,.0533821,.875373,-.0239785,.330595,.0635395,.875464,-.0281389,.330619,.0745872,.875565,-.0326301,.330645,.0865255,.875691,-.0374516,.330676,.0993599,.875897,-.0425993,.330733,.113093,.876091,-.0480576,.330776,.127722,.876353,-.0537216,.330826,.143227,.876649,-.0589807,.330809,.159462,.877034,-.0647865,.330819,.176642,.877443,-.0709789,.330817,.194702,.877956,-.0774782,.330832,.213577,.878499,-.0843175,.330822,.233246,.879144,-.0912714,.330804,.253512,.879982,-.0980824,.330766,.274137,.88097,-.105823,.330864,.295209,.882051,-.113671,.330896,.317226,.883397,-.120303,.330545,.341068,.884987,-.12667,.330068,.365613,.886789,-.133118,.329418,.390807,.889311,-.139024,.328683,.416494,.891995,-.144971,.327729,.442618,.895106,-.150747,.326521,.469131,.899527,-.156283,.325229,.495921,.90504,-.161707,.32378,.523162,.909875,-.165661,.32122,.55092,.91561,-.168755,.317942,.579928,.921225,-.171193,.313983,.608539,.927308,-.17319,.309636,.636854,.933077,-.174819,.304262,.66523,.938766,-.175002,.297563,.693609,.943667,-.173946,.289613,.722157,.949033,-.172221,.281227,.750021,.953765,-.169869,.271545,.777466,.95804,-.166578,.261034,.804853,.962302,-.161761,.249434,.831569,.966544,-.156636,.237484,.857779,.969372,-.150784,.224395,.883051,.972486,-.143672,.210786,.907864,.975853,-.135772,.196556,.931223,.977975,-.127942,.182307,.954061,.979122,-.118347,.167607,.97531,.980719,-.109112,.152739,.995666,.981223,-.0991789,.137932,1.01475,.98216,-.0883553,.122692,1.03253,.983379,-.0780825,.107493,1.04917,.985434,-.0665646,.0917791,1.06464,.987332,-.0557714,.0764949,1.07896,.990004,-.0442805,.060721,1.09199,.992975,-.0331676,.0452284,1.10393,.995811,-.0219547,.0297934,1.11476,.9982,-.0107613,.0146415,1.12484,1.00002,248678e-9,-14555e-8,1.13413,.859519,-693595e-11,.347264,171673e-10,.859843,-17503e-8,.347394,433219e-9,.859656,-700076e-9,.347319,.00173277,.859671,-.00157517,.347325,.00389875,.859669,-.00280028,.347324,.00693112,.85967,-.0043754,.347324,.01083,.859665,-.00630049,.347321,.0155954,.859685,-.0085755,.347328,.0212278,.859694,-.0112003,.347329,.0277273,.859718,-.0141747,.347336,.0350946,.85976,-.0174988,.347348,.0433314,.85982,-.0211722,.347366,.0524384,.859892,-.0251941,.347387,.0624168,.860006,-.0295649,.347422,.0732708,.860122,-.0342825,.347453,.0849999,.860282,-.0393462,.347499,.0976102,.860482,-.0447513,.347554,.111104,.860719,-.0504775,.347614,.125479,.860998,-.0563577,.347666,.140703,.861322,-.0619473,.347662,.156681,.861724,-.0681277,.347684,.173597,.862198,-.0746567,.347709,.191371,.862733,-.0815234,.347727,.209976,.863371,-.0886643,.347744,.229351,.86414,-.0957908,.347734,.24934,.865138,-.102912,.34772,.269797,.866182,-.110924,.3478,.290654,.867436,-.119223,.347911,.312074,.869087,-.126197,.347649,.335438,.870859,-.133145,.347222,.359732,.872997,-.139869,.346645,.38467,.875939,-.146089,.345935,.41019,.879012,-.152334,.345012,.436218,.883353,-.15821,.343924,.462641,.888362,-.164097,.342636,.489449,.895026,-.169528,.341351,.516629,.900753,-.174408,.339115,.544109,.906814,-.17751,.335809,.572857,.912855,-.180101,.331597,.601554,.919438,-.182116,.32698,.630198,.925962,-.183494,.321449,.658404,.931734,-.184159,.314595,.686625,.93762,-.18304,.306462,.71531,.943858,-.181323,.297514,.744272,.948662,-.178683,.287447,.771462,.953299,-.175379,.276166,.798593,.957346,-.170395,.263758,.8256,.962565,-.165042,.251019,.852575,.966075,-.158655,.237011,.878316,.969048,-.151707,.222518,.90329,.972423,-.143271,.207848,.927745,.975833,-.134824,.192463,.950859,.977629,-.125444,.1768,.972947,.978995,-.114949,.161033,.993263,.980533,-.104936,.145523,1.01337,.980745,-.0935577,.129799,1.03128,.981814,-.0822956,.113486,1.04825,.983943,-.0710082,.0972925,1.06405,.986141,-.0587931,.0808138,1.0785,.988878,-.0472755,.0644915,1.09204,.992132,-.0349128,.0478128,1.10413,.9953,-.0232407,.031621,1.11527,.998117,-.0112713,.0154935,1.12551,1.00003,339743e-9,-195763e-9,1.13504,.845441,-729126e-11,.364305,169208e-10,.843588,-183164e-9,.363506,425067e-9,.843412,-73253e-8,.36343,.00169999,.843401,-.00164818,.363426,.00382495,.843399,-.00293008,.363425,.00679993,.843401,-.00457822,.363425,.010625,.843394,-.00659249,.363421,.0153002,.843398,-.00897282,.363421,.0208258,.843415,-.0117191,.363426,.0272024,.843438,-.0148312,.363432,.0344305,.843483,-.018309,.363447,.0425116,.84356,-.0221521,.363472,.0514471,.843646,-.0263597,.363499,.061238,.843743,-.0309315,.363527,.0718873,.84388,-.0358658,.363569,.0833969,.844079,-.0411624,.363631,.0957742,.844279,-.0468128,.363688,.109015,.844549,-.0527923,.363761,.123124,.844858,-.0588204,.363817,.138044,.84522,-.0647573,.36383,.153755,.845669,-.0713181,.363879,.170394,.846155,-.0781697,.363908,.187861,.846789,-.0853913,.363969,.206176,.847502,-.0928086,.363999,.225244,.8484,-.10005,.363997,.244926,.849461,-.107615,.364008,.265188,.850562,-.115814,.364055,.28587,.851962,-.124334,.364179,.306926,.854326,-.131995,.364233,.329605,.856295,-.139338,.363856,.35359,.858857,-.146346,.363347,.37831,.862428,-.152994,.362807,.403722,.866203,-.159463,.361963,.429537,.871629,-.165623,.36112,.456,.877365,-.171649,.359917,.482773,.883744,-.177151,.35848,.509705,.890693,-.182381,.356523,.537215,.897278,-.186076,.3533,.565493,.903958,-.188602,.349095,.594293,.910908,-.190755,.344215,.623165,.918117,-.192063,.338606,.651573,.924644,-.192758,.331544,.679869,.931054,-.192238,.323163,.708668,.937303,-.190035,.313529,.737201,.943387,-.187162,.303152,.764977,.948494,-.183876,.29146,.792683,.952546,-.178901,.277917,.819228,.958077,-.173173,.264753,.846559,.962462,-.16645,.25002,.872962,.966569,-.159452,.234873,.898729,.969108,-.15074,.218752,.923126,.973072,-.141523,.202673,.947278,.975452,-.132075,.186326,.969938,.977784,-.121257,.169396,.991325,.97899,-.110182,.153044,1.01123,.979777,-.0989634,.136485,1.0299,.980865,-.0865894,.119343,1.04727,.982432,-.0746115,.102452,1.06341,.984935,-.0621822,.0852423,1.07834,.987776,-.0495694,.0678546,1.092,.99103,-.0372386,.0506917,1.1043,.99474,-.0244353,.0333316,1.11576,.997768,-.0121448,.0164348,1.12617,1.00003,31774e-8,-169504e-9,1.13598,.825551,-756799e-11,.378425,165099e-10,.82664,-190922e-9,.378923,416504e-9,.826323,-763495e-9,.378779,.0016656,.826359,-.00171789,.378795,.00374768,.82636,-.00305402,.378795,.00666259,.826368,-.00477185,.378798,.0104104,.826364,-.00687131,.378795,.0149912,.826368,-.00935232,.378795,.0204054,.826376,-.0122146,.378797,.0266532,.826399,-.0154581,.378803,.0337355,.82646,-.0190825,.378824,.0416537,.826525,-.0230873,.378846,.0504091,.826614,-.0274719,.378876,.0600032,.82674,-.0322355,.378917,.0704393,.826888,-.0373766,.378964,.0817195,.827078,-.0428936,.379024,.0938492,.827318,-.0487778,.379099,.106828,.82764,-.0549935,.379199,.120659,.827926,-.0611058,.379227,.13526,.828325,-.0675054,.379275,.150713,.828801,-.0743455,.379332,.167034,.8294,-.0815523,.379415,.184209,.830094,-.0890779,.379495,.202203,.8309,-.096736,.379555,.220945,.831943,-.104135,.379577,.240306,.833037,-.112106,.379604,.260317,.834278,-.120554,.379668,.2808,.836192,-.129128,.3799,.301654,.838671,-.137541,.380109,.323502,.840939,-.14523,.379809,.347176,.844575,-.15248,.379593,.371706,.848379,-.159607,.37909,.39688,.853616,-.166267,.378617,.422702,.858921,-.172698,.377746,.448919,.865324,-.178823,.376749,.475661,.872207,-.184542,.375363,.502599,.880018,-.189836,.373657,.529914,.88694,-.194294,.370673,.557683,.894779,-.197022,.36662,.586848,.902242,-.199108,.36138,.615831,.909914,-.200398,.355434,.644478,.917088,-.20094,.348173,.672905,.923888,-.200671,.339482,.701327,.930495,-.198773,.32956,.730101,.937247,-.195394,.318363,.758383,.943108,-.191956,.306323,.786539,.948296,-.187227,.292576,.813637,.953472,-.181165,.278234,.840793,.958485,-.174119,.263054,.867712,.962714,-.166564,.246756,.893635,.966185,-.158181,.229945,.919028,.970146,-.148275,.212633,.943413,.973491,-.138157,.195229,.966627,.975741,-.127574,.178048,.988817,.977238,-.11554,.160312,1.00924,.978411,-.10364,.142857,1.02845,.979811,-.0913122,.125317,1.04648,.98116,-.0782558,.107627,1.06284,.983543,-.0655957,.0895862,1.07798,.986789,-.0520411,.0713756,1.092,.990292,-.0389727,.053228,1.10484,.994187,-.025808,.0351945,1.11642,.997499,-.0126071,.0173198,1.12703,.999999,275604e-9,-148602e-9,1.13674,.81075,-78735e-10,.394456,161829e-10,.808692,-198293e-9,.393453,407564e-9,.80846,-792877e-9,.39334,.00162965,.808595,-.00178416,.393407,.00366711,.808597,-.00317182,.393408,.00651934,.808598,-.00495589,.393408,.0101866,.808591,-.00713627,.393403,.0146689,.808592,-.00971285,.393402,.0199667,.80861,-.0126855,.393407,.0260803,.808633,-.0160538,.393413,.0330107,.80868,-.0198175,.393429,.0407589,.808748,-.0239758,.393453,.0493264,.808854,-.0285286,.39349,.0587161,.808992,-.0334748,.39354,.0689304,.809141,-.0388116,.393588,.0799707,.809352,-.0445375,.39366,.0918432,.809608,-.0506427,.393742,.104549,.809915,-.0570708,.393834,.118085,.810253,-.0633526,.393885,.132377,.810687,-.0700966,.393953,.147537,.811233,-.0772274,.394047,.163543,.811865,-.0847629,.394148,.180394,.812648,-.0925663,.394265,.198051,.813583,-.100416,.394363,.216443,.814683,-.108119,.394402,.235502,.815948,-.11644,.394489,.255242,.817278,-.125036,.394542,.275441,.819605,-.133655,.39486,.296094,.822256,-.142682,.395248,.317309,.825349,-.150756,.395241,.340516,.829605,-.158392,.395285,.364819,.83391,-.165801,.394922,.389736,.839808,-.172677,.394691,.415409,.845708,-.179448,.394006,.441546,.853025,-.185746,.393279,.46832,.859666,-.191684,.391655,.495302,.86789,-.197146,.390068,.52262,.875845,-.201904,.38727,.550336,.882634,-.205023,.382688,.578825,.891076,-.207098,.377543,.608103,.900589,-.208474,.371752,.63723,.90791,-.209068,.364016,.665769,.915971,-.208655,.355593,.694428,.923455,-.20729,.345439,.723224,.931514,-.203821,.334099,.751925,.937885,-.19986,.321069,.780249,.943136,-.194993,.306571,.8077,.948818,-.189132,.291556,.83497,.954433,-.181617,.275745,.86188,.959078,-.173595,.258695,.888562,.962705,-.164855,.240825,.914008,.966753,-.155129,.22268,.939145,.970704,-.144241,.204542,.963393,.973367,-.133188,.185927,.985983,.975984,-.121146,.167743,1.00704,.976994,-.108366,.149218,1.02715,.978485,-.0956746,.13131,1.0455,.980074,-.0820733,.112513,1.06221,.98225,-.0684061,.0938323,1.07782,.98553,-.0549503,.0749508,1.09199,.989529,-.0407857,.055848,1.10508,.993536,-.0271978,.0368581,1.11684,.997247,-.0132716,.0181845,1.12789,1,431817e-9,-198809e-9,1.13792,.785886,-812608e-11,.405036,157669e-10,.790388,-205278e-9,.407355,398297e-9,.790145,-820824e-9,.407231,.00159263,.790135,-.00184681,.407226,.00358336,.790119,-.00328316,.407218,.00637039,.790126,-.00512988,.40722,.0099539,.79013,-.00738684,.407221,.0143339,.790135,-.0100538,.407221,.0195107,.790134,-.0131306,.407217,.0254848,.79016,-.0166169,.407224,.0322572,.790197,-.020512,.407236,.0398284,.790273,-.0248157,.407263,.0482014,.790381,-.029527,.407304,.0573777,.790521,-.0346446,.407355,.0673602,.790704,-.0401665,.40742,.0781522,.790925,-.0460896,.407499,.0897582,.791195,-.0524017,.407589,.10218,.791522,-.0590121,.407691,.11541,.791878,-.0654876,.407748,.12939,.792361,-.0725207,.407849,.144237,.792942,-.0799844,.407963,.159924,.79362,-.0877896,.408087,.176425,.794529,-.0958451,.408259,.193733,.795521,-.103827,.408362,.211756,.796778,-.111937,.408482,.230524,.798027,-.120521,.408547,.249967,.799813,-.129242,.408721,.269926,.802387,-.138048,.409148,.290338,.805279,-.147301,.409641,.311193,.809251,-.155895,.410154,.333611,.813733,-.163942,.410297,.357615,.819081,-.171666,.410373,.382339,.825427,-.178905,.410348,.407828,.83172,-.185812,.409486,.434034,.83877,-.192318,.408776,.460493,.845817,-.198249,.407176,.487346,.854664,-.204034,.405719,.514832,.863495,-.208908,.403282,.542401,.871883,-.212765,.399293,.570683,.88065,-.214911,.393803,.599947,.89004,-.216214,.387536,.62932,.898476,-.216745,.379846,.658319,.906738,-.216387,.370625,.687138,.914844,-.215053,.360139,.71601,.923877,-.212007,.348849,.745124,.931925,-.207481,.335639,.773366,.938054,-.202418,.320798,.801636,.943895,-.196507,.304772,.829055,.949468,-.189009,.288033,.856097,.955152,-.180539,.270532,.88301,.959403,-.171437,.251639,.909296,.963309,-.161661,.232563,.934868,.967399,-.150425,.213231,.959662,.972009,-.138659,.194247,.98302,.97433,-.126595,.174718,1.00517,.975823,-.113205,.155518,1.02566,.976371,-.0996096,.136709,1.04418,.978705,-.0860754,.117571,1.06146,.981477,-.0714438,.0980046,1.07777,.984263,-.0572304,.0782181,1.09214,.988423,-.0428875,.0584052,1.10553,.993,-.0282442,.038522,1.11758,.99704,-.0140183,.0190148,1.12864,.999913,369494e-9,-145203e-9,1.13901,.777662,-84153e-10,.423844,154403e-10,.770458,-211714e-9,.419915,38845e-8,.770716,-846888e-9,.420055,.00155386,.770982,-.00190567,.420202,.00349653,.770981,-.00338782,.420201,.00621606,.77098,-.00529338,.4202,.00971274,.770983,-.00762223,.4202,.0139867,.770985,-.0103741,.420198,.0190381,.770996,-.0135489,.4202,.0248677,.771029,-.0171461,.420212,.0314764,.771052,-.0211647,.420215,.0388648,.771131,-.0256048,.420245,.047036,.771235,-.0304647,.420284,.0559911,.771383,-.0357436,.420341,.0657346,.771591,-.0414392,.420423,.0762694,.771819,-.0475462,.420506,.0875984,.772123,-.0540506,.420617,.099727,.772464,-.060797,.42072,.112637,.772855,-.0675393,.420799,.126313,.773317,-.0748323,.420893,.140824,.773981,-.0825681,.421058,.15617,.774746,-.0906307,.421226,.172322,.77566,-.0988982,.421397,.189253,.776837,-.106994,.421569,.206912,.778097,-.115528,.421704,.225359,.779588,-.124317,.421849,.24447,.781574,-.133139,.422097,.264156,.784451,-.142179,.422615,.284318,.787682,-.15165,.423269,.304902,.792433,-.160771,.424396,.3265,.797359,-.169166,.424772,.35014,.803986,-.177149,.425475,.374768,.809504,-.184745,.424996,.399928,.815885,-.19173,.424247,.425796,.823513,-.198525,.423515,.452287,.832549,-.204709,.422787,.479321,.841653,-.210447,.421187,.506718,.850401,-.215501,.418519,.53432,.859854,-.219752,.414715,.56242,.869364,-.222305,.409462,.591558,.878837,-.223744,.402926,.621074,.888636,-.224065,.395043,.650538,.898132,-.223742,.38564,.679538,.907181,-.222308,.375378,.708674,.915621,-.219837,.363212,.737714,.9239,-.215233,.349313,.767014,.931644,-.209592,.334162,.795133,.938887,-.203644,.317943,.823228,.945282,-.196349,.300581,.850822,.950758,-.18742,.282195,.877594,.956146,-.177879,.262481,.904564,.960355,-.167643,.242487,.930741,.965256,-.156671,.222668,.955868,.968029,-.144123,.201907,.979869,.97251,-.131305,.18202,1.00291,.974925,-.118335,.161909,1.02392,.975402,-.103714,.142129,1.0433,.976987,-.089415,.122447,1.06089,.979677,-.0748858,.102248,1.07713,.983184,-.0596086,.0814851,1.09218,.987466,-.0447671,.0609484,1.10585,.992348,-.0295217,.0401835,1.11829,.996674,-.0143917,.0198163,1.12966,1.00003,321364e-9,-149983e-9,1.1402,.757901,-869074e-11,.436176,151011e-10,.751195,-217848e-9,.432317,378533e-9,.751178,-871373e-9,.432307,.0015141,.751195,-.00196061,.432317,.0034068,.751198,-.00348552,.432318,.00605659,.751195,-.00544599,.432315,.00946353,.751207,-.00784203,.43232,.013628,.751213,-.0106732,.43232,.0185499,.751221,-.0139393,.432319,.0242302,.751244,-.0176398,.432325,.0306694,.7513,-.0217743,.432348,.0378698,.751358,-.0263412,.432367,.0458321,.751458,-.0313396,.432404,.0545587,.751608,-.0367682,.432464,.0640543,.7518,-.0426246,.43254,.0743222,.752065,-.0489031,.432645,.0853668,.752376,-.0555828,.432762,.0971911,.752715,-.0623861,.432859,.109768,.753137,-.069415,.432958,.123126,.753676,-.0770039,.433099,.137308,.754345,-.084971,.433272,.15229,.755235,-.0932681,.433504,.168075,.756186,-.10171,.433693,.184625,.757363,-.110019,.433857,.201897,.75884,-.11887,.434102,.220014,.760467,-.127881,.434306,.238778,.762969,-.136766,.434751,.258172,.765823,-.14612,.43529,.278062,.769676,-.15566,.436236,.298437,.774909,-.165177,.437754,.319532,.77994,-.17402,.438343,.342505,.785757,-.182201,.438609,.366693,.792487,-.190104,.438762,.391668,.80038,-.197438,.438795,.417494,.808494,-.204365,.438226,.443933,.817695,-.210714,.437283,.470929,.828111,-.216651,.436087,.498569,.837901,-.221804,.433717,.526165,.847813,-.226318,.430133,.554155,.858314,-.229297,.425213,.582822,.868891,-.230999,.418576,.612847,.878941,-.231155,.410405,.642445,.888809,-.230935,.400544,.672024,.898089,-.229343,.389613,.701366,.908081,-.226886,.377197,.730763,.916819,-.222676,.363397,.759642,.924968,-.216835,.347437,.788775,.932906,-.210245,.32995,.817135,.940025,-.202992,.312262,.844912,.946101,-.19436,.293313,.872164,.952835,-.184125,.273638,.899443,.957347,-.173657,.252385,.926389,.961434,-.162204,.231038,.951947,.965522,-.14979,.209834,.976751,.969412,-.136307,.188821,1.00022,.973902,-.122527,.168013,1.02229,.974045,-.108213,.147634,1.04199,.975775,-.0927397,.12705,1.06019,.978383,-.0778212,.106309,1.07711,.98211,-.0621216,.0849279,1.09245,.986517,-.0463847,.0633519,1.10651,.991696,-.0309353,.0419698,1.11903,.996349,-.0150914,.0206272,1.13073,1.00003,442449e-9,-231396e-9,1.14146,.727498,-885074e-11,.441528,145832e-10,.730897,-223525e-9,.443589,368298e-9,.730796,-893996e-9,.443528,.00147303,.730805,-.00201149,.443533,.00331433,.730814,-.00357596,.443538,.00589222,.730815,-.00558734,.443538,.00920678,.730822,-.00804544,.44354,.0132582,.730836,-.0109501,.443545,.0180468,.730848,-.0143008,.443546,.0235732,.730871,-.0180969,.443552,.0298382,.730915,-.022338,.443567,.0368438,.730982,-.0270225,.443591,.044591,.731076,-.0321491,.443627,.0530831,.731245,-.0377166,.443699,.0623243,.73144,-.0437216,.443777,.0723181,.7317,-.0501576,.443881,.0830691,.732034,-.0569942,.444014,.0945809,.732388,-.0638756,.444113,.106825,.732853,-.071203,.444247,.119859,.733473,-.0790076,.444442,.13369,.734195,-.0871937,.444645,.148304,.735069,-.095696,.444877,.163702,.736169,-.10426,.445133,.179861,.73747,-.112853,.44537,.196778,.738991,-.12199,.445651,.214496,.740865,-.131153,.445958,.232913,.743637,-.140245,.446548,.251977,.746797,-.149722,.447246,.271551,.751517,-.159341,.448656,.291774,.756156,-.169106,.449866,.312455,.761519,-.178436,.450919,.334552,.768295,-.186904,.451776,.358491,.776613,-.195117,.452832,.383446,.783966,-.202695,.45249,.408945,.793542,-.20985,.452587,.435364,.803192,-.216403,.451852,.462336,.813892,-.22251,.450708,.48987,.824968,-.227676,.4486,.517697,.835859,-.232443,.445156,.545975,.846825,-.235775,.440351,.574483,.858085,-.237897,.433641,.604246,.868825,-.238074,.425354,.634101,.879638,-.237661,.415383,.664201,.889966,-.236186,.404136,.693918,.899479,-.233599,.390917,.723481,.908769,-.229737,.376352,.75258,.917966,-.223836,.360372,.781764,.926304,-.217067,.342551,.811139,.934626,-.209309,.324238,.839585,.941841,-.20071,.304484,.867044,.94789,-.190602,.283607,.894579,.954196,-.179253,.262205,.921743,.958383,-.167646,.239847,.948026,.963119,-.155073,.218078,.973296,.966941,-.141426,.195899,.998135,.970836,-.126849,.174121,1.02021,.973301,-.112296,.153052,1.04085,.97448,-.0964965,.131733,1.05946,.977045,-.080489,.10997,1.07693,.980751,-.064844,.0881657,1.09254,.985475,-.0481938,.0657987,1.10697,.991089,-.0319185,.0435215,1.12004,.996122,-.0158088,.0214779,1.13173,1.00001,372455e-9,-200295e-9,1.14291,.708622,-907597e-11,.45304,141962e-10,.711162,-228911e-9,.454662,358052e-9,.709812,-914446e-9,.453797,.00143034,.709865,-.00205819,.453834,.00321935,.709864,-.00365894,.453833,.00572331,.709855,-.00571692,.453826,.00894278,.709862,-.00823201,.453828,.012878,.709875,-.011204,.453832,.0175295,.709896,-.0146323,.453839,.0228978,.709925,-.0185163,.453847,.0289839,.709974,-.0228551,.453866,.0357894,.710045,-.0276473,.453892,.0433161,.710133,-.032891,.453924,.0515665,.710292,-.0385851,.453992,.0605458,.710485,-.0447254,.45407,.0702574,.710769,-.0513051,.454192,.0807077,.711106,-.0582733,.454329,.091896,.711516,-.0652866,.45446,.103814,.712071,-.0728426,.454653,.116508,.712676,-.0808307,.45484,.129968,.713476,-.0892216,.455096,.144206,.714377,-.0979047,.455346,.159212,.715579,-.106531,.455647,.174973,.716977,-.115492,.455961,.191504,.71862,-.124821,.456315,.208835,.72084,-.134079,.4568,.226869,.723786,-.143427,.457521,.245582,.727464,-.153061,.458475,.264957,.732771,-.162768,.460239,.284948,.736515,-.172627,.460899,.30522,.743519,-.182487,.463225,.326717,.750041,-.191295,.464027,.350113,.758589,-.199746,.465227,.374782,.767703,-.207584,.465877,.400226,.777484,-.214973,.465996,.426442,.788792,-.221796,.466019,.453688,.800194,-.228038,.465083,.481246,.811234,-.233346,.462506,.509086,.822859,-.238073,.459257,.537338,.835082,-.241764,.454863,.566108,.846332,-.244241,.448163,.595126,.858355,-.244736,.439709,.625574,.87034,-.244278,.429837,.65617,.881027,-.24255,.418002,.686029,.891007,-.239912,.404325,.716039,.900874,-.236133,.389222,.745518,.911072,-.230672,.373269,.775026,.920359,-.22356,.355083,.804521,.928604,-.215591,.335533,.834045,.937175,-.206503,.315278,.861612,.942825,-.196684,.293653,.889131,.949805,-.185116,.271503,.916853,.955535,-.172703,.248821,.943541,.959843,-.159978,.225591,.970132,.964393,-.146375,.202719,.994709,.968008,-.131269,.179928,1.0186,.971013,-.11569,.158007,1.03928,.973334,-.1003,.13624,1.05887,.975775,-.0833352,.1138,1.07652,.979579,-.0668981,.0913141,1.09297,.984323,-.0500902,.0683051,1.10734,.990351,-.0332377,.0451771,1.12084,.995823,-.0161491,.0221705,1.13296,1.0001,234083e-9,-108712e-9,1.14441,.683895,-924677e-11,.46015,137429e-10,.68833,-233383e-9,.463134,346865e-9,.688368,-933547e-9,.463159,.00138748,.688367,-.00210049,.463159,.00312187,.688369,-.00373415,.463159,.00555004,.688377,-.00583449,.463163,.00867216,.688386,-.00840128,.463166,.0124884,.688398,-.0114343,.463169,.0169993,.688418,-.0149329,.463175,.0222054,.688453,-.0188964,.463188,.028108,.688515,-.0233239,.463214,.0347085,.68857,-.0282136,.463231,.0420091,.688679,-.033564,.463276,.0500132,.688854,-.0393733,.463356,.0587255,.689038,-.0456354,.46343,.0681476,.689321,-.0523433,.463553,.0782897,.689662,-.059412,.463693,.0891501,.690188,-.0665736,.4639,.100735,.690755,-.0743106,.464107,.113074,.691405,-.0824722,.464329,.126161,.692198,-.0910484,.464585,.140007,.693196,-.0998778,.464893,.154612,.69454,-.108651,.465285,.169984,.695921,-.117855,.465596,.186106,.697749,-.12734,.466056,.203034,.700375,-.136714,.466771,.220703,.703395,-.146386,.467579,.239062,.707904,-.156096,.469067,.258188,.711673,-.165904,.469851,.277759,.717489,-.175812,.471815,.297935,.724051,-.185931,.47389,.318916,.731965,-.195238,.47587,.341591,.741151,-.204021,.477523,.366062,.751416,-.212113,.478881,.391396,.761848,-.21979,.479226,.417599,.771886,-.2267,.478495,.444401,.783998,-.232991,.477622,.472084,.796523,-.238645,.475833,.500193,.808851,-.243396,.472568,.52865,.821191,-.247226,.467857,.557362,.834261,-.250102,.461871,.586768,.846762,-.251056,.453543,.617085,.859867,-.250604,.443494,.647659,.871948,-.248783,.431711,.678119,.882967,-.245855,.417911,.708399,.892826,-.242168,.401993,.738256,.90332,-.237062,.385371,.767999,.913633,-.22997,.366837,.798191,.922774,-.221687,.346372,.827756,.931371,-.212345,.325682,.856425,.938929,-.20206,.303665,.884299,.944821,-.190981,.280786,.912023,.951792,-.178065,.2573,.939669,.957712,-.164634,.233448,.96655,.961912,-.150863,.209504,.992366,.966382,-.13577,.18597,1.01633,.969588,-.119593,.162905,1.03843,.971777,-.103203,.14053,1.05841,.97433,-.0865888,.117909,1.07632,.978686,-.0690829,.0944101,1.09326,.983281,-.0516568,.0705671,1.10796,.989562,-.034558,.0468592,1.12182,.995465,-.0167808,.0229846,1.1342,.999991,373016e-9,-235606e-9,1.1459,.662251,-939016e-11,.468575,132714e-10,.666634,-237624e-9,.471675,335842e-9,.666411,-950385e-9,.471516,.00134321,.666399,-.00213833,.471509,.00302221,.666386,-.0038014,.471499,.00537283,.666405,-.00593958,.471511,.00839533,.666406,-.00855253,.471508,.0120898,.666428,-.0116401,.471519,.0164569,.666444,-.0152015,.471522,.0214971,.66649,-.0192362,.471543,.027212,.666537,-.0237428,.471558,.033603,.666617,-.0287198,.471591,.0406728,.666718,-.0341647,.471631,.0484238,.666889,-.0400759,.47171,.0568621,.667104,-.0464479,.471805,.0659915,.667374,-.0532677,.471923,.0758178,.667772,-.0603805,.472098,.0863425,.668371,-.0677392,.472363,.0975917,.668971,-.0756028,.472596,.109567,.669696,-.0839293,.472869,.122272,.670481,-.0926683,.473126,.135718,.6715,-.1016,.473442,.149914,.672911,-.110566,.47389,.164882,.674512,-.119984,.474354,.180602,.67651,-.129574,.474922,.19711,.679292,-.139106,.475764,.214371,.682798,-.148993,.476886,.232405,.686955,-.158737,.478179,.251153,.691406,-.168754,.479432,.270436,.697438,-.178703,.481481,.290374,.704761,-.188955,.484143,.311044,.713599,-.198814,.487007,.333003,.723194,-.207869,.488962,.357144,.732601,-.216189,.489815,.382169,.744193,-.22398,.490888,.408227,.754907,-.231156,.490355,.434928,.767403,-.23747,.489548,.462599,.78107,-.243503,.488274,.490908,.793893,-.248114,.484843,.519421,.807296,-.25222,.4803,.548561,.820529,-.255265,.474097,.577772,.833716,-.256741,.466041,.607782,.848403,-.25637,.456547,.638807,.860755,-.254804,.443946,.670058,.874012,-.251834,.430852,.700749,.885619,-.247867,.414903,.731446,.896069,-.242634,.397276,.761191,.906266,-.236093,.378535,.791053,.916759,-.227543,.358038,.821298,.92523,-.21783,.335705,.850747,.93436,-.207534,.313797,.879258,.941631,-.195983,.289671,.907734,.947564,-.183567,.265319,.935206,.953681,-.169345,.240815,.962739,.960008,-.154909,.216119,.989227,.964145,-.140161,.192096,1.01465,.968171,-.123411,.167855,1.03737,.969859,-.106525,.144817,1.05767,.972666,-.0891023,.12149,1.0761,.977055,-.0718094,.0975306,1.09336,.982527,-.0534213,.0730217,1.10878,.989001,-.0355579,.0483366,1.12285,.99512,-.0176383,.023938,1.13548,1.00007,368831e-9,-211581e-9,1.14744,.651047,-960845e-11,.484101,12922e-9,.644145,-241347e-9,.478968,324578e-9,.64396,-965142e-9,.478831,.00129798,.64396,-.00217154,.47883,.00292046,.643968,-.00386049,.478835,.00519202,.643974,-.00603186,.478838,.0081128,.643977,-.0086854,.478836,.011683,.643982,-.0118207,.478834,.0159031,.644024,-.0154374,.478856,.0207743,.644059,-.0195343,.478868,.0262975,.644122,-.0241103,.478896,.0324747,.644207,-.0291638,.478933,.039309,.64432,-.0346919,.478981,.0468029,.644481,-.0406919,.479053,.0549614,.644722,-.047159,.479169,.0637909,.645013,-.0540748,.479302,.0732974,.645503,-.0612001,.479541,.0834898,.646117,-.0687303,.479829,.0943873,.646707,-.0767846,.480061,.105991,.647431,-.0852465,.480343,.11831,.64831,-.0940719,.48066,.131348,.649486,-.103056,.481083,.14514,.650864,-.112261,.481528,.159676,.652604,-.121852,.482102,.174979,.654825,-.131505,.482813,.191079,.657876,-.141189,.483876,.207927,.661339,-.151239,.48499,.225586,.665463,-.161091,.486279,.243947,.670542,-.171235,.487968,.262957,.677361,-.181347,.49053,.282781,.685672,-.191679,.493862,.303311,.694551,-.201781,.49699,.324607,.703753,-.211164,.498884,.347916,.713703,-.219675,.500086,.372628,.725911,-.227836,.501554,.398694,.73862,-.23533,.502193,.425529,.752118,-.241786,.501811,.453209,.76579,-.247865,.500185,.481381,.779568,-.252696,.497159,.51011,.793991,-.256802,.492765,.539322,.808182,-.259942,.486827,.569078,.821698,-.261703,.478386,.598818,.836009,-.262006,.468772,.629762,.849824,-.260333,.456352,.661366,.863888,-.257398,.442533,.69295,.876585,-.253264,.426573,.723608,.888665,-.248026,.408964,.754378,.899537,-.241487,.389677,.784761,.9094,-.233463,.368516,.814688,.920166,-.223397,.346624,.845009,.928899,-.21255,.322717,.874431,.937156,-.200869,.298698,.902922,.943861,-.188387,.273491,.931356,.949557,-.174341,.247866,.958854,.955862,-.158994,.222496,.986098,.961721,-.143664,.197522,1.01229,.965976,-.127412,.17302,1.03571,.968652,-.109798,.148954,1.05699,.971084,-.0916787,.125044,1.07587,.975584,-.0739634,.100577,1.09372,.98122,-.055322,.0753666,1.10948,.988253,-.0366825,.0498899,1.12394,.99482,-.0180389,.024611,1.13694,1.00001,229839e-9,-188283e-9,1.14919,.613867,-964198e-11,.479449,123452e-10,.621485,-244534e-9,.485399,313091e-9,.621429,-978202e-9,.485353,.00125245,.62112,-.00220004,.485114,.00281687,.621119,-.0039111,.485112,.00500783,.621122,-.00611091,.485112,.00782498,.621133,-.00879922,.485117,.0112687,.621152,-.0119756,.485125,.0153394,.621183,-.0156396,.485139,.0200382,.621227,-.0197898,.485158,.0253663,.621298,-.0244253,.485192,.0313261,.621388,-.0295441,.485233,.0379204,.621507,-.0351432,.485286,.0451523,.621693,-.0412198,.485378,.0530277,.621933,-.0477673,.485495,.0615522,.622232,-.0547574,.485635,.0707316,.622809,-.0619417,.485943,.0805883,.623407,-.069625,.486232,.0911267,.62406,-.077796,.486516,.102354,.624835,-.0863731,.486838,.114279,.625758,-.095251,.487188,.126902,.627043,-.104299,.487695,.140285,.628438,-.113724,.488163,.154397,.630325,-.123417,.488858,.169267,.632801,-.133137,.489754,.184941,.635784,-.143052,.490815,.20136,.639406,-.153132,.492048,.218643,.643872,-.163143,.49363,.236615,.6499,-.17333,.496009,.255449,.657201,-.183622,.498994,.275006,.666221,-.194019,.502888,.295354,.674419,-.204192,.505459,.316244,.683729,-.21406,.507771,.33849,.695584,-.222854,.510245,.363166,.708583,-.231315,.512293,.389071,.721233,-.238911,.512747,.415737,.735134,-.245657,.512482,.443331,.750179,-.251879,.511526,.471891,.765073,-.256911,.508935,.500892,.779794,-.261144,.504341,.530294,.794801,-.264316,.498515,.560144,.810339,-.266276,.491015,.590213,.824818,-.266981,.481126,.620865,.839375,-.265778,.468685,.652687,.853043,-.262748,.453925,.684759,.867335,-.258474,.437912,.716209,.88037,-.253187,.419648,.747508,.891711,-.246476,.39982,.77797,.902896,-.238735,.37879,.808586,.913601,-.22885,.355891,.838843,.923019,-.217656,.331773,.869014,.933432,-.205539,.307356,.898512,.939691,-.192595,.281321,.9269,.946938,-.178945,.255441,.955297,.952372,-.163587,.229013,.983231,.95909,-.147214,.203179,1.00971,.963675,-.13064,.17792,1.03438,.968247,-.113121,.152898,1.05625,.97001,-.0945824,.128712,1.07598,.974458,-.0755648,.103349,1.094,.980168,-.0571998,.0776731,1.1104,.987295,-.0377994,.0514445,1.12491,.994432,-.0186417,.025429,1.13851,.999975,542714e-9,-282356e-9,1.15108,.592656,-980249e-11,.486018,119532e-10,.598467,-247275e-9,.490781,301531e-9,.597934,-988317e-9,.490343,.00120517,.597903,-.00222366,.490319,.0027116,.597913,-.00395315,.490327,.00482077,.597919,-.00617653,.490329,.00753264,.597936,-.00889375,.490339,.0108478,.597956,-.0121043,.490347,.0147668,.597992,-.0158073,.490365,.0192905,.598032,-.0200017,.490382,.0244204,.598109,-.0246865,.49042,.0301593,.598215,-.0298594,.490474,.03651,.59833,-.0355167,.490524,.0434757,.598525,-.0416559,.490624,.0510629,.598778,-.0482692,.490753,.0592781,.599135,-.0553114,.49094,.0681304,.599802,-.062542,.491328,.0776467,.600361,-.0703638,.491598,.0878184,.60101,-.0786256,.491882,.0986573,.601811,-.0872962,.492232,.11018,.602861,-.0962284,.492684,.1224,.604167,-.10538,.493213,.135354,.605693,-.114896,.493799,.149034,.607682,-.124654,.494576,.163469,.610672,-.13456,.4959,.178747,.613313,-.144581,.496713,.194723,.617603,-.154703,.498499,.211617,.622174,-.16489,.500188,.229183,.628855,-.175164,.503072,.247786,.636963,-.185565,.506798,.267116,.644866,-.195911,.509719,.28702,.653741,-.206104,.512776,.307763,.664942,-.216447,.516812,.329631,.67633,-.22552,.519181,.353515,.690012,-.234316,.521681,.379226,.704243,-.242032,.523129,.405901,.719396,-.249172,.523768,.433585,.734471,-.255543,.522541,.462085,.750539,-.260697,.520217,.491233,.766365,-.26501,.516293,.521094,.781677,-.268409,.509708,.551014,.797132,-.270399,.501944,.581463,.812655,-.271247,.492025,.612402,.828592,-.270708,.480424,.643798,.844044,-.268085,.465955,.67682,.857305,-.263459,.448425,.708496,.87114,-.258151,.430243,.74046,.884936,-.251171,.410578,.771583,.895772,-.243305,.38862,.802234,.906961,-.234037,.365214,.833179,.917775,-.222714,.34116,.86353,.927883,-.210175,.31572,.893557,.936617,-.196925,.289159,.922976,.943384,-.182788,.261996,.951606,.949713,-.167965,.235324,.979958,.955818,-.151109,.208408,1.00765,.961344,-.133834,.182591,1.03329,.965469,-.115987,.156958,1.0557,.968693,-.09746,.132239,1.07583,.973165,-.0778514,.106195,1.09451,.979387,-.0585067,.0797669,1.11137,.98671,-.0390409,.0530263,1.12643,.994093,-.019408,.0263163,1.14016,1.00002,540029e-9,-194487e-9,1.15299,.574483,-989066e-11,.494533,114896e-10,.574478,-249127e-9,.494528,289403e-9,.574607,-996811e-9,.494637,.00115797,.574396,-.00224241,.494458,.00260498,.574377,-.00398632,.49444,.00463102,.574386,-.00622836,.494445,.00723623,.574401,-.0089683,.494453,.010421,.574419,-.0122056,.49446,.0141859,.574459,-.0159396,.494481,.0185322,.574525,-.0201692,.49452,.0234617,.574587,-.0248924,.494547,.0289762,.574697,-.0301074,.494604,.0350797,.574853,-.0358114,.494688,.0417767,.575027,-.041999,.494772,.0490718,.575294,-.0486618,.494915,.0569728,.575733,-.0557148,.495173,.0654955,.576356,-.0630489,.495537,.0746612,.576944,-.0709285,.495836,.0844615,.57765,-.0792723,.496177,.0949142,.578491,-.0880167,.496563,.10603,.579639,-.0969462,.497096,.117841,.580989,-.10622,.497684,.130367,.582587,-.115861,.498337,.143609,.584951,-.125605,.499414,.157625,.587602,-.135608,.500518,.172413,.59076,-.145742,.501767,.187999,.594992,-.155934,.503542,.20445,.600656,-.166303,.506135,.221764,.607816,-.176681,.509542,.24002,.61522,-.187071,.51263,.258992,.623702,-.197465,.516021,.278773,.634192,-.207816,.520422,.299377,.644936,-.218183,.524073,.320802,.657888,-.2278,.528049,.34384,.670666,-.236747,.52986,.36916,.685626,-.24484,.531892,.395867,.701304,-.252071,.532727,.423488,.717727,-.258714,.532146,.452201,.733914,-.264211,.529883,.481579,.750529,-.26859,.5259,.511558,.76747,-.272046,.51999,.542042,.785189,-.274225,.513083,.572799,.800954,-.275189,.502936,.603816,.816962,-.274946,.490921,.635461,.83336,-.272695,.47684,.6676,.848143,-.268223,.459405,.70051,.861818,-.262768,.440319,.732902,.876828,-.255872,.420123,.765084,.889312,-.247703,.398379,.796391,.900412,-.238381,.374496,.827333,.912251,-.227783,.349874,.858385,.921792,-.214832,.323181,.888652,.931273,-.200949,.296624,.917763,.940295,-.186537,.269211,.947878,.946812,-.171538,.241447,.977016,.953588,-.155254,.213829,1.00501,.958841,-.137156,.186807,1.03179,.963746,-.118699,.160706,1.05502,.966468,-.0998358,.135504,1.07568,.971178,-.0805186,.109131,1.09479,.97831,-.0599348,.0818293,1.1123,.985886,-.0399661,.0545872,1.12771,.994021,-.0198682,.0269405,1.14186,1.00009,271022e-9,-12989e-8,1.15514,.538716,-990918e-11,.486732,109675e-10,.550656,-250642e-9,.497518,277412e-9,.55057,-.00100265,.497441,.00110974,.550903,-.00225672,.497733,.00249779,.550568,-.00401046,.497438,.00443906,.550574,-.00626613,.49744,.00693637,.550591,-.0090226,.497449,.00998921,.550623,-.0122795,.497469,.0135984,.550667,-.0160361,.497495,.0177654,.550724,-.0202908,.497526,.0224915,.550792,-.0250421,.497557,.0277795,.550918,-.0302878,.49763,.0336334,.551058,-.0360241,.497701,.0400573,.551276,-.0422473,.497824,.0470585,.551551,-.0489441,.497977,.0546433,.552074,-.0559596,.498312,.0628367,.552681,-.0633978,.498679,.071646,.553324,-.0713176,.499031,.0810746,.554011,-.0797268,.499365,.091129,.55488,-.0885238,.499779,.101837,.556171,-.0974417,.500444,.113239,.557498,-.106841,.501025,.125316,.559299,-.116533,.501864,.138128,.561647,-.126298,.502967,.151695,.564347,-.136388,.504129,.16604,.567863,-.146576,.505713,.181207,.572569,-.156832,.507953,.197259,.578919,-.167323,.511186,.214258,.585387,-.177712,.514042,.232038,.593134,-.188184,.517484,.250733,.603295,-.198717,.522345,.270454,.613854,-.209177,.526751,.290807,.626092,-.219644,.531595,.312202,.637868,-.229494,.534721,.334435,.652458,-.238718,.538304,.359184,.666985,-.247061,.539875,.385637,.683301,-.254652,.541042,.41328,.69998,-.261376,.540735,.441903,.717824,-.267085,.539139,.471609,.734617,-.271465,.534958,.501446,.753663,-.27528,.53032,.532571,.770512,-.277617,.522134,.563641,.787356,-.278525,.51206,.595067,.806252,-.278512,.50119,.627226,.822061,-.277023,.486791,.659402,.838959,-.273175,.470467,.692874,.85379,-.267238,.450688,.725702,.868268,-.260327,.429741,.75832,.881994,-.251946,.407223,.790189,.893885,-.242432,.383214,.821625,.905118,-.231904,.357297,.853011,.916045,-.219545,.330733,.883773,.927614,-.205378,.303916,.914435,.936005,-.190388,.275941,.944502,.944533,-.1749,.247493,.974439,.950758,-.158588,.218996,1.00286,.957078,-.141027,.191559,1.0304,.962448,-.121507,.164457,1.05466,.964993,-.102068,.138636,1.0761,.970017,-.0822598,.111861,1.09541,.97661,-.062033,.0843438,1.11317,.985073,-.0409832,.0558496,1.12911,.993515,-.020146,.0275331,1.1438,1.00006,27329e-8,-107883e-9,1.15736,.525324,-999341e-11,.498153,105385e-10,.526513,-251605e-9,.499277,265329e-9,.526517,-.00100641,.499282,.0010613,.526588,-.00226466,.499337,.00238823,.526539,-.0040255,.499302,.00424535,.526547,-.00628954,.499306,.00663364,.526561,-.00905628,.499313,.00955337,.526593,-.0123253,.499334,.0130054,.526642,-.0160957,.499365,.0169911,.5267,-.0203661,.499396,.0215122,.526792,-.0251347,.499451,.0265718,.526904,-.0303985,.499511,.0321732,.527079,-.0361554,.499617,.0383231,.527285,-.0423982,.499731,.045026,.527602,-.0491121,.499924,.0522936,.528166,-.0561127,.500306,.0601528,.52879,-.0635988,.5007,.0686059,.529421,-.071581,.501048,.0776518,.530144,-.0799854,.501421,.0873148,.531062,-.0888032,.501884,.0976084,.532374,-.0977643,.50259,.108588,.533828,-.107197,.50329,.120234,.53581,-.116887,.504312,.132602,.538063,-.126755,.505365,.145721,.5409,-.136819,.506668,.159617,.544882,-.147117,.508731,.174369,.550238,-.157446,.511601,.190028,.556038,-.167988,.514431,.206587,.563031,-.178364,.517808,.224046,.571543,-.189007,.521937,.242503,.582255,-.199546,.527415,.261977,.59272,-.210084,.531682,.282162,.605648,-.220448,.537123,.303426,.61785,-.230593,.540664,.325323,.632223,-.240238,.544467,.348993,.648819,-.24887,.547594,.375462,.665825,-.256657,.54912,.403024,.683389,-.263711,.549294,.431773,.701495,-.269666,.547649,.461494,.719197,-.274169,.543786,.491623,.737906,-.278124,.538644,.522994,.756652,-.280632,.531057,.554775,.775279,-.281741,.521972,.586441,.792688,-.281652,.509613,.618596,.811894,-.280345,.496497,.651462,.827938,-.277128,.47968,.684023,.844837,-.271646,.460688,.718024,.859239,-.264397,.438872,.751207,.874088,-.256144,.41577,.784232,.887693,-.246311,.391369,.816191,.899402,-.235497,.365872,.847828,.910973,-.223631,.338618,.87934,.92204,-.209874,.310803,.910325,.930987,-.194265,.281802,.940695,.94,-.178125,.252836,.970958,.948018,-.161479,.224239,1.00078,.955141,-.144038,.195857,1.0288,.960513,-.124915,.168487,1.05371,.963964,-.104284,.141495,1.07596,.968713,-.0838732,.114437,1.09628,.975524,-.0635579,.0863105,1.11448,.98431,-.042291,.0574774,1.13069,.992916,-.0209131,.0284343,1.14568,.999926,743097e-9,-379265e-9,1.15955,.501042,-998428e-11,.498726,100306e-10,.502992,-252112e-9,.500665,253283e-9,.502417,-.00100791,.500092,.00101259,.502965,-.00226919,.500621,.00227978,.502318,-.00403109,.499994,.00405011,.502333,-.00629832,.500005,.00632868,.502362,-.00906907,.500027,.00911446,.502369,-.0123423,.500023,.0124078,.50243,-.0161178,.500066,.016211,.502493,-.0203937,.500103,.0205256,.502592,-.0251684,.500166,.0253548,.502707,-.0304389,.50023,.0307029,.502881,-.0362015,.500335,.0365753,.503124,-.0424507,.500488,.0429798,.503443,-.0491582,.500686,.0499268,.504083,-.0561476,.501155,.0574541,.504668,-.0636846,.501524,.0655408,.505319,-.0716834,.501904,.0742072,.50609,-.0800925,.502321,.0834699,.507122,-.0888425,.502896,.0933603,.508414,-.097855,.503603,.10391,.509955,-.107304,.504416,.115113,.512061,-.116921,.505565,.127054,.514419,-.12689,.506732,.139709,.517529,-.136934,.508338,.153173,.522085,-.147327,.510987,.167528,.526986,-.157612,.513527,.182708,.533122,-.168213,.516717,.198881,.540807,-.178688,.520832,.215986,.550687,-.189511,.52632,.234335,.560567,-.199998,.531009,.253375,.571698,-.210652,.535839,.273499,.584364,-.220917,.541091,.294355,.599066,-.23137,.546875,.316525,.614148,-.241206,.551306,.339671,.631157,-.250379,.555187,.36531,.647919,-.258397,.556595,.392767,.666112,-.265528,.556949,.421397,.686158,-.271827,.556617,.451433,.704838,-.27674,.552975,.482131,.723957,-.280733,.547814,.513458,.74262,-.283359,.53997,.545446,.762009,-.284541,.530422,.57775,.781314,-.284507,.518546,.610434,.799116,-.283309,.504178,.643178,.817604,-.280378,.48843,.676248,.83459,-.275619,.469457,.709698,.850974,-.26856,.447698,.744245,.866747,-.260094,.424791,.777695,.881412,-.249929,.399913,.810392,.8936,-.239137,.37308,.842872,.905943,-.226818,.345705,.874677,.916408,-.213699,.31706,.906257,.927215,-.198428,.288444,.936881,.935625,-.181643,.258329,.96795,.944076,-.164386,.228488,.998216,.951229,-.146339,.199763,1.02689,.958793,-.127709,.172153,1.0535,.963219,-.107244,.144989,1.07646,.967562,-.0857764,.11685,1.09675,.974866,-.0645377,.0880571,1.11576,.983353,-.0431732,.0587352,1.13227,.992503,-.0218356,.0294181,1.1478,1.00003,605203e-9,-231013e-9,1.16207,.482935,-101177e-10,.504695,968142e-11,.477554,-251521e-9,.499071,240676e-9,.477904,-.00100683,.499436,96342e-8,.478368,-.00226636,.499899,.0021687,.477977,-.00402719,.499513,.00385384,.477993,-.00629226,.499525,.0060221,.478011,-.00906011,.499536,.00867289,.478051,-.0123305,.499566,.0118074,.478089,-.016102,.499587,.0154269,.478171,-.0203736,.499645,.0195341,.478254,-.025143,.499692,.0241318,.47839,-.0304071,.499779,.0292247,.478588,-.0361631,.499911,.0348196,.478812,-.0424023,.500046,.0409231,.479208,-.0490724,.500326,.047552,.479841,-.0560722,.500805,.0547377,.480392,-.0636125,.501152,.0624607,.481068,-.0716134,.501561,.0707473,.481898,-.0800062,.502054,.0796118,.483022,-.0886568,.502728,.0890974,.484332,-.0977553,.503479,.0992099,.486126,-.107173,.504546,.10999,.488066,-.11677,.50557,.121476,.490521,-.126725,.506849,.133672,.494232,-.136793,.50911,.146731,.498302,-.147116,.511345,.160577,.503565,-.157446,.514344,.175335,.510902,-.168121,.518824,.191207,.519263,-.178799,.523666,.208058,.528204,-.189407,.528296,.225875,.538854,-.200145,.533724,.244782,.551278,-.210701,.539833,.264753,.565222,-.221303,.546131,.285745,.579403,-.231688,.551496,.307592,.595469,-.241718,.556809,.330582,.610929,-.250992,.559641,.354995,.629433,-.259602,.562379,.382471,.648504,-.267038,.563676,.411126,.66756,-.273388,.562092,.440924,.689143,-.278788,.560807,.472118,.709056,-.282783,.555701,.503774,.729855,-.285836,.548698,.536364,.748954,-.287078,.538544,.56895,.768373,-.287133,.526711,.601991,.78827,-.285839,.512511,.635403,.807465,-.283238,.496323,.668797,.825194,-.27906,.477638,.702584,.842203,-.272286,.456253,.736393,.857749,-.263854,.432412,.77096,.874799,-.253943,.407806,.80489,.887497,-.24237,.38033,.83771,.89966,-.230278,.352446,.870376,.911753,-.21646,.323268,.902256,.923011,-.202071,.294314,.933306,.932375,-.185519,.264104,.965177,.940537,-.167604,.234035,.996303,.948904,-.149068,.20412,1.0261,.955263,-.129539,.175431,1.05304,.960303,-.109932,.148116,1.07617,.965512,-.0880572,.119693,1.09742,.973466,-.0660548,.0901619,1.11721,.98284,-.0439228,.0599875,1.13436,.992216,-.0219588,.0298975,1.15006,.999946,119402e-9,-208547e-10,1.16471,.447827,-100414e-10,.491543,914833e-11,.454778,-251257e-9,.499172,22891e-8,.453519,-.00100342,.497787,914184e-9,.45357,-.00225776,.497847,.00205701,.453578,-.00401371,.497855,.00365705,.45357,-.00627107,.497841,.00571453,.453598,-.00902968,.497864,.00823019,.453627,-.0122888,.497882,.0112049,.453684,-.0160475,.497923,.0146405,.453764,-.0203044,.49798,.0185394,.453866,-.0250576,.498049,.0229054,.453996,-.0303028,.49813,.0277424,.454196,-.0360379,.498267,.0330587,.454457,-.0422521,.498445,.0388613,.454926,-.0488393,.498812,.0451767,.455525,-.0558653,.499272,.0520153,.456074,-.0633772,.499625,.0593754,.456752,-.0713606,.500049,.0672751,.457648,-.07971,.500615,.0757447,.458849,-.0883032,.501399,.0848231,.46029,-.0974095,.502293,.0945135,.462,-.106729,.503301,.104848,.464121,-.116354,.504533,.115884,.466889,-.126214,.506172,.127652,.470744,-.136324,.508667,.14024,.47488,-.146595,.510995,.153673,.480845,-.157027,.514832,.168053,.488262,-.167658,.519506,.183508,.496547,-.178343,.524347,.199948,.506254,-.188916,.52983,.217503,.517961,-.199975,.536357,.236272,.531484,-.210624,.543641,.256096,.545496,-.221227,.550048,.277085,.559497,-.231568,.555076,.298615,.575752,-.241698,.560541,.321547,.591999,-.251172,.564156,.345602,.610654,-.260178,.567607,.371851,.630484,-.268094,.56923,.40076,.651807,-.274661,.569779,.430801,.67239,-.280331,.566791,.461939,.693024,-.284501,.562007,.493854,.715473,-.287852,.555791,.526992,.736323,-.28929,.546345,.560102,.755771,-.289405,.534,.593543,.775424,-.2881,.519114,.627256,.795447,-.285562,.502543,.661464,.815319,-.281416,.484773,.695206,.831769,-.275523,.463445,.729044,.849464,-.267516,.440269,.764069,.866775,-.257584,.415049,.799089,.881252,-.245817,.388049,.831948,.894209,-.233127,.35889,.865526,.906922,-.219579,.329915,.89818,.919686,-.204491,.300441,.930013,.929044,-.188962,.269445,.962061,.938393,-.171079,.238402,.994214,.94661,-.15199,.208204,1.02533,.953095,-.131953,.178653,1.0529,.958644,-.111233,.150684,1.0771,.963925,-.0903098,.122359,1.09855,.971995,-.0680505,.0923342,1.11874,.981658,-.0448512,.0614195,1.13635,.991649,-.0221931,.0303582,1.15238,.999985,393403e-9,-111086e-9,1.16772,.396806,-971563e-11,.457671,842355e-11,.429186,-249421e-9,.495017,21625e-8,.429324,-998052e-9,.495173,865322e-9,.429175,-.00224487,.494999,.00194637,.429129,-.00399041,.494952,.00346004,.429153,-.00623476,.494974,.00540684,.429168,-.0089773,.494983,.00778714,.429207,-.0122175,.495012,.0106022,.429257,-.0159542,.495047,.0138535,.429338,-.0201864,.495106,.0175443,.429431,-.0249104,.495165,.0216774,.429587,-.0301252,.495279,.0262594,.429796,-.0358249,.495432,.0312968,.430065,-.0419972,.495621,.0367985,.430588,-.0485144,.496061,.042798,.43113,-.0555028,.496472,.0492914,.431743,-.0629852,.496904,.0562907,.432448,-.0709256,.497369,.0638056,.433414,-.0791942,.498032,.071885,.434638,-.0877346,.498854,.0805517,.43611,-.0968056,.499812,.0898047,.437859,-.106002,.500891,.0997142,.440017,-.115648,.502198,.110289,.443236,-.125427,.504389,.121644,.44697,-.135492,.506809,.133769,.451689,-.145746,.509858,.146787,.45811,-.156219,.514247,.160793,.465305,-.166834,.518816,.175791,.474085,-.177546,.524331,.191906,.484808,-.188262,.53104,.209199,.49732,-.199346,.538511,.227825,.509693,-.209951,.544554,.247269,.524367,-.220533,.551616,.267978,.539228,-.231082,.557368,.289672,.55644,-.241342,.563782,.31268,.574204,-.250964,.568851,.33651,.593388,-.260306,.57312,.362219,.613358,-.268667,.574916,.390322,.634512,-.275591,.575053,.420478,.65563,-.281328,.572404,.451614,.678265,-.285948,.568893,.484112,.70011,-.289408,.561878,.517348,.723005,-.291328,.55359,.551355,.743744,-.291418,.541099,.585109,.763949,-.290252,.526489,.619487,.784186,-.287648,.509496,.65404,.804304,-.283782,.491484,.688649,.823629,-.278067,.470517,.723133,.84094,-.270588,.44705,.757163,.857852,-.261188,.421252,.792816,.874934,-.249313,.394191,.827248,.888709,-.236492,.365359,.861074,.902589,-.222185,.336016,.894417,.914201,-.207314,.30527,.926825,.925978,-.191146,.274532,.9595,.93512,-.174135,.243393,.991583,.943656,-.155231,.212414,1.02356,.951719,-.134403,.182005,1.05239,.957164,-.113023,.153043,1.07754,.962656,-.0914493,.124186,1.09984,.970695,-.0694179,.0941654,1.12,.980749,-.0466199,.0629671,1.13849,.991205,-.0227032,.0311146,1.15494,.999884,632388e-9,-254483e-9,1.1706,.379821,-957289e-11,.460637,789337e-11,.405188,-247483e-9,.491396,204064e-9,.404796,-989434e-9,.490914,815853e-9,.40483,-.00222607,.490949,.00183559,.40473,-.00395723,.49084,.00326332,.404731,-.00618287,.490836,.00509945,.404768,-.00890258,.490871,.00734463,.404791,-.0121156,.490883,.00999992,.404857,-.0158214,.490938,.0130676,.404943,-.0200178,.491004,.0165503,.405059,-.0247027,.491093,.0204521,.405213,-.0298729,.491205,.0247788,.405399,-.0355226,.491333,.0295373,.405731,-.0416352,.491604,.034741,.406303,-.0480807,.492116,.0404255,.406814,-.0550458,.492506,.0465732,.407404,-.0624652,.492926,.0532058,.408149,-.0702958,.493442,.0603442,.409128,-.0784623,.494136,.0680297,.410408,-.087007,.495054,.0762786,.411813,-.0959639,.495962,.0851046,.413735,-.105075,.497257,.0945878,.416137,-.114646,.498882,.104725,.41934,-.124394,.501132,.11563,.423326,-.134328,.503883,.127325,.428419,-.14458,.50747,.139911,.43484,-.154979,.511964,.153481,.442641,-.165628,.517328,.168114,.452511,-.176365,.524258,.183995,.463473,-.187298,.531248,.200953,.475564,-.198244,.538367,.219176,.488664,-.208938,.545175,.238514,.504073,-.219599,.553227,.259129,.520832,-.230378,.560653,.280997,.538455,-.240703,.567523,.303821,.55709,-.250548,.573287,.327948,.576646,-.259964,.577795,.353362,.596705,-.268721,.580077,.380336,.618053,-.276054,.58018,.4101,.640303,-.282176,.578747,.44161,.662365,-.286931,.574294,.474106,.684542,-.290521,.567035,.507549,.707984,-.292672,.558687,.541853,.730913,-.293189,.547606,.576581,.752948,-.292199,.533471,.61172,.773452,-.289508,.516395,.646339,.794715,-.285716,.497873,.682131,.814251,-.280051,.476845,.716396,.833057,-.272873,.453449,.751503,.84959,-.263982,.427857,.786085,.867022,-.252745,.400335,.821355,.882277,-.239655,.371304,.85646,.895375,-.225386,.340397,.890828,.909347,-.209587,.310005,.923532,.921885,-.193433,.2796,.956419,.932127,-.176135,.247276,.989445,.941869,-.157872,.216186,1.02221,.949735,-.137577,.185602,1.05195,.956617,-.115285,.155767,1.07822,.961974,-.0928418,.126103,1.10149,.96972,-.0700592,.0956758,1.12207,.98012,-.0474671,.0643269,1.1408,.990825,-.0238113,.0320863,1.1577,.999876,381574e-9,-812203e-10,1.17403,.367636,-961342e-11,.469176,753287e-11,.380377,-244772e-9,.485434,191797e-9,.380416,-978857e-9,.485475,767015e-9,.380376,-.00220165,.485435,.00172522,.380419,-.00391408,.485487,.00306734,.380438,-.00611549,.485505,.00479332,.380462,-.00880558,.485525,.00690391,.380496,-.0119837,.485551,.00940039,.38056,-.0156487,.485605,.0122848,.38064,-.0197988,.485666,.0155601,.380767,-.0244324,.48577,.0192313,.380909,-.0295444,.485871,.0233032,.381142,-.0351321,.48606,.0277861,.381472,-.0411535,.486336,.0326939,.382015,-.0475408,.486833,.0380565,.382523,-.0544395,.487231,.0438615,.383129,-.061784,.487683,.0501332,.383952,-.0695085,.488313,.0568996,.38498,-.0775819,.489077,.0641952,.386331,-.0860443,.490113,.0720324,.387788,-.0948406,.491099,.0804379,.389808,-.103899,.492566,.0894899,.39252,-.113313,.494601,.0992098,.395493,-.123007,.496619,.109641,.399826,-.132859,.499912,.120919,.405341,-.143077,.504061,.133107,.411932,-.153465,.508905,.146263,.420591,-.164108,.515482,.160544,.43101,-.174893,.523191,.176123,.441881,-.185839,.53026,.192757,.453919,-.196633,.537295,.210535,.468715,-.207611,.546156,.229886,.485182,-.218517,.555173,.250543,.501926,-.229249,.562728,.27221,.51785,-.239481,.567494,.294892,.536947,-.249395,.573889,.318987,.557115,-.259,.578831,.344348,.577966,-.268075,.582055,.371223,.599489,-.276115,.583307,.399834,.62479,-.282523,.583902,.431415,.647504,-.287663,.57953,.464301,.670601,-.291538,.573103,.498123,.693539,-.293842,.563731,.532662,.717385,-.294681,.553169,.567925,.741533,-.293717,.539908,.603502,.762142,-.291156,.521902,.639074,.783014,-.28719,.502815,.674439,.805158,-.281773,.482598,.710497,.823646,-.274682,.458949,.7456,.841879,-.266184,.433129,.781085,.859515,-.255682,.406064,.816,.875335,-.242849,.376509,.851074,.890147,-.228329,.345502,.886473,.903144,-.212491,.31428,.920751,.916618,-.195695,.282994,.954606,.927953,-.178267,.251091,.988402,.937414,-.159549,.219107,1.02141,.946823,-.140022,.18896,1.05167,.954651,-.118154,.158667,1.07819,.959955,-.0946636,.128808,1.1025,.96858,-.0711792,.0973787,1.12391,.97938,-.0475046,.0650965,1.14322,.990498,-.024059,.0326267,1.16077,.999844,-512408e-10,112444e-9,1.17727,.316912,-934977e-11,.425996,695559e-11,.356423,-241372e-9,.479108,179562e-9,.356272,-965292e-9,.478897,71811e-8,.356262,-.00217182,.478894,.00161574,.356265,-.00386092,.478895,.00287261,.356278,-.0060324,.478905,.00448907,.356293,-.00868565,.478914,.00646572,.356346,-.0118207,.478965,.00880438,.356395,-.0154355,.479001,.0115066,.356484,-.019529,.479075,.0145762,.356609,-.0240991,.47918,.018018,.356766,-.0291413,.479305,.0218379,.357009,-.0346498,.479512,.0260454,.357424,-.0405462,.479909,.0306657,.357899,-.0468825,.480337,.0357054,.358424,-.0536887,.480771,.0411728,.359041,-.0609416,.481242,.0470841,.359903,-.0685239,.481943,.0534831,.360932,-.0764883,.482741,.0603795,.362196,-.0848364,.483688,.0678028,.363847,-.0935002,.484947,.0758086,.365972,-.102471,.486588,.0844173,.368741,-.111751,.488787,.0937199,.372146,-.121334,.491405,.103732,.377114,-.131147,.495604,.114608,.38226,-.141213,.499436,.126345,.389609,-.151632,.505334,.139116,.397925,-.162073,.51168,.152995,.407824,-.172819,.518876,.168071,.420014,-.183929,.527639,.184495,.434266,-.195032,.537588,.20232,.447352,-.205792,.544379,.221189,.463726,-.216704,.553422,.241616,.481406,-.227531,.562074,.263298,.498707,-.238017,.568227,.286116,.518039,-.247936,.574473,.3101,.538277,-.257437,.579191,.335401,.561166,-.266829,.584807,.362246,.583189,-.275329,.586476,.390609,.606024,-.28234,.585578,.420998,.632419,-.287924,.584496,.454357,.656128,-.291972,.577766,.488233,.679953,-.29456,.56875,.523248,.704654,-.295816,.558388,.559168,.729016,-.295157,.544826,.595326,.752062,-.292779,.528273,.631864,.773138,-.288681,.508482,.667793,.794869,-.283358,.487341,.704035,.815101,-.27608,.46354,.739925,.834212,-.26767,.438672,.775539,.852368,-.257397,.411239,.810895,.870207,-.245689,.3829,.846472,.884063,-.231452,.351496,.881788,.898284,-.215561,.31895,.917438,.912964,-.198208,.287367,.952422,.924666,-.180426,.254487,.987551,.934429,-.161525,.222226,1.02142,.943485,-.141197,.191143,1.05218,.9521,-.120085,.161112,1.07937,.957876,-.0975881,.130982,1.10403,.966943,-.0726842,.0990553,1.12616,.978313,-.0483705,.0662818,1.14619,.990048,-.0239072,.0329243,1.16413,.999984,461885e-9,-772859e-10,1.18099,.321287,-935049e-11,.455413,659662e-11,.332595,-237513e-9,.471437,167562e-9,.332729,-949964e-9,.471618,670192e-9,.332305,-.00213618,.471028,.00150712,.332326,-.00379765,.471055,.00267959,.332344,-.00593353,.471072,.00418751,.332356,-.00854349,.471077,.00603172,.332403,-.0116268,.471121,.00821362,.332461,-.0151824,.47117,.0107357,.332552,-.0192088,.471251,.0136014,.332657,-.0237024,.47133,.0168152,.332835,-.0286615,.471487,.0203853,.333083,-.0340765,.471708,.0243212,.333547,-.0398563,.47219,.0286518,.333989,-.0460916,.472587,.0333763,.334532,-.0527897,.473054,.0385084,.335167,-.0599284,.473568,.0440638,.33608,-.0673514,.474362,.0500962,.337146,-.0752237,.475231,.0566022,.338462,-.083418,.476282,.0636272,.34014,-.0919382,.477615,.0712153,.342341,-.100741,.479404,.079417,.345088,-.109905,.481618,.0882631,.349049,-.119369,.485081,.0978851,.353939,-.129033,.489317,.108336,.359893,-.139038,.494309,.119698,.366945,-.149411,.499983,.132024,.375814,-.159843,.507185,.145558,.387112,-.170664,.516392,.160433,.40023,-.181897,.526519,.176648,.412555,-.192785,.53423,.193922,.427023,-.203663,.542741,.212662,.443685,-.214695,.552066,.232944,.461499,-.225561,.560762,.254495,.480975,-.236257,.569421,.277531,.501,-.24639,.576101,.301724,.521691,-.256101,.581493,.327112,.543478,-.265289,.585221,.353917,.566094,-.273938,.587614,.381941,.589578,-.281679,.587991,.41172,.614583,-.287655,.585928,.444148,.641813,-.292228,.582092,.478617,.666189,-.295172,.57398,.51397,.690475,-.29648,.561676,.550118,.715543,-.296203,.548758,.586933,.740405,-.293999,.532792,.62384,.762183,-.28998,.512735,.660723,.786069,-.28478,.492402,.69807,.806812,-.277568,.469058,.734422,.826987,-.268951,.443017,.770946,.844588,-.259049,.415501,.80699,.863725,-.2471,.387328,.842107,.879137,-.234157,.356108,.878078,.894634,-.218719,.324315,.914058,.909162,-.201293,.291813,.949922,.92072,-.18267,.258474,.985337,.93158,-.163212,.225593,1.0205,.941238,-.142771,.193986,1.05273,.949293,-.120956,.163392,1.08075,.956226,-.0985743,.132934,1.10559,.96546,-.075118,.101255,1.12823,.977403,-.0497921,.0675441,1.149,.989648,-.0241574,.0334681,1.16765,1.00001,5762e-7,-184807e-9,1.18519,.303474,-916603e-11,.4542,61243e-10,.308894,-232869e-9,.462306,155592e-9,.309426,-931661e-9,.463093,622499e-9,.308643,-.0020949,.461933,.00139979,.308651,-.0037242,.461941,.00248874,.308662,-.00581873,.46195,.00388933,.308687,-.00837818,.461974,.00560247,.308728,-.0114016,.462011,.00762948,.308789,-.0148884,.462067,.00997326,.308882,-.0188369,.462151,.0126375,.309007,-.0232436,.462263,.0156271,.30918,-.0281054,.462417,.0189498,.309442,-.0334065,.462667,.0226167,.309901,-.0390589,.463162,.0266614,.310331,-.0452042,.463555,.0310715,.310858,-.0517735,.464019,.0358698,.311576,-.0587359,.464669,.0410848,.312436,-.0660383,.465406,.0467453,.313526,-.0737266,.466339,.0528718,.314903,-.0817574,.467504,.0595039,.316814,-.090167,.469226,.0666888,.318965,-.0987555,.470981,.0744658,.322077,-.107792,.473814,.082912,.325947,-.117098,.477241,.0920846,.331008,-.126602,.48184,.102137,.337893,-.136619,.488334,.113135,.345106,-.146838,.494415,.12511,.355111,-.157357,.503275,.138356,.365095,-.167955,.510966,.152686,.378344,-.179157,.521508,.16856,.391599,-.190143,.530455,.18561,.407786,-.20123,.541275,.204308,.425294,-.212456,.551784,.224623,.444021,-.223568,.561493,.246172,.463418,-.234154,.569886,.268979,.484077,-.244546,.577116,.293411,.505513,-.254301,.582914,.318936,.527672,-.263564,.587208,.345856,.550565,-.272332,.589277,.374054,.573656,-.280011,.588426,.403276,.59827,-.286924,.587504,.43474,.624731,-.291994,.583401,.468767,.652396,-.295159,.576997,.504411,.67732,-.296954,.565863,.54114,.703147,-.296877,.552316,.57816,.728715,-.295147,.536773,.616124,.752448,-.291275,.51771,.653885,.775169,-.285905,.496087,.691537,.799307,-.279064,.474232,.729251,.819482,-.270294,.447676,.766267,.837659,-.260032,.419656,.802616,.856903,-.248497,.391328,.838583,.873325,-.235252,.360285,.874711,.889788,-.221126,.329215,.91077,.904486,-.204304,.296392,.94653,.917711,-.185562,.262159,.983828,.928969,-.165635,.229142,1.01955,.939707,-.14442,.19673,1.05317,.948167,-.122147,.165095,1.0823,.955222,-.099098,.13451,1.10791,.964401,-.0755332,.102476,1.1312,.976605,-.0513817,.0689667,1.15218,.989085,-.0258499,.034506,1.17129,.999908,617773e-9,-271268e-9,1.18961,.285803,-905752e-11,.452348,572272e-11,.284689,-22732e-8,.450581,143626e-9,.285263,-910214e-9,.451482,575099e-9,.285302,-.00204784,.451553,.00129395,.285318,-.00364057,.451574,.0023006,.28533,-.00568813,.451585,.00359547,.285361,-.00819001,.451618,.00517934,.285397,-.0111458,.45165,.007054,.285447,-.0145536,.451688,.00922167,.285527,-.0184127,.451758,.0116869,.285688,-.0227207,.451929,.0144555,.28584,-.0274712,.452055,.0175341,.286136,-.0326278,.452369,.0209406,.286574,-.0381792,.452853,.0246965,.287012,-.0441879,.453272,.0287996,.287542,-.0506096,.453752,.033268,.288299,-.0573634,.454488,.0381504,.289186,-.0645458,.455294,.0434447,.290302,-.0720405,.456301,.0491973,.291776,-.0799046,.457648,.0554453,.29372,-.088117,.459483,.0622311,.296052,-.0965328,.461571,.0695992,.299563,-.105409,.465085,.077658,.30335,-.114553,.468506,.0864176,.309167,-.123917,.474423,.0961078,.31529,-.13381,.47995,.106643,.324163,-.144021,.488592,.118322,.333272,-.154382,.496461,.131133,.344224,-.165015,.50562,.145208,.357733,-.176168,.516719,.16073,.373046,-.187468,.528513,.177807,.38788,-.198488,.537713,.196072,.405133,-.209545,.547999,.21605,.423845,-.220724,.55759,.237484,.443777,-.231518,.566246,.26039,.464824,-.242035,.574326,.284835,.486635,-.251898,.58037,.310518,.51012,-.261304,.58568,.337678,.535301,-.270384,.590197,.366242,.559193,-.27841,.590569,.395873,.583544,-.285325,.588161,.426857,.608834,-.291113,.584249,.459477,.635753,-.294882,.57763,.494734,.664367,-.297088,.569479,.532023,.689688,-.297364,.555064,.569629,.715732,-.295949,.539522,.608124,.741307,-.292259,.521613,.646231,.764949,-.287063,.49969,.684938,.788599,-.28012,.476747,.723548,.81048,-.27153,.45116,.761135,.831372,-.261289,.424101,.798916,.850092,-.249559,.39443,.835952,.867777,-.236348,.363849,.871606,.884632,-.221569,.332477,.907843,.90047,-.20618,.300667,.944187,.914524,-.188771,.266552,.981371,.926892,-.168362,.232349,1.01841,.937951,-.146761,.199359,1.05308,.947236,-.123813,.1675,1.0839,.954367,-.099984,.136166,1.11047,.963907,-.0759278,.103808,1.13414,.976218,-.0511367,.0697061,1.15575,.988772,-.0267415,.0352529,1.17531,.999888,-520778e-9,289926e-9,1.19389,.263546,-883274e-11,.441896,526783e-11,.262352,-221849e-9,.439889,132311e-9,.262325,-886683e-9,.439848,528824e-9,.26228,-.00199476,.439765,.00118975,.262372,-.00354671,.439922,.00211568,.26239,-.00554141,.439941,.00330652,.262412,-.00797888,.439961,.00476346,.262453,-.0108584,.440002,.00648818,.262528,-.0141788,.440085,.0084835,.262615,-.017938,.440166,.0107533,.262744,-.0221346,.440291,.0133044,.262939,-.026762,.440493,.0161445,.263277,-.0317573,.440889,.0192974,.26368,-.0371832,.441338,.0227699,.264106,-.0430371,.441753,.0265698,.264624,-.0493035,.442227,.0307178,.265378,-.0558669,.442985,.0352616,.266253,-.0628718,.443795,.0401968,.267478,-.0701569,.445008,.04559,.269062,-.077845,.446599,.0514539,.270926,-.0857941,.448349,.0578382,.273693,-.0940773,.451221,.0648363,.276746,-.102704,.454097,.0724389,.281693,-.111735,.459517,.0808744,.287335,-.121004,.46531,.0901551,.29448,-.130734,.472605,.100371,.30257,-.140777,.480251,.111644,.312465,-.15111,.489444,.124111,.324856,-.16189,.500919,.137979,.33774,-.172946,.511317,.153163,.35255,-.184152,.522684,.169817,.367786,-.19522,.53248,.187886,.385474,-.20632,.543326,.207634,.404976,-.217744,.554109,.229165,.425203,-.228691,.563395,.252068,.446704,-.239299,.571565,.276471,.468951,-.249348,.577935,.302323,.493487,-.258933,.584309,.329882,.517861,-.268009,.58773,.358525,.543309,-.276238,.589612,.388585,.569704,-.28356,.589294,.419787,.594871,-.289497,.585137,.452114,.622555,-.294452,.580356,.486466,.651167,-.296918,.57185,.523079,.677332,-.297647,.558428,.5611,.703718,-.296321,.542232,.599592,.730262,-.293339,.524541,.639138,.754304,-.288036,.502691,.677978,.778051,-.281018,.479212,.716537,.801557,-.272414,.454071,.75586,.822559,-.262419,.425952,.794477,.843051,-.250702,.397313,.832664,.86232,-.237264,.366534,.869876,.879044,-.222716,.334816,.906973,.896362,-.206827,.303143,.943558,.910342,-.189659,.269699,.979759,.924119,-.171108,.236411,1.01718,.935374,-.149579,.202224,1.05289,.944295,-.126295,.16989,1.08496,.952227,-.101511,.138089,1.11256,.962041,-.0766392,.105053,1.1375,.97528,-.0511967,.070329,1.15983,.988476,-.025463,.0351268,1.17987,.999962,286808e-10,145564e-10,1.19901,.227089,-841413e-11,.404216,472707e-11,.239725,-215083e-9,.426708,120833e-9,.239904,-860718e-9,.427028,483555e-9,.239911,-.00193661,.427039,.00108806,.239914,-.00344276,.42704,.00193457,.239933,-.00537907,.427064,.00302363,.239944,-.00774482,.427065,.00435604,.239993,-.01054,.427122,.00593398,.240052,-.0137626,.427179,.00775987,.240148,-.0174115,.427279,.00983854,.240278,-.021484,.42741,.0121763,.240472,-.0259729,.427618,.0147827,.240839,-.0308131,.428086,.0176837,.241201,-.0360893,.428482,.0208775,.241626,-.0417723,.428907,.0243821,.242207,-.0478337,.42952,.0282228,.24298,-.0542199,.430332,.0324333,.243881,-.0610015,.431222,.0370252,.245123,-.0680874,.432512,.0420535,.24667,-.0755482,.434088,.0475414,.248779,-.0832873,.436323,.0535542,.251665,-.0913546,.439509,.0601716,.255305,-.0998489,.443478,.0674282,.260049,-.108576,.448713,.0754673,.266192,-.117754,.455524,.084339,.273158,-.127294,.4627,.0941683,.282131,-.137311,.472068,.10515,.293332,-.147736,.483565,.117402,.304667,-.158357,.493702,.130824,.317785,-.169274,.504708,.145724,.333245,-.180595,.517107,.16215,.349843,-.191892,.528849,.180149,.367944,-.203168,.540301,.199746,.387579,-.214443,.551514,.221047,.408247,-.225624,.560906,.243981,.43014,-.236422,.56959,.268513,.452669,-.24654,.576098,.294409,.476196,-.256157,.580925,.322002,.501157,-.265289,.584839,.351052,.527632,-.273671,.587614,.3812,.555754,-.281254,.589119,.412994,.581682,-.287448,.585204,.445498,.608196,-.292614,.579006,.479505,.635661,-.296068,.571297,.514643,.664999,-.297395,.560855,.552213,.691039,-.296645,.544525,.591365,.7179,-.293785,.526535,.630883,.744059,-.289089,.50545,.670932,.76863,-.282239,.482514,.710904,.793273,-.273688,.457246,.750259,.814731,-.26328,.428872,.78948,.835603,-.251526,.399384,.828597,.85489,-.238339,.368811,.866892,.872828,-.223607,.336617,.90563,.889462,-.207538,.303997,.943538,.904929,-.190297,.270812,.980591,.919101,-.172034,.237453,1.01935,.930536,-.152058,.204431,1.05498,.941223,-.129515,.172495,1.08717,.94982,-.104263,.140175,1.11551,.960592,-.0781944,.106465,1.14098,.974629,-.051688,.0711592,1.16418,.98811,-.0253929,.0354432,1.18465,1.00004,804378e-9,-330876e-9,1.20462,.214668,-821282e-11,.406619,433582e-11,.218053,-208144e-9,.413025,109887e-9,.217987,-832212e-9,.412901,439362e-9,.217971,-.00187246,.412876,988623e-9,.217968,-.00332855,.41286,.00175772,.217985,-.00520055,.412882,.00274729,.218014,-.00748814,.412916,.00395842,.218054,-.0101901,.412957,.00539274,.218106,-.0133057,.413005,.00705348,.218217,-.0168342,.413139,.00894581,.218338,-.0207707,.413258,.0110754,.21855,-.0251001,.413509,.0134551,.218913,-.0297861,.413992,.0161081,.219265,-.0348956,.414383,.0190307,.219696,-.0403909,.414839,.0222458,.220329,-.0462003,.415567,.025792,.220989,-.0524208,.41621,.0296637,.222027,-.058948,.417385,.0339323,.223301,-.0658208,.418779,.0386055,.224988,-.0730347,.420665,.0437355,.227211,-.0805274,.423198,.0493844,.230131,-.088395,.426566,.0556135,.233908,-.0966208,.43091,.0624829,.239092,-.105223,.437148,.0701636,.245315,-.11424,.444302,.0786949,.253166,-.12368,.453262,.0882382,.262374,-.133569,.463211,.0988682,.273145,-.143836,.474271,.110727,.285512,-.154577,.4863,.123945,.299512,-.165501,.498817,.138581,.314287,-.176698,.510341,.154676,.331083,-.188066,.522583,.172459,.349615,-.199597,.534879,.191979,.369318,-.210843,.546083,.21309,.390377,-.222068,.5562,.235998,.412411,-.233059,.564704,.260518,.435715,-.24357,.572314,.286795,.461196,-.253356,.579395,.314559,.485587,-.262362,.581985,.343581,.511908,-.270895,.584347,.374367,.539798,-.278452,.58505,.406015,.567974,-.284877,.583344,.439168,.594303,-.290124,.577348,.473005,.622951,-.294183,.570751,.508534,.652404,-.296389,.561541,.544764,.679291,-.296605,.546426,.582927,.706437,-.294095,.528599,.622681,.734485,-.28978,.508676,.663567,.758841,-.283363,.484768,.704092,.78537,-.275015,.460434,.745101,.807315,-.264689,.432166,.784712,.8271,-.252597,.401807,.824241,.849191,-.239154,.371458,.863803,.867046,-.224451,.338873,.903063,.8852,-.208342,.306175,.942763,.901771,-.190684,.272759,.981559,.915958,-.172105,.239306,1.02048,.928046,-.152214,.206071,1.05765,.939961,-.130247,.17367,1.08999,.948711,-.10672,.142201,1.11829,.959305,-.0808688,.108454,1.14467,.973009,-.0539145,.0728109,1.16839,.987631,-.0262947,.0360625,1.19004,.999978,.00132758,-559424e-9,1.21058,.193925,-793421e-11,.391974,392537e-11,.196746,-200315e-9,.397675,991033e-10,.19667,-801099e-9,.397521,396342e-9,.196633,-.00180246,.397445,891829e-9,.196654,-.00320443,.397482,.00158582,.196659,-.00500647,.39748,.00247867,.196683,-.0072086,.397506,.00357167,.196728,-.00981001,.397562,.00486675,.196792,-.0128096,.397633,.00636707,.19689,-.0162055,.397746,.00807752,.197017,-.0199943,.397884,.0100052,.19729,-.024139,.39827,.0121691,.197583,-.0286671,.398639,.0145755,.197927,-.0335858,.399034,.0172355,.198383,-.0388806,.399554,.0201718,.199002,-.0444736,.400289,.0234194,.199739,-.0504583,.401111,.026984,.200784,-.056729,.402349,.0309217,.202075,-.0633643,.403841,.0352496,.203898,-.0703247,.406076,.0400313,.206199,-.0775565,.408841,.0453282,.209252,-.085184,.41259,.0511794,.213638,-.0931994,.418288,.0577459,.21881,-.101617,.424681,.0650508,.225642,-.11052,.433429,.0732759,.233717,-.119772,.442897,.0824683,.242823,-.129505,.452888,.0927484,.254772,-.139906,.466407,.104417,.266603,-.150402,.477413,.117211,.28073,-.161395,.490519,.131598,.295399,-.172465,.50201,.147407,.312705,-.183982,.515311,.165031,.331335,-.195532,.52786,.184336,.351037,-.206971,.5392,.205361,.372175,-.218117,.54941,.228043,.394548,-.229327,.558642,.25267,.419598,-.240052,.567861,.279071,.443922,-.249937,.573332,.306882,.471495,-.259407,.58013,.33661,.496769,-.267749,.580564,.367328,.524951,-.275524,.581696,.399753,.55318,-.282148,.579885,.433134,.581577,-.287533,.575471,.467534,.609231,-.291612,.567445,.502943,.637478,-.293911,.557657,.53871,.667795,-.295096,.546535,.576568,.694272,-.294073,.529561,.614929,.722937,-.290386,.510561,.655909,.749682,-.284481,.487846,.697663,.774754,-.276188,.462487,.738515,.799301,-.266215,.43481,.779802,.820762,-.254116,.404879,.820045,.843231,-.240393,.374559,.860294,.861857,-.225503,.341582,.900965,.880815,-.209382,.308778,.941727,.89766,-.19155,.275232,.980916,.912926,-.172346,.240938,1.02162,.926391,-.151799,.207223,1.0597,.938429,-.129968,.17484,1.09291,.947834,-.10651,.142984,1.12248,.958432,-.0824098,.109902,1.149,.972402,-.0565242,.0744454,1.1733,.987191,-.028427,.0373794,1.19538,.999975,385685e-10,-4203e-8,1.21676,.178114,-766075e-11,.385418,354027e-11,.176074,-191966e-9,.381002,887135e-10,.17601,-767549e-9,.380861,354715e-9,.17598,-.00172696,.380798,798168e-9,.175994,-.00307012,.380824,.00141928,.176017,-.00479684,.380858,.00221859,.176019,-.00690648,.380839,.00319714,.176072,-.00939888,.380913,.0043572,.176131,-.0122726,.380979,.005702,.176239,-.0155264,.38112,.00723689,.176371,-.0191551,.381272,.00896907,.176638,-.023117,.381669,.0109194,.176912,-.0274633,.382015,.0130903,.177279,-.032173,.382476,.0154949,.17774,-.0372219,.383041,.0181669,.178344,-.0426132,.38378,.0211209,.179153,-.0483309,.384773,.0243899,.180197,-.0543447,.386076,.0280062,.181581,-.0607122,.387809,.032004,.18344,-.0673855,.390205,.036453,.186139,-.0743989,.393944,.0414162,.189432,-.0817731,.39832,.0469394,.193795,-.0895464,.404188,.0531442,.199641,-.0978264,.4121,.0601374,.206679,-.106499,.421425,.0680078,.214865,-.115654,.431504,.076919,.224406,-.125268,.442526,.0868835,.235876,-.135475,.455465,.0981875,.248335,-.146023,.4681,.110759,.262868,-.157016,.482069,.124885,.278962,-.168245,.496182,.140645,.295082,-.17958,.507401,.157838,.313738,-.191227,.520252,.17695,.333573,-.202718,.531708,.197817,.356433,-.214424,.544509,.220785,.378853,-.225492,.55373,.245306,.402717,-.236236,.561348,.271593,.428375,-.246568,.568538,.299776,.454724,-.255941,.573462,.329433,.482291,-.264511,.576356,.360598,.509706,-.272129,.576446,.393204,.538805,-.278979,.575298,.427227,.568919,-.284528,.572154,.462157,.596804,-.288801,.564691,.497997,.625987,-.291334,.555134,.534467,.656414,-.292722,.545051,.571736,.683916,-.292185,.528813,.610158,.711809,-.290043,.51106,.649061,.739547,-.285246,.490103,.690081,.766914,-.277647,.465523,.732554,.791375,-.267603,.437718,.773982,.814772,-.256109,.40882,.81609,.836691,-.242281,.377823,.856849,.856984,-.227155,.34496,.898363,.876332,-.210395,.311335,.939471,.894988,-.192612,.277703,.980799,.911113,-.173236,.243019,1.02215,.924092,-.152258,.209037,1.06139,.936828,-.129575,.175909,1.09635,.946869,-.10594,.143852,1.12707,.958284,-.081318,.110289,1.15419,.972325,-.0556133,.0747232,1.17909,.986878,-.0297899,.0383149,1.20163,.999936,-.00197169,912402e-9,1.22338,.151174,-720365e-11,.351531,309789e-11,.155594,-18279e-8,.361806,78608e-9,.156099,-731569e-9,.362982,314615e-9,.156053,-.00164578,.362869,707845e-9,.156093,-.0029261,.362961,.00125884,.156099,-.00457155,.362959,.00196783,.15612,-.00658224,.362982,.00283622,.156168,-.00895774,.363048,.00386625,.156221,-.0116962,.363101,.00506109,.156324,-.0147973,.363241,.00642675,.156476,-.0182503,.363448,.00797175,.156731,-.0220266,.36384,.00971484,.156994,-.026176,.364179,.0116575,.157341,-.0306701,.36462,.0138207,.157867,-.0354591,.365364,.0162356,.15846,-.0406141,.366111,.0189092,.159308,-.0460519,.367248,.021885,.160426,-.0518096,.368767,.0252004,.161877,-.0578906,.370745,.0288825,.163995,-.0642812,.373831,.0330139,.16655,-.0710067,.377366,.0376283,.170237,-.0781522,.382799,.0428493,.175096,-.0857172,.389915,.0487324,.181069,-.0938025,.398487,.0554214,.188487,-.102363,.408799,.0630189,.197029,-.111343,.419991,.071634,.206684,-.120812,.431455,.0812797,.218698,-.131033,.445746,.0923651,.230726,-.141373,.457471,.104545,.245516,-.152387,.472388,.118449,.261551,-.163628,.486671,.133923,.277437,-.174814,.49762,.150849,.296662,-.186713,.51162,.169924,.31795,-.198513,.525435,.190848,.339422,-.210119,.536267,.213504,.362143,-.221354,.545982,.237947,.387198,-.23224,.555364,.264427,.412349,-.24257,.561489,.292519,.439274,-.252284,.566903,.322561,.466779,-.261023,.569614,.353952,.496011,-.26899,.571589,.387278,.524964,-.275498,.570325,.421356,.556518,-.281449,.568792,.457314,.584363,-.285526,.560268,.493199,.614214,-.28844,.55205,.530276,.645684,-.289777,.541906,.56855,.673446,-.289722,.526464,.606927,.701924,-.287792,.509872,.645945,.73037,-.284315,.490649,.685564,.757405,-.278804,.467964,.726511,.784025,-.269543,.441468,.768601,.808255,-.258117,.41216,.811321,.830739,-.244728,.380606,.853496,.851914,-.229428,.348111,.895374,.872586,-.212508,.314732,.937674,.891581,-.194025,.280338,.979869,.907641,-.174711,.245203,1.02253,.922233,-.153509,.21077,1.06371,.935878,-.130418,.177399,1.09972,.946338,-.105558,.144507,1.13124,.957265,-.080059,.110508,1.15973,.971668,-.0539766,.0742311,1.18515,.9866,-.0277101,.0375224,1.20858,1.00021,-515531e-9,135226e-9,1.23135,.137468,-686011e-11,.345041,273315e-11,.13703,-173378e-9,.343936,690761e-10,.136986,-693048e-9,.34383,276126e-9,.136964,-.00155931,.343761,621337e-9,.137003,-.00277211,.343863,.00110494,.137012,-.00433103,.343868,.00172744,.137043,-.00623606,.343916,.00249022,.13709,-.0084868,.343986,.00339559,.137145,-.0110814,.344045,.00444687,.137242,-.0140187,.344177,.00565007,.137431,-.0172713,.344491,.00701868,.137644,-.0208605,.344805,.00856042,.13791,-.024792,.345172,.0102863,.138295,-.0290461,.345734,.0122185,.138764,-.0335957,.346371,.0143771,.139415,-.038467,.347298,.0167894,.140272,-.0436176,.348527,.0194895,.141457,-.0491016,.350276,.0225043,.14303,-.0548764,.352646,.0258962,.145289,-.0610096,.356206,.0297168,.148502,-.0674777,.361488,.0340562,.152188,-.074345,.367103,.0389534,.157359,-.0817442,.375247,.0445541,.16379,-.0896334,.385064,.0509535,.171376,-.098005,.396082,.0582611,.179901,-.106817,.407418,.06654,.189892,-.116239,.420031,.075994,.201838,-.12627,.434321,.0867239,.214311,-.136701,.447631,.0987517,.228902,-.147616,.462046,.112353,.245107,-.158871,.476942,.127605,.262292,-.170261,.490285,.144469,.281215,-.182017,.503783,.163282,.301058,-.193729,.515505,.183873,.322752,-.205512,.52682,.206466,.347547,-.217214,.539473,.231194,.370969,-.227966,.546625,.257288,.397533,-.238555,.55472,.285789,.42398,-.248278,.559468,.315746,.452928,-.257422,.564095,.347724,.482121,-.265306,.565426,.380922,.510438,-.272043,.563205,.415639,.541188,-.277614,.561087,.451702,.571667,-.281927,.554922,.48845,.602432,-.285015,.546838,.526442,.634126,-.286512,.537415,.564896,.662816,-.286388,.522906,.604037,.692411,-.284734,.507003,.643795,.720946,-.281297,.488398,.68298,.748293,-.276262,.466353,.723466,.776931,-.269978,.443573,.764565,.801065,-.260305,.415279,.805838,.825843,-.247426,.384773,.849985,.84807,-.232437,.352555,.893174,.869122,-.215806,.318642,.936564,.888963,-.197307,.28381,.980253,.905547,-.177203,.247888,1.02463,.918554,-.155542,.212904,1.06714,.931395,-.131948,.1787,1.10451,.941749,-.106723,.145902,1.13694,.954551,-.0804939,.111193,1.1666,.970279,-.0534239,.0744697,1.19249,.986117,-.0257452,.0368788,1.21665,.999938,.00190634,-.0010291,1.23981,.118493,-647439e-11,.32272,23772e-10,.118765,-163023e-9,.323456,598573e-10,.118772,-65212e-8,.323477,239447e-9,.118843,-.00146741,.323657,538881e-9,.118804,-.00260846,.323553,95826e-8,.118826,-.00407576,.323595,.00149845,.118846,-.00586826,.323617,.00216047,.118886,-.00798578,.32367,.00294679,.118947,-.0104273,.323753,.00386124,.119055,-.0131909,.323922,.00490999,.119241,-.0162444,.324251,.00610804,.11944,-.0196339,.324544,.00745805,.119739,-.0233378,.325026,.00897805,.12011,-.0273179,.325586,.0106895,.120571,-.0316143,.326231,.0126073,.12124,-.0361939,.327264,.0147654,.122162,-.0410511,.328733,.0172001,.123378,-.0462233,.330659,.0199375,.125183,-.0517109,.333754,.0230498,.127832,-.0575652,.338507,.026597,.130909,-.0637441,.343666,.0306345,.135221,-.0704302,.351063,.035273,.14082,-.0776364,.360604,.0406137,.146781,-.0852293,.369638,.0466788,.155121,-.0935351,.3827,.0537628,.16398,-.102234,.39522,.0617985,.173926,-.111465,.40793,.07097,.185137,-.121296,.42105,.0813426,.19826,-.13169,.435735,.0931596,.212938,-.142614,.450932,.106547,.229046,-.153884,.465726,.121575,.246246,-.165382,.479461,.138286,.264637,-.176806,.492106,.15666,.284959,-.188793,.504774,.17728,.308157,-.200763,.518805,.19988,.330951,-.21239,.528231,.224293,.3549,-.223521,.536376,.250541,.381502,-.234169,.544846,.278902,.409529,-.244077,.551717,.309227,.437523,-.253363,.55517,.341426,.467624,-.261659,.557772,.37518,.497268,-.268498,.556442,.41007,.528294,-.274018,.553915,.446445,.559053,-.278169,.549153,.483779,.589329,-.281229,.539878,.522249,.622503,-.282902,.53162,.561754,.652382,-.282815,.518119,.601544,.681847,-.281247,.502187,.641574,.712285,-.277986,.484824,.682633,.740094,-.273017,.463483,.723426,.768478,-.266692,.441299,.763747,.794556,-.258358,.415238,.805565,.819408,-.248807,.386912,.847254,.843411,-.236214,.356165,.891091,.862397,-.219794,.320562,.936174,.883113,-.201768,.285322,.982562,.90023,-.181672,.249713,1.02862,.915192,-.159279,.214546,1.07163,.928458,-.134725,.180285,1.10995,.94069,-.10913,.147119,1.14354,.953409,-.0821315,.112492,1.17372,.969537,-.0542677,.0752014,1.20043,.985612,-.0259096,.0370361,1.22528,.999835,.00298198,-.00151801,1.24959,.10097,-602574e-11,.300277,202619e-11,.101577,-152164e-9,.302077,511662e-10,.101572,-608889e-9,.302066,204751e-9,.101566,-.00136997,.302047,460753e-9,.101592,-.00243557,.302114,819497e-9,.101608,-.0038053,.30214,.00128154,.101627,-.00547906,.30216,.0018483,.101669,-.00745647,.302224,.00252223,.101732,-.00973615,.302318,.00330716,.101844,-.0123097,.302513,.00421061,.102025,-.0151681,.30285,.00524481,.102224,-.0183334,.303166,.0064154,.102515,-.0217819,.303654,.00774063,.102886,-.0255067,.304243,.0092398,.103395,-.029514,.305089,.0109339,.104109,-.0337912,.306301,.0128561,.105074,-.0383565,.30798,.0150338,.10654,-.0432132,.310726,.0175228,.108478,-.0484244,.314351,.0203648,.111015,-.0539339,.319032,.0236325,.114682,-.0598885,.32605,.0274188,.11911,-.0663375,.334109,.0317905,.124736,-.0733011,.344013,.0368502,.131479,-.0807744,.355358,.0427104,.139283,-.0888204,.367614,.0494788,.148054,-.0973394,.380072,.0572367,.159037,-.10665,.395678,.0662704,.169794,-.116221,.40795,.0763192,.18314,-.126632,.423546,.087956,.197515,-.137383,.438213,.101042,.213514,-.148641,.453248,.115827,.23065,-.160117,.46688,.132283,.249148,-.171807,.479962,.150644,.270219,-.183695,.494618,.171073,.292338,-.195574,.506937,.193378,.314999,-.207205,.516463,.217585,.340991,-.218955,.528123,.24428,.367982,-.229917,.537025,.272784,.39432,-.239737,.541627,.302742,.423364,-.249048,.546466,.335112,.453751,-.257329,.549466,.369032,.48416,-.264623,.549503,.404577,.515262,-.270411,.547008,.441337,.547036,-.274581,.542249,.479162,.576614,-.277266,.533015,.517904,.611143,-.279144,.525512,.558508,.640989,-.279001,.51154,.598995,.671182,-.277324,.495641,.639935,.700848,-.273908,.477526,.681017,.729862,-.269063,.457955,.722764,.758273,-.262282,.434846,.764349,.784121,-.254281,.409203,.806206,.809798,-.24505,.382694,.848617,.834953,-.233861,.354034,.892445,.856817,-.221308,.321764,.936263,.877609,-.205996,.288118,.982401,.897489,-.186702,.253277,1.02975,.913792,-.164618,.217963,1.07488,.92785,-.140023,.183221,1.11487,.940378,-.11328,.149385,1.14947,.95273,-.0853958,.114152,1.1807,.969059,-.0568698,.0769845,1.20912,.985574,-.0276502,.0381186,1.23498,.999943,.00239052,-.00126861,1.25987,.0852715,-560067e-11,.279021,171162e-11,.0854143,-140871e-9,.279483,430516e-10,.0854191,-563385e-9,.2795,172184e-9,.0854188,-.00126753,.279493,387464e-9,.0854229,-.00225337,.279501,68918e-8,.0854443,-.00352086,.279549,.00107803,.0854697,-.00506962,.279591,.00155536,.0855093,-.00689873,.279652,.00212354,.0855724,-.00900821,.279752,.00278703,.0856991,-.0113799,.280011,.0035551,.085855,-.0140314,.280297,.00443449,.0860682,-.016963,.280682,.00543636,.086344,-.0201438,.281159,.0065788,.0867426,-.0235999,.281886,.00787977,.087239,-.0273069,.282745,.0093606,.0879815,-.031269,.284139,.011056,.0891258,-.035531,.28647,.0130065,.0906909,-.0400947,.289708,.0152495,.0927624,-.0449638,.293904,.0178454,.0958376,-.0502427,.300471,.0208915,.0995827,-.0559514,.30806,.0244247,.104526,-.0622152,.317874,.0285721,.110532,-.0690046,.329332,.0334227,.117385,-.0763068,.341217,.0390466,.12522,-.084184,.353968,.0455786,.134037,-.0925248,.366797,.0530773,.144014,-.101487,.380209,.0617424,.156013,-.111273,.395956,.071777,.168872,-.121431,.41053,.0830905,.183089,-.132105,.425073,.0959341,.198763,-.143286,.439833,.110448,.216159,-.154841,.454507,.126769,.234859,-.166588,.468368,.14495,.255879,-.178626,.482846,.165233,.27677,-.190218,.493489,.187217,.301184,-.202227,.506549,.211659,.325852,-.213764,.5158,.237922,.352824,-.22487,.525442,.26632,.380882,-.235246,.532487,.296691,.410137,-.244847,.537703,.329179,.439787,-.253122,.540361,.363135,.472291,-.260517,.542734,.399222,.501856,-.266519,.538826,.436352,.534816,-.270905,.535152,.474505,.565069,-.273826,.525979,.513988,.597154,-.275333,.516394,.554852,.630473,-.275314,.506206,.596592,.660574,-.273323,.489769,.638117,.692015,-.270008,.472578,.680457,.720647,-.265001,.452134,.723008,.750528,-.258311,.430344,.765954,.777568,-.250046,.405624,.809012,.80387,-.240114,.378339,.852425,.828439,-.228737,.349877,.895346,.851472,-.216632,.318968,.940695,.873906,-.202782,.287489,.987235,.89467,-.187059,.254394,1.03348,.912281,-.168818,.221294,1.07812,.927358,-.146494,.18675,1.11928,.940385,-.120009,.152322,1.15609,.952672,-.0917183,.117514,1.18875,.968496,-.0620321,.0797405,1.21821,.985236,-.0314945,.0402383,1.24523,.99998,-575153e-9,110644e-9,1.27133,.0702429,-512222e-11,.255273,140947e-11,.0702981,-128826e-9,.255469,354488e-10,.0703691,-515562e-9,.255727,141874e-9,.0703805,-.00116,.255754,31929e-8,.0703961,-.00206224,.255813,567999e-9,.0704102,-.00322223,.255839,88871e-8,.0704298,-.00463928,.255863,.00128272,.0704759,-.00631375,.255953,.00175283,.0705434,-.00824317,.256079,.00230342,.0706693,-.010412,.25636,.0029443,.0708189,-.0128439,.256647,.00368031,.0710364,-.0155177,.257084,.00452614,.0713223,-.0184374,.257637,.00549706,.0717182,-.0216002,.258416,.00661246,.072321,-.0249966,.259699,.00790147,.0731446,-.0286566,.261475,.0093884,.0743352,-.0325888,.264132,.0111186,.0760676,-.036843,.26815,.013145,.078454,-.0414292,.273636,.0155251,.0818618,-.0464634,.281653,.0183525,.0857382,-.0519478,.289992,.0216642,.0908131,-.0579836,.30066,.0255956,.0967512,-.0645124,.312204,.0301954,.103717,-.0716505,.325001,.0356017,.111596,-.0793232,.338129,.041896,.120933,-.087645,.352853,.0492447,.130787,-.096492,.366192,.0576749,.142311,-.105973,.380864,.0673969,.155344,-.116182,.396575,.0785899,.169535,-.126815,.411443,.0912377,.185173,-.138015,.426256,.105607,.201755,-.149325,.439607,.121551,.221334,-.161207,.455467,.139608,.241461,-.173162,.469096,.159591,.26294,-.18504,.481014,.18156,.286776,-.196881,.493291,.205781,.311596,-.208311,.503556,.231819,.338667,-.219671,.513268,.260274,.366021,-.230451,.519414,.290862,.395875,-.240131,.526766,.323196,.425564,-.248566,.52905,.357071,.457094,-.256195,.530796,.393262,.488286,-.262331,.528703,.430797,.522291,-.267141,.52727,.470231,.554172,-.270411,.519848,.510477,.586427,-.271986,.510307,.551594,.619638,-.27192,.499158,.593849,.650656,-.269817,.483852,.636314,.68284,-.266267,.467515,.679679,.714356,-.26113,.44931,.723884,.742717,-.254067,.425789,.767245,.770894,-.245652,.401144,.811819,.797358,-.235554,.374224,.856315,.823377,-.223896,.346167,.901077,.847456,-.210865,.316056,.946502,.870697,-.196574,.284503,.993711,.891068,-.180814,.251628,1.04134,.909267,-.163314,.219065,1.08609,.925653,-.143304,.186446,1.12702,.940017,-.121322,.153416,1.16371,.952398,-.0973872,.120334,1.19712,.967568,-.0698785,.08352,1.22791,.984772,-.0390031,.0439209,1.25672,1.00026,-.0070087,.00315668,1.28428,.0556653,-459654e-11,.227325,112556e-11,.0565238,-116382e-9,.230826,284985e-10,.0565717,-465666e-9,.231026,114036e-9,.0565859,-.00104773,.231079,256656e-9,.0565761,-.00186255,.231025,45663e-8,.0565913,-.00291002,.231058,714664e-9,.0566108,-.00418998,.231085,.00103224,.0566532,-.00570206,.231169,.00141202,.0567473,-.00743666,.231417,.00186018,.0568567,-.00940298,.231661,.00238264,.0569859,-.0115991,.231895,.00298699,.0572221,-.0140096,.232456,.00368957,.057519,-.0166508,.233096,.00450303,.0579534,-.01951,.234094,.00544945,.0585922,-.0225991,.235629,.00655564,.0595647,-.0259416,.238106,.00785724,.0609109,-.0295661,.241557,.00939127,.0628751,-.0335126,.246652,.0112198,.0656908,-.0378604,.254091,.0134168,.0691347,-.0426543,.262666,.0160374,.0732165,-.0478967,.272029,.0191514,.0782863,-.0536716,.283007,.0228597,.0843973,-.0600683,.295732,.0272829,.0913598,-.0670095,.308779,.032484,.0994407,-.0745516,.322886,.0385886,.108189,-.082712,.336408,.0457133,.118574,-.0914927,.351692,.0539832,.129989,-.100854,.366502,.0635162,.142722,-.110837,.381675,.0744386,.156654,-.121353,.3963,.0868483,.172151,-.132414,.411477,.100963,.188712,-.143809,.42508,.116795,.208093,-.155765,.441328,.134715,.227936,-.167608,.454328,.154396,.249495,-.179579,.467235,.176179,.27362,-.191488,.480248,.200193,.296371,-.202618,.487886,.225775,.324234,-.214133,.499632,.25441,.353049,-.225212,.509532,.285077,.381785,-.234875,.514265,.317047,.414038,-.244205,.521282,.351874,.445251,-.252145,.522931,.388279,.476819,-.258433,.520947,.425825,.509209,-.263411,.517669,.465104,.542759,-.266732,.512841,.505741,.574822,-.268263,.503317,.547611,.609324,-.268489,.493035,.590953,.641772,-.266941,.478816,.63488,.674049,-.263297,.462863,.679072,.705071,-.257618,.442931,.723487,.734709,-.250625,.421299,.768708,.763704,-.24179,.397085,.814375,.791818,-.231115,.370577,.859907,.817439,-.21922,.34232,.906715,.843202,-.205658,.312627,.953943,.866639,-.190563,.280933,1.00185,.888129,-.173978,.248393,1.05105,.907239,-.155485,.216007,1.09704,.923893,-.134782,.183233,1.13857,.938882,-.11249,.150376,1.17539,.952464,-.0890706,.117177,1.20924,.968529,-.0646523,.0813095,1.24055,.984763,-.038606,.0439378,1.27018,1.00053,-.01238,.00598668,1.29873,.0437928,-409594e-11,.204012,8.79224e-7,.0440166,-103395e-9,.205049,221946e-10,.0440529,-413633e-9,.205225,887981e-10,.0440493,-930594e-9,.2052,199858e-9,.0439884,-.00165352,.204901,355495e-9,.0440716,-.0025849,.205255,556983e-9,.0440968,-.00372222,.205311,805326e-9,.0441359,-.00506478,.205391,.00110333,.0442231,-.00660384,.205638,.00145768,.0443254,-.00835246,.205877,.00187275,.0444832,-.0102992,.20627,.00235938,.0447001,-.0124449,.206796,.0029299,.0450168,-.0147935,.207593,.0036005,.0454816,-.017336,.208819,.00439246,.0462446,-.0201156,.211036,.00533864,.0473694,-.0231568,.214388,.00646984,.0490191,-.0264941,.219357,.00783856,.0512776,-.030184,.226061,.00950182,.0541279,-.0342661,.234094,.0115156,.0578989,-.0388539,.244297,.0139687,.0620835,-.0438735,.254457,.0169015,.0673497,-.04951,.266706,.0204554,.0731759,-.0556263,.278753,.0246606,.0803937,-.0624585,.29309,.0297126,.0879287,-.0697556,.305856,.0355868,.0970669,-.0778795,.321059,.0425768,.106508,-.0863541,.333873,.05056,.11776,-.0955935,.349008,.0598972,.130081,-.105438,.363776,.0706314,.144454,-.115899,.380112,.0828822,.1596,-.126827,.394843,.0967611,.176097,-.138161,.409033,.112381,.194726,-.149904,.424257,.129952,.213944,-.161675,.436945,.149333,.235516,-.173659,.450176,.170892,.260564,-.185963,.466305,.194984,.285183,-.197582,.477328,.220805,.311095,-.208697,.486566,.248694,.338924,-.219519,.494811,.279015,.369757,-.229766,.504065,.311725,.3996,-.238879,.507909,.345844,.430484,-.246802,.509805,.381749,.46413,-.253924,.511436,.420251,.497077,-.259319,.508787,.459957,.530434,-.263297,.50394,.501356,.565725,-.265619,.49804,.544252,.599254,-.265842,.487346,.587856,.631251,-.263978,.472975,.631969,.663972,-.26043,.457135,.677471,.697724,-.255358,.439844,.723744,.727725,-.248308,.417872,.770653,.756417,-.239181,.39273,.817357,.785419,-.22814,.367839,.864221,.81266,-.215681,.339449,.912701,.839391,-.201623,.309279,.962419,.86366,-.185624,.278029,1.0122,.885028,-.16797,.245294,1.06186,.904639,-.148336,.212689,1.10934,.922048,-.12637,.179616,1.15063,.936952,-.102928,.146749,1.18885,.951895,-.0785268,.112733,1.22352,.967198,-.0530153,.0760056,1.25681,.984405,-.02649,.0383183,1.28762,1.00021,70019e-8,-20039e-8,1.31656,.0325964,-355447e-11,.176706,6.55682e-7,.0329333,-899174e-10,.178527,165869e-10,.0329181,-359637e-9,.178453,663498e-10,.0329085,-808991e-9,.178383,149332e-9,.0329181,-.00143826,.178394,265873e-9,.0329425,-.00224678,.178517,416597e-9,.0329511,-.00323575,.17849,603299e-9,.033011,-.00439875,.178695,829422e-9,.0330733,-.00574059,.178843,.00109908,.0331857,-.00725896,.179176,.00141933,.0333445,-.00895289,.179618,.0017999,.0335674,-.0108219,.180238,.00225316,.033939,-.0128687,.181417,.00279765,.0345239,-.015114,.183395,.0034564,.0354458,-.017596,.186616,.00425864,.0368313,-.0203524,.191547,.00524936,.0386115,-.0234105,.197508,.00647033,.0410303,-.0268509,.205395,.00798121,.0442245,-.0307481,.215365,.0098557,.0478659,-.0350863,.225595,.0121417,.0522416,-.0399506,.236946,.0149385,.0574513,-.045357,.249442,.0183189,.0631208,-.0512863,.261222,.0223644,.0701124,-.0579273,.275418,.0272418,.0777331,-.0650652,.288989,.0329458,.0862709,-.0728813,.302546,.0396819,.096103,-.081363,.317164,.04757,.106976,-.0904463,.331733,.0567012,.119175,-.100105,.34661,.067202,.132919,-.110375,.362249,.0792588,.147727,-.121115,.376978,.0928672,.163618,-.132299,.390681,.108228,.182234,-.143887,.406571,.125502,.201809,-.155827,.42042,.144836,.225041,-.168357,.438411,.166706,.247621,-.18004,.450368,.189909,.27097,-.191536,.460083,.215251,.296658,-.203024,.469765,.243164,.325892,-.214056,.481837,.273388,.35406,-.224104,.487474,.305344,.384372,-.233489,.492773,.339741,.41749,-.241874,.498451,.376287,.45013,-.248834,.499632,.414195,.481285,-.254658,.495233,.454077,.519183,-.259367,.496401,.496352,.551544,-.261818,.487686,.538798,.587349,-.262964,.479453,.583626,.621679,-.262128,.467709,.629451,.654991,-.258998,.452123,.67566,.686873,-.254119,.433495,.723248,.719801,-.246946,.413657,.771156,.750355,-.237709,.390366,.81989,.780033,-.226549,.364947,.868601,.809254,-.214186,.337256,.920034,.836576,-.199639,.307395,.971706,.861774,-.183169,.275431,1.02479,.885707,-.165111,.243431,1.07837,.904742,-.144363,.210921,1.12783,.915604,-.121305,.17647,1.17254,.930959,-.0962119,.143106,1.21012,.948404,-.069969,.108112,1.24474,.967012,-.0427586,.0708478,1.27718,.984183,-.0147043,.032335,1.3083,.999577,.0142165,-.00726867,1.3382,.0229227,-299799e-11,.148623,4.62391e-7,.0232194,-758796e-10,.15054,117033e-10,.0232315,-303636e-9,.15063,468397e-10,.0232354,-683189e-9,.150624,105472e-9,.0232092,-.0012136,.150445,187744e-9,.0232523,-.00189765,.150679,294847e-9,.0232828,-.00273247,.150789,428013e-9,.0233371,-.00371287,.150995,591134e-9,.0234015,-.00484794,.15118,787642e-9,.023514,-.00612877,.151562,.00102547,.023679,-.00756125,.152116,.00131351,.0239559,-.00914651,.153162,.00166594,.0244334,-.010904,.155133,.00210182,.025139,-.0128615,.158035,.00264406,.0262598,-.0150628,.162751,.00332923,.0277875,-.0175532,.168944,.00419773,.0298472,-.0203981,.176835,.00530034,.0325444,-.023655,.186686,.00669777,.0355581,-.0272982,.196248,.00842661,.0392841,-.0314457,.207352,.0105854,.0436815,-.0361157,.219279,.0132458,.0485272,-.0412932,.230728,.0164736,.0541574,-.0470337,.242994,.0203715,.0609479,-.0535002,.257042,.0250953,.0685228,-.0605409,.27102,.0306856,.0768042,-.0680553,.28406,.037193,.0864844,-.0765011,.299186,.0449795,.0969415,-.0852674,.3132,.0538316,.108478,-.0947333,.327138,.0641149,.121705,-.10481,.342345,.0759185,.136743,-.115474,.358472,.0894116,.152986,-.126536,.374067,.104562,.170397,-.138061,.388267,.121632,.191392,-.150203,.406467,.140996,.211566,-.161751,.418641,.161696,.233567,-.173407,.430418,.184557,.257769,-.185397,.44277,.210092,.28531,-.197048,.457191,.237827,.311726,-.20784,.464712,.267253,.340537,-.218345,.472539,.299332,.372921,-.228306,.482331,.333988,.402924,-.236665,.484378,.369722,.434475,-.244097,.484717,.407836,.469736,-.250547,.487093,.448465,.505045,-.25511,.485575,.490263,.540262,-.258444,.481225,.534495,.576347,-.259903,.473481,.579451,.608656,-.259572,.4603,.625604,.646679,-.257908,.450341,.674511,.679902,-.253663,.431561,.723269,.714159,-.247419,.412684,.773263,.745345,-.239122,.389388,.824182,.778248,-.228837,.365361,.876634,.807208,-.216197,.337667,.92945,.835019,-.201772,.307197,.985261,.860261,-.185291,.274205,1.04299,.877601,-.165809,.240178,1.09816,.898211,-.143897,.207571,1.14694,.915789,-.119513,.174904,1.19008,.931831,-.0932919,.141423,1.2297,.949244,-.0656528,.105603,1.26553,.967527,-.0370262,.0679551,1.29986,.984139,-.00730117,.0283133,1.33252,.999713,.0234648,-.0121785,1.36397,.0152135,-245447e-11,.122795,3.04092e-7,.0151652,-615778e-10,.122399,76292e-10,.0151181,-245948e-9,.122023,304802e-10,.0151203,-553394e-9,.12203,686634e-10,.015125,-983841e-9,.122037,122463e-9,.0151427,-.00153774,.12214,192706e-9,.0151708,-.0022103,.122237,281219e-9,.0152115,-.00300741,.12238,390804e-9,.0152877,-.00392494,.1227,526317e-9,.015412,-.00496597,.123244,69443e-8,.0156201,-.00613314,.124228,90547e-8,.0159658,-.00744113,.125945,.0011732,.0165674,-.00892546,.129098,.00151888,.017487,-.010627,.133865,.00197007,.018839,-.0126043,.140682,.0025637,.020554,-.0148814,.148534,.00333637,.0226727,-.0175123,.157381,.00433738,.0251879,-.0205266,.166685,.00561664,.0283635,-.0240319,.177796,.00725563,.0318694,-.0279432,.188251,.00928811,.0361044,-.0324313,.200038,.011835,.0406656,-.0373527,.210685,.0149146,.0463846,-.0430132,.224182,.0187254,.0525696,-.0491013,.23634,.0232283,.0598083,-.0559175,.250013,.0286521,.0679437,-.0633657,.263981,.0350634,.0771181,-.0714602,.278072,.0425882,.0881273,-.0803502,.29511,.0514487,.0996628,-.0896903,.309976,.0615766,.112702,-.099644,.325611,.0732139,.126488,-.109829,.339321,.0862324,.142625,-.120859,.35574,.101275,.15953,-.131956,.369845,.117892,.176991,-.143145,.38146,.136205,.199715,-.155292,.40052,.157252,.220787,-.167066,.412055,.179966,.243697,-.178396,.423133,.204418,.272106,-.190433,.439524,.232141,.297637,-.201265,.447041,.261109,.325273,-.211834,.454488,.292627,.357219,-.221889,.465004,.326669,.387362,-.230729,.468527,.362426,.423131,-.23924,.475836,.401533,.45543,-.246067,.475017,.441902,.493393,-.251557,.478017,.484239,.526253,-.255571,.4709,.528586,.560554,-.257752,.463167,.574346,.599306,-.258076,.456452,.621655,.634541,-.256471,.443725,.670492,.668907,-.253283,.428719,.721943,.705619,-.247562,.411348,.772477,.739034,-.240626,.388939,.8264,.771408,-.231493,.36425,.881702,.803312,-.220125,.337321,.9385,.828457,-.206645,.305364,.997437,.854819,-.190664,.273715,1.05693,.878666,-.171429,.242218,1.11251,.898404,-.149235,.209556,1.16398,.917416,-.12435,.176863,1.21014,.933133,-.0972703,.142775,1.25178,.95066,-.0683607,.106735,1.29028,.968589,-.0378724,.0681609,1.32703,.984776,-.00605712,.0273966,1.36158,.99994,.0263276,-.0138124,1.3943,.00867437,-186005e-11,.0928979,1.73682e-7,.00864003,-466389e-10,.0925237,435505e-11,.00864593,-186594e-9,.0925806,174322e-10,.00864095,-419639e-9,.0924903,392862e-10,.00863851,-746272e-9,.0924589,702598e-10,.00868531,-.00116456,.0929,111188e-9,.00869667,-.00167711,.0928529,163867e-9,.00874332,-.00228051,.0930914,23104e-8,.00882709,-.00297864,.0935679,31741e-8,.00898874,-.00377557,.0946165,430186e-9,.00929346,-.00469247,.0967406,580383e-9,.00978271,-.00575491,.100084,783529e-9,.0105746,-.00701514,.105447,.00106304,.0116949,-.00851797,.112494,.00144685,.0130419,-.0102757,.119876,.00196439,.0148375,-.012381,.129034,.00266433,.0168725,-.01482,.137812,.00358364,.0193689,-.0176563,.147696,.00478132,.0222691,-.0209211,.157795,.00631721,.0256891,-.0246655,.168431,.00826346,.0294686,-.0288597,.178587,.0106714,.0340412,-.0336441,.190251,.0136629,.0393918,-.039033,.202999,.0173272,.0453947,-.0450087,.215655,.0217448,.0521936,-.0515461,.228686,.0269941,.0600279,-.058817,.242838,.033272,.0692398,-.0667228,.258145,.0406457,.0793832,-.0752401,.273565,.0492239,.0902297,-.0841851,.287735,.0590105,.102014,-.0936479,.301161,.0702021,.116054,-.103967,.317438,.0832001,.13191,-.114622,.334166,.0977951,.148239,-.125452,.348192,.113985,.165809,-.136453,.361094,.131928,.184616,-.147648,.373534,.151811,.207491,-.159607,.39101,.174476,.230106,-.171119,.402504,.198798,.257036,-.182906,.418032,.225796,.281172,-.193605,.425468,.254027,.312034,-.204771,.440379,.285713,.340402,-.214988,.445406,.319196,.370231,-.224711,.44968,.35537,.407105,-.233516,.460747,.393838,.439037,-.240801,.460624,.433747,.47781,-.24762,.465957,.477234,.510655,-.251823,.460054,.52044,.550584,-.255552,.459172,.567853,.585872,-.257036,.450311,.615943,.620466,-.257535,.437763,.667693,.660496,-.255248,.426639,.718988,.695578,-.251141,.409185,.772503,.732176,-.244718,.39015,.827023,.760782,-.236782,.362594,.885651,.79422,-.225923,.33711,.943756,.824521,-.213855,.308272,1.00874,.854964,-.197723,.278529,1.06764,.878065,-.179209,.246208,1.12836,.899834,-.157569,.21329,1.18318,.918815,-.133206,.181038,1.23161,.934934,-.106545,.146993,1.27644,.952115,-.0780574,.111175,1.31842,.96906,-.0478279,.0728553,1.35839,.985178,-.0160014,.032579,1.39697,1.00039,.0173126,-.0095256,1.43312,.00384146,-124311e-11,.0613583,7.78271e-8,.00390023,-314043e-10,.0622919,196626e-11,.00389971,-125622e-9,.0622632,787379e-11,.00389491,-282352e-9,.0620659,1778e-8,.00391618,-502512e-9,.0624687,320918e-10,.00392662,-784458e-9,.0625113,515573e-10,.00396053,-.00112907,.0628175,778668e-10,.00401911,-.00153821,.0633286,113811e-9,.00414994,-.0020208,.0646443,16445e-8,.00441223,-.00260007,.0673886,237734e-9,.00484427,-.0033097,.0716528,345929e-9,.00549109,-.00418966,.0774998,505987e-9,.00636293,-.00527331,.0844758,739208e-9,.00746566,-.00660428,.0921325,.00107347,.00876625,-.00818826,.0997067,.00153691,.0103125,-.0100811,.107433,.00217153,.0123309,-.0123643,.117088,.00303427,.0146274,-.0150007,.126438,.00416018,.0172295,-.0180531,.135672,.00561513,.0204248,-.0215962,.146244,.007478,.0241597,-.0256234,.157481,.00981046,.0284693,-.0302209,.169125,.0127148,.033445,-.0353333,.181659,.0162453,.0391251,-.0410845,.1944,.0205417,.0454721,-.0473451,.207082,.0256333,.0530983,-.0542858,.221656,.0317036,.0615356,-.0618384,.236036,.0388319,.0703363,-.0697631,.248398,.046974,.0810391,-.0784757,.263611,.0565246,.0920144,-.0873488,.275857,.0671724,.105584,-.0973652,.292555,.0798105,.119506,-.107271,.306333,.0935945,.134434,-.117608,.318888,.109106,.153399,-.128938,.337552,.127074,.171258,-.139944,.349955,.14643,.191059,-.151288,.361545,.168,.215069,-.163018,.378421,.192082,.237838,-.174226,.38879,.217838,.266965,-.186063,.405857,.246931,.292827,-.196909,.414146,.277505,.324352,-.207473,.426955,.310711,.354427,-.217713,.433429,.346794,.389854,-.227183,.443966,.385237,.420749,-.235131,.44471,.424955,.459597,-.242786,.451729,.468446,.495316,-.248767,.45072,.513422,.534903,-.253351,.450924,.560618,.572369,-.256277,.445266,.609677,.612383,-.2576,.438798,.660995,.644037,-.256931,.421693,.713807,.686749,-.254036,.4109,.767616,.719814,-.249785,.390151,.82533,.754719,-.244283,.367847,.888311,.792022,-.235076,.345013,.948177,.822404,-.225061,.316193,1.01661,.853084,-.211113,.287013,1.08075,.879871,-.19449,.255424,1.14501,.901655,-.174023,.222879,1.20203,.919957,-.1509,.18989,1.25698,.938412,-.124923,.15606,1.30588,.953471,-.0968139,.120512,1.3529,.970451,-.066734,.0828515,1.3986,.985522,-.034734,.0424458,1.44148,1.00099,-.00102222,678929e-9,1.48398,965494e-9,-6.27338e-7,.0306409,1.97672e-8,99168e-8,-158573e-10,.0314638,4.99803e-7,991068e-9,-634012e-10,.031363,200682e-11,974567e-9,-14144e-8,.03036,457312e-11,998079e-9,-252812e-9,.031496,860131e-11,.00102243,-396506e-9,.0319955,148288e-10,.00107877,-577593e-9,.0331376,249141e-10,.00121622,-816816e-9,.0359396,423011e-10,.0014455,-.00113761,.0399652,724613e-10,.00178791,-.00156959,.0450556,123929e-9,.00225668,-.00214064,.0508025,208531e-9,.00285627,-.00287655,.0568443,341969e-9,.0035991,-.00380271,.0630892,544158e-9,.00455524,-.00496264,.0702204,842423e-9,.00569143,-.0063793,.0773426,.00126704,.00716928,-.00813531,.0860839,.00186642,.00885307,-.0101946,.0944079,.00267014,.0109316,-.0126386,.103951,.00374033,.0133704,-.0154876,.113786,.0051304,.0161525,-.0187317,.123477,.00688858,.0194267,-.0224652,.133986,.00910557,.0230967,-.0265976,.143979,.0118074,.0273627,-.0312848,.154645,.0151266,.0323898,-.0365949,.166765,.0191791,.0379225,-.0422914,.177932,.0239236,.0447501,-.0487469,.19167,.0296568,.0519391,-.0556398,.203224,.0362924,.0599464,-.0631646,.215652,.0440585,.0702427,-.0714308,.232089,.0531619,.0806902,-.0800605,.245258,.0634564,.0923194,-.0892815,.258609,.0752481,.106938,-.09931,.276654,.0888914,.121238,-.109575,.289847,.104055,.138817,-.120461,.307566,.121266,.15595,-.131209,.320117,.139944,.178418,-.143049,.339677,.161591,.197875,-.154074,.349886,.184303,.224368,-.166307,.369352,.210669,.252213,-.178051,.386242,.238895,.277321,-.189335,.395294,.269182,.310332,-.200683,.412148,.302508,.338809,-.210856,.418266,.337264,.372678,-.220655,.428723,.374881,.405632,-.230053,.433887,.415656,.442293,-.237993,.439911,.457982,.477256,-.244897,.440175,.502831,.515592,-.250657,.441079,.550277,.550969,-.255459,.435219,.601102,.592883,-.257696,.432882,.651785,.629092,-.259894,.421054,.708961,.672033,-.258592,.41177,.763806,.709147,-.256525,.395267,.824249,.745367,-.254677,.375013,.8951,.784715,-.247892,.353906,.959317,.818107,-.240162,.327801,1.03153,.847895,-.229741,.298821,1.10601,.879603,-.213084,.269115,1.164,.902605,-.195242,.236606,1.22854,.922788,-.174505,.203442,1.29017,.944831,-.150169,.169594,1.34157,.959656,-.124099,.135909,1.3956,.972399,-.0960626,.0990563,1.45128,.986549,-.0657097,.0602348,1.50312,1.00013,-.0333558,.0186694,1.55364,619747e-11,-1e-7,.00778326,796756e-16,2.37499e-8,-9.99999e-8,282592e-10,1.14596e-10,100292e-11,-166369e-11,250354e-9,6.77492e-9,350752e-11,-637769e-11,357289e-9,6.31655e-8,826445e-11,-174689e-10,516179e-9,3.1851e-7,242481e-10,-450868e-10,.0010223,130577e-11,455631e-10,-89044e-9,.00144302,374587e-11,971222e-10,-178311e-9,.00241912,102584e-10,171403e-9,-313976e-9,.00354938,236481e-10,292747e-9,-520026e-9,.00513765,496014e-10,789827e-9,-.00118187,.0238621,139056e-9,.00114093,-.00171827,.0286691,244093e-9,.00176119,-.00249667,.0368565,420623e-9,.0022233,-.00333742,.0400469,65673e-8,.00343382,-.00481976,.0535751,.00109323,.00427602,-.00600755,.057099,.00155268,.00461435,-.00737637,.0551084,.00215031,.00695698,-.00971401,.0715767,.00316529,.00867619,-.0120943,.0793314,.00436995,.0106694,-.0148202,.0869391,.0058959,.0140351,-.0183501,.101572,.00798757,.0168939,-.022006,.11018,.0104233,.020197,-.0261568,.119041,.0134167,.0254702,-.0312778,.135404,.0173009,.0298384,-.0362469,.1437,.0215428,.035159,-.042237,.15512,.0268882,.0427685,-.0488711,.17128,.033235,.0494848,-.0557997,.181813,.0404443,.0592394,-.0635578,.198745,.0490043,.0681463,-.071838,.210497,.0588239,.0804753,-.0809297,.228864,.0702835,.0942205,-.0906488,.247008,.0834012,.106777,-.100216,.258812,.0975952,.124471,-.110827,.278617,.114162,.138389,-.121193,.287049,.131983,.159543,-.13253,.307151,.152541,.176432,-.143611,.31564,.174673,.201723,-.15548,.33538,.199842,.229721,-.167166,.355256,.227097,.250206,-.178238,.360047,.256014,.282118,-.189905,.378761,.28855,.312821,-.201033,.39181,.323348,.341482,-.211584,.397716,.360564,.377368,-.221314,.410141,.400004,.418229,-.230474,.423485,.442371,.444881,-.239443,.418874,.488796,.488899,-.245987,.427545,.535012,.520317,-.253948,.422147,.589678,.568566,-.256616,.42719,.637683,.599607,-.26376,.415114,.703363,.64222,-.268687,.408715,.771363,.685698,-.2694,.399722,.83574,.732327,-.266642,.388651,.897764,.769873,-.267712,.369198,.983312,.806733,-.263479,.346802,1.06222,.843466,-.254575,.321368,1.13477,.873008,-.242749,.29211,1.20712,.908438,-.22725,.262143,1.27465,.936321,-.207621,.228876,1.33203,.950353,-.187932,.19484,1.40439,.96442,-.165154,.163178,1.4732,.979856,-.139302,.127531,1.53574,.982561,-.11134,.0903457,1.59982,.996389,-.0808124,.0489007,1.6577],e=[1,0,0,0,1,791421e-36,0,0,1,104392e-29,0,0,1,349405e-26,0,0,1,109923e-23,0,0,1,947414e-22,0,0,1,359627e-20,0,0,1,772053e-19,0,0,1,108799e-17,0,0,1,110655e-16,0,0,1,865818e-16,0,0,.999998,5.45037e-10,0,0,.999994,2.85095e-9,0,0,.999989,1.26931e-8,0,0,.999973,4.89938e-8,0,0,.999947,1.66347e-7,0,0,.999894,5.02694e-7,0,0,.999798,136532e-11,0,0,.999617,335898e-11,0,0,.999234,752126e-11,0,0,.998258,152586e-10,0,0,.99504,266207e-10,0,0,.980816,236802e-10,0,0,.967553,207684e-11,0,0,.966877,403733e-11,0,0,.965752,741174e-11,0,0,.96382,127746e-10,0,0,.960306,202792e-10,0,0,.953619,280232e-10,0,0,.941103,278816e-10,0,0,.926619,160221e-10,0,0,.920983,235164e-10,0,0,.912293,311924e-10,0,.0158731,.899277,348118e-10,0,.0476191,.880884,26041e-9,0,.0793651,.870399,338726e-10,0,.111111,.856138,392906e-10,0,.142857,.837436,372874e-10,0,.174603,.820973,392558e-10,0,.206349,.803583,434658e-10,0,.238095,.782168,40256e-9,0,.269841,.764107,448159e-10,0,.301587,.743092,457627e-10,0,.333333,.721626,455314e-10,0,.365079,.700375,477335e-10,0,.396825,.677334,461072e-10,0,.428571,.655702,484393e-10,0,.460317,.632059,464583e-10,0,.492064,.610125,483923e-10,0,.52381,.58653,464342e-10,0,.555556,.564508,477033e-10,0,.587302,.541405,459263e-10,0,.619048,.519556,46412e-9,0,.650794,.497292,448913e-10,0,.68254,.475898,445789e-10,0,.714286,.454722,433496e-10,0,.746032,.434042,423054e-10,0,.777778,.414126,413737e-10,0,.809524,.394387,397265e-10,0,.84127,.375841,390709e-10,0,.873016,.357219,369938e-10,0,.904762,.340084,365618e-10,0,.936508,.322714,342533e-10,0,.968254,.306974,339596e-10,0,1,1,101524e-23,0,0,1,10292e-22,0,0,1,130908e-23,0,0,1,473331e-23,0,0,1,625319e-22,0,0,1,107932e-20,0,0,1,163779e-19,0,0,1,203198e-18,0,0,1,204717e-17,0,0,.999999,168995e-16,0,0,.999998,1.15855e-10,0,0,.999996,6.6947e-10,0,0,.999991,3.30863e-9,0,0,.999983,1.41737e-8,0,0,.999968,5.32626e-8,0,0,.99994,1.77431e-7,0,0,.999891,5.28835e-7,0,0,.999797,142169e-11,0,0,.999617,347057e-11,0,0,.999227,77231e-10,0,0,.998239,155753e-10,0,0,.994937,268495e-10,0,0,.980225,213742e-10,0,0,.967549,21631e-10,0,0,.966865,417989e-11,0,0,.965739,763341e-11,0,0,.963794,130892e-10,0,0,.960244,206456e-10,0,0,.953495,282016e-10,0,148105e-9,.940876,271581e-10,0,.002454,.926569,164159e-10,0,.00867491,.920905,239521e-10,0,.01956,.912169,315127e-10,0,.035433,.899095,346626e-10,0,.056294,.882209,290223e-10,0,.0818191,.870272,342992e-10,0,.111259,.855977,394164e-10,0,.142857,.837431,372343e-10,0,.174603,.820826,396691e-10,0,.206349,.803408,435395e-10,0,.238095,.782838,419579e-10,0,.269841,.763941,450953e-10,0,.301587,.742904,455847e-10,0,.333333,.721463,458833e-10,0,.365079,.700197,477159e-10,0,.396825,.677501,470641e-10,0,.428571,.655527,484732e-10,0,.460317,.6324,476834e-10,0,.492064,.609964,484213e-10,0,.52381,.586839,475541e-10,0,.555556,.564353,476951e-10,0,.587302,.541589,467611e-10,0,.619048,.519413,463493e-10,0,.650794,.497337,453994e-10,0,.68254,.475797,445308e-10,0,.714286,.454659,435787e-10,0,.746032,.434065,424839e-10,0,.777778,.414018,41436e-9,0,.809524,.39455,401902e-10,0,.84127,.375742,390813e-10,0,.873016,.357501,377116e-10,0,.904762,.339996,36535e-9,0,.936508,.323069,351265e-10,0,.968254,.306897,339112e-10,0,1,1,10396e-19,0,0,1,104326e-20,0,0,1,110153e-20,0,0,1,144668e-20,0,0,1,34528e-19,0,0,1,175958e-19,0,0,1,12627e-17,0,0,1,936074e-18,0,0,1,645742e-17,0,0,.999998,401228e-16,0,0,.999997,2.22338e-10,0,0,.999995,1.0967e-9,0,0,.999991,4.82132e-9,0,0,.999981,1.89434e-8,0,0,.999967,6.67716e-8,0,0,.999938,2.12066e-7,0,0,.999886,6.0977e-7,0,0,.999792,159504e-11,0,0,.999608,381191e-11,0,0,.999209,833727e-11,0,0,.998179,165288e-10,0,0,.994605,274387e-10,0,0,.979468,167316e-10,0,0,.967529,242877e-11,0,0,.966836,461696e-11,0,0,.96569,830977e-11,0,0,.963706,140427e-10,0,244659e-11,.960063,217353e-10,0,760774e-9,.953113,286606e-10,0,.00367261,.940192,247691e-10,0,.00940263,.927731,195814e-10,0,.018333,.920669,252531e-10,0,.0306825,.911799,324277e-10,0,.0465556,.89857,340982e-10,0,.0659521,.883283,319622e-10,0,.0887677,.86989,35548e-9,0,.114784,.855483,397143e-10,0,.143618,.837987,391665e-10,0,.174606,.820546,411306e-10,0,.206349,.802878,436753e-10,0,.238095,.783402,444e-7,0,.269841,.763439,458726e-10,0,.301587,.742925,467097e-10,0,.333333,.721633,478887e-10,0,.365079,.69985,481251e-10,0,.396825,.67783,491811e-10,0,.428571,.655126,488199e-10,0,.460318,.632697,496025e-10,0,.492064,.609613,48829e-9,0,.52381,.587098,492754e-10,0,.555556,.564119,482625e-10,0,.587302,.541813,482807e-10,0,.619048,.519342,471552e-10,0,.650794,.497514,466765e-10,0,.68254,.475879,455582e-10,0,.714286,.454789,446007e-10,0,.746032,.434217,435382e-10,0,.777778,.414086,421753e-10,0,.809524,.394744,412093e-10,0,.84127,.375782,396634e-10,0,.873016,.357707,386419e-10,0,.904762,.340038,370345e-10,0,.936508,.323284,359725e-10,0,.968254,.306954,3436e-8,0,1,1,599567e-19,0,0,1,600497e-19,0,0,1,614839e-19,0,0,1,686641e-19,0,0,1,972658e-19,0,0,1,221271e-18,0,0,1,833195e-18,0,0,1,403601e-17,0,0,.999999,206001e-16,0,0,.999998,1.01739e-10,0,0,.999997,4.70132e-10,0,0,.999993,2.00436e-9,0,0,.999988,7.83682e-9,0,0,.999979,2.80338e-8,0,0,.999962,9.17033e-8,0,0,.999933,2.74514e-7,0,0,.999881,7.53201e-7,0,0,.999783,189826e-11,0,0,.999594,440279e-11,0,0,.999178,93898e-10,0,0,.998073,181265e-10,0,0,.993993,280487e-10,0,0,.979982,149422e-10,0,0,.968145,378481e-11,0,0,.966786,53771e-10,0,0,.965611,947508e-11,0,388934e-10,.963557,156616e-10,0,9693e-7,.959752,235144e-10,0,.00370329,.952461,291568e-10,0,.00868428,.940193,240102e-10,0,.0161889,.929042,231235e-10,0,.0263948,.920266,273968e-10,0,.0394088,.911178,337915e-10,0,.0552818,.897873,333629e-10,0,.0740138,.884053,351405e-10,0,.0955539,.869455,378034e-10,0,.119795,.854655,399378e-10,0,.14656,.838347,419108e-10,0,.175573,.820693,440831e-10,0,.206388,.802277,445599e-10,0,.238095,.783634,472691e-10,0,.269841,.763159,476984e-10,0,.301587,.742914,491487e-10,0,.333333,.721662,502312e-10,0,.365079,.699668,502817e-10,0,.396825,.677839,51406e-9,0,.428571,.655091,511095e-10,0,.460317,.632665,516067e-10,0,.492064,.609734,512255e-10,0,.52381,.587043,510263e-10,0,.555556,.564298,50565e-9,0,.587302,.541769,497951e-10,0,.619048,.519529,492698e-10,0,.650794,.497574,482066e-10,0,.68254,.476028,473689e-10,0,.714286,.454961,461941e-10,0,.746032,.434341,450618e-10,0,.777778,.414364,438355e-10,0,.809524,.394832,424196e-10,0,.84127,.376109,412563e-10,0,.873016,.35779,396226e-10,0,.904762,.340379,384886e-10,0,.936508,.323385,368214e-10,0,.968254,.307295,356636e-10,0,1,1,106465e-17,0,0,1,106555e-17,0,0,1,107966e-17,0,0,1,114601e-17,0,0,1,137123e-17,0,0,1,21243e-16,0,0,.999999,489653e-17,0,0,.999999,160283e-16,0,0,.999998,62269e-15,0,0,.999997,2.51859e-10,0,0,.999996,9.96192e-10,0,0,.999992,3.74531e-9,0,0,.999986,1.32022e-8,0,0,.999975,4.33315e-8,0,0,.999959,1.31956e-7,0,0,.999927,3.72249e-7,0,0,.999871,9.72461e-7,0,0,.999771,235343e-11,0,0,.999572,52768e-10,0,0,.999133,109237e-10,0,0,.997912,203675e-10,0,0,.993008,279396e-10,0,0,.980645,139604e-10,0,0,.970057,646596e-11,0,0,.966717,65089e-10,0,474145e-10,.965497,111863e-10,0,89544e-8,.96334,179857e-10,0,.0032647,.959294,259045e-10,0,.0075144,.951519,292327e-10,0,.0138734,.940517,249769e-10,0,.0224952,.93014,26803e-9,0,.0334828,.91972,303656e-10,0,.0468973,.910294,353323e-10,0,.0627703,.897701,351002e-10,0,.0811019,.884522,388104e-10,0,.10186,.869489,412932e-10,0,.124985,.853983,415781e-10,0,.150372,.838425,454066e-10,0,.177868,.820656,471624e-10,0,.207245,.801875,475243e-10,0,.238143,.783521,505621e-10,0,.269841,.763131,50721e-9,0,.301587,.74261,523293e-10,0,.333333,.72148,528699e-10,0,.365079,.699696,538677e-10,0,.396825,.677592,539255e-10,0,.428571,.65525,546367e-10,0,.460317,.632452,541348e-10,0,.492064,.609903,544976e-10,0,.52381,.586928,536201e-10,0,.555556,.564464,535185e-10,0,.587302,.541801,524949e-10,0,.619048,.519681,51812e-9,0,.650794,.497685,507687e-10,0,.68254,.47622,496243e-10,0,.714286,.455135,485714e-10,0,.746032,.4346,471847e-10,0,.777778,.414564,459294e-10,0,.809524,.395165,444705e-10,0,.84127,.376333,430772e-10,0,.873016,.358197,416229e-10,0,.904762,.34064,401019e-10,0,.936508,.323816,386623e-10,0,.968254,.307581,370933e-10,0,1,1,991541e-17,0,0,1,992077e-17,0,0,1,100041e-16,0,0,1,10385e-15,0,0,1,115777e-16,0,0,1,150215e-16,0,0,.999999,254738e-16,0,0,.999999,598822e-16,0,0,.999998,1.79597e-10,0,0,.999997,6.02367e-10,0,0,.999994,2.06835e-9,0,0,.99999,6.94952e-9,0,0,.999984,2.23363e-8,0,0,.999972,6.78578e-8,0,0,.999952,1.93571e-7,0,0,.999919,5.16594e-7,0,0,.99986,128739e-11,0,0,.999753,299298e-11,0,0,.999546,648258e-11,0,0,.999074,129985e-10,0,0,.997671,232176e-10,0,0,.991504,256701e-10,0,0,.981148,131141e-10,0,0,.971965,869048e-11,0,280182e-10,.966624,808301e-11,0,695475e-9,.965344,135235e-10,0,.00265522,.963048,210592e-10,0,.00622975,.958673,287473e-10,0,.0116234,.950262,281379e-10,0,.018976,.940836,271089e-10,0,.0283844,.930996,30926e-9,0,.0399151,.919848,348359e-10,0,.0536063,.909136,366092e-10,0,.0694793,.897554,384162e-10,0,.0875342,.884691,430971e-10,0,.107749,.869414,447803e-10,0,.130087,.853462,452858e-10,0,.154481,.838187,495769e-10,0,.180833,.820381,502709e-10,0,.209005,.801844,522713e-10,0,.238791,.783061,541505e-10,0,.269869,.763205,553712e-10,0,.301587,.742362,564909e-10,0,.333333,.721393,572646e-10,0,.365079,.699676,581012e-10,0,.396825,.677395,58096e-9,0,.428571,.655208,585766e-10,0,.460317,.632451,583602e-10,0,.492064,.609839,580234e-10,0,.52381,.587093,577161e-10,0,.555556,.564467,568447e-10,0,.587302,.542043,563166e-10,0,.619048,.519826,55156e-9,0,.650794,.497952,541682e-10,0,.68254,.476477,528971e-10,0,.714286,.455412,514952e-10,0,.746032,.434926,502222e-10,0,.777778,.4149,485779e-10,0,.809524,.395552,472242e-10,0,.84127,.376712,454891e-10,0,.873016,.358622,440924e-10,0,.904762,.341048,422984e-10,0,.936508,.324262,408582e-10,0,.968254,.308013,390839e-10,0,1,1,613913e-16,0,0,1,614145e-16,0,0,1,617708e-16,0,0,1,633717e-16,0,0,1,681648e-16,0,0,1,808291e-16,0,0,1,1.14608e-10,0,0,.999998,2.10507e-10,0,0,.999997,4.99595e-10,0,0,.999995,1.39897e-9,0,0,.999994,4.19818e-9,0,0,.999988,1.27042e-8,0,0,.999979,3.75153e-8,0,0,.999965,1.06206e-7,0,0,.999945,2.85381e-7,0,0,.999908,7.23611e-7,0,0,.999846,17255e-10,0,0,.999733,386104e-11,0,0,.999511,808493e-11,0,0,.998993,156884e-10,0,0,.997326,265538e-10,0,0,.989706,206466e-10,0,0,.981713,130756e-10,0,70005e-10,.973636,106473e-10,0,464797e-9,.966509,10194e-9,0,.00201743,.965149,165881e-10,0,.00497549,.962669,249147e-10,0,.00953262,.95786,317449e-10,0,.0158211,.949334,281045e-10,0,.0239343,.941041,303263e-10,0,.0339372,.931575,356754e-10,0,.0458738,.920102,397075e-10,0,.059772,.908002,384886e-10,0,.075645,.897269,43027e-9,0,.0934929,.884559,479925e-10,0,.113302,.869161,48246e-9,0,.135045,.853342,509505e-10,0,.158678,.837633,542846e-10,0,.184136,.820252,554139e-10,0,.211325,.801872,581412e-10,0,.240113,.782418,585535e-10,0,.270306,.7631,610923e-10,0,.301594,.742183,613678e-10,0,.333333,.721098,627275e-10,0,.365079,.699512,629413e-10,0,.396825,.677372,636351e-10,0,.428571,.655059,633555e-10,0,.460317,.632567,636513e-10,0,.492064,.609784,628965e-10,0,.52381,.587237,625546e-10,0,.555556,.564525,615825e-10,0,.587302,.542181,605048e-10,0,.619048,.520017,596329e-10,0,.650794,.498204,581516e-10,0,.68254,.476742,569186e-10,0,.714286,.455803,553833e-10,0,.746032,.435251,537807e-10,0,.777778,.415374,522025e-10,0,.809524,.395921,503421e-10,0,.84127,.377253,488211e-10,0,.873016,.359021,468234e-10,0,.904762,.341637,453269e-10,0,.936508,.3247,433014e-10,0,.968254,.308625,418007e-10,0,1,1,2.86798e-10,0,0,1,2.86877e-10,0,0,1,2.88094e-10,0,0,1,2.93506e-10,0,0,1,3.09262e-10,0,0,.999999,3.48593e-10,0,0,.999999,4.44582e-10,0,0,.999998,6.88591e-10,0,0,.999996,1.34391e-9,0,0,.999993,3.17438e-9,0,0,.999989,8.35609e-9,0,0,.999983,2.28677e-8,0,0,.999974,6.23361e-8,0,0,.999959,1.65225e-7,0,0,.999936,4.19983e-7,0,0,.999896,101546e-11,0,0,.99983,232376e-11,0,0,.999709,50156e-10,0,0,.999469,10167e-9,0,0,.998886,190775e-10,0,0,.996819,300511e-10,0,0,.988837,185092e-10,0,1.68222e-7,.982178,134622e-10,0,259622e-9,.975017,125961e-10,0,.00142595,.967101,13507e-9,0,.00382273,.964905,205003e-10,0,.00764164,.96218,29546e-9,0,.0130121,.956821,343738e-10,0,.0200253,.948829,305063e-10,0,.0287452,.941092,346487e-10,0,.039218,.931883,412061e-10,0,.0514748,.920211,444651e-10,0,.0655351,.907307,431252e-10,0,.0814082,.89684,490382e-10,0,.0990939,.884119,53334e-9,0,.118583,.869148,54114e-9,0,.139856,.853377,578536e-10,0,.162882,.836753,592285e-10,0,.187615,.820063,622787e-10,0,.213991,.801694,645492e-10,0,.241918,.782116,65353e-9,0,.271267,.762673,674344e-10,0,.301847,.742133,682788e-10,0,.333333,.720779,691959e-10,0,.365079,.699386,696817e-10,0,.396826,.67732,699583e-10,0,.428572,.654888,698447e-10,0,.460318,.632499,694063e-10,0,.492064,.609825,691612e-10,0,.52381,.587287,681576e-10,0,.555556,.564743,674138e-10,0,.587302,.542409,661617e-10,0,.619048,.520282,647785e-10,0,.650794,.498506,633836e-10,0,.68254,.477102,615905e-10,0,.714286,.456167,601013e-10,0,.746032,.435728,581457e-10,0,.777778,.415809,564215e-10,0,.809524,.396517,544997e-10,0,.84127,.377737,525061e-10,0,.873016,.359698,506831e-10,0,.904762,.342164,48568e-9,0,.936508,.325417,467826e-10,0,.968254,.309186,446736e-10,0,1,1,1.09018e-9,0,0,1,1.0904e-9,0,0,1,1.09393e-9,0,0,1,1.1095e-9,0,0,1,1.154e-9,0,0,1,1.26089e-9,0,0,.999999,1.5059e-9,0,0,.999997,2.07899e-9,0,0,.999994,3.48164e-9,0,0,.999993,7.05728e-9,0,0,.999987,1.63692e-8,0,0,.999981,4.06033e-8,0,0,.999969,1.0245e-7,0,0,.999953,2.55023e-7,0,0,.999925,6.1511e-7,0,0,.999881,142218e-11,0,0,.99981,313086e-11,0,0,.99968,653119e-11,0,0,.999418,12832e-9,0,0,.998748,232497e-10,0,0,.996066,329522e-10,0,0,.988379,179613e-10,0,108799e-9,.982567,143715e-10,0,921302e-9,.976097,148096e-10,0,.00280738,.968475,178905e-10,0,.00596622,.964606,253921e-10,0,.0105284,.961564,348623e-10,0,.0165848,.955517,357612e-10,0,.0242,.948381,343493e-10,0,.03342,.941095,405849e-10,0,.0442777,.931923,475394e-10,0,.0567958,.91996,484328e-10,0,.0709879,.907419,502146e-10,0,.086861,.89618,561654e-10,0,.104415,.88337,587612e-10,0,.123643,.869046,618057e-10,0,.144531,.853278,657392e-10,0,.167057,.836091,66303e-9,0,.191188,.819644,704445e-10,0,.216878,.801246,714071e-10,0,.244062,.782031,740093e-10,0,.272649,.762066,74685e-9,0,.302509,.741964,766647e-10,0,.333442,.720554,766328e-10,0,.365079,.699098,777857e-10,0,.396826,.677189,774633e-10,0,.428572,.65484,776235e-10,0,.460318,.632496,770316e-10,0,.492064,.609908,762669e-10,0,.52381,.587312,753972e-10,0,.555556,.564938,739994e-10,0,.587302,.542577,728382e-10,0,.619048,.52062,71112e-9,0,.650794,.498819,694004e-10,0,.68254,.477555,675575e-10,0,.714286,.456568,653449e-10,0,.746032,.436278,636068e-10,0,.777778,.41637,613466e-10,0,.809524,.397144,594177e-10,0,.84127,.378412,570987e-10,0,.873016,.360376,550419e-10,0,.904762,.342906,527422e-10,0,.936508,.326136,506544e-10,0,.968254,.30997,484307e-10,0,1,1,3.54014e-9,0,0,1,3.54073e-9,0,0,1,3.54972e-9,0,0,1,3.58929e-9,0,0,1,3.70093e-9,0,0,.999999,3.96194e-9,0,0,.999998,4.53352e-9,0,0,.999997,5.78828e-9,0,0,.999994,8.63812e-9,0,0,.999991,1.53622e-8,0,0,.999985,3.16356e-8,0,0,.999977,7.12781e-8,0,0,.999964,1.66725e-7,0,0,.999945,3.90501e-7,0,0,.999912,8.95622e-7,0,0,.999866,198428e-11,0,0,.999786,421038e-11,0,0,.999647,850239e-11,0,0,.999356,162059e-10,0,0,.998563,282652e-10,0,0,.994928,336309e-10,0,244244e-10,.987999,178458e-10,0,523891e-9,.982893,159162e-10,0,.00194729,.977044,178056e-10,0,.00451099,.969972,230624e-10,0,.00835132,.964237,313922e-10,0,.013561,.960791,406145e-10,0,.0202056,.954292,372796e-10,0,.0283321,.948052,403199e-10,0,.0379739,.940938,479537e-10,0,.0491551,.931689,545292e-10,0,.0618918,.91987,54038e-9,0,.0761941,.907665,589909e-10,0,.0920672,.895281,642651e-10,0,.109511,.882621,659707e-10,0,.12852,.86873,709973e-10,0,.149085,.853008,742221e-10,0,.171189,.835944,761754e-10,0,.194809,.818949,797052e-10,0,.21991,.800951,812434e-10,0,.246447,.781847,838075e-10,0,.274352,.761649,84501e-9,0,.303535,.74152,860258e-10,0,.333857,.720495,866233e-10,0,.365104,.698742,868326e-10,0,.396826,.677096,87133e-9,0,.428572,.654782,863497e-10,0,.460318,.632335,860206e-10,0,.492064,.610031,849337e-10,0,.52381,.587457,838279e-10,0,.555556,.56513,82309e-9,0,.587302,.542877,803542e-10,0,.619048,.5209,786928e-10,0,.650794,.499291,765171e-10,0,.68254,.477971,744753e-10,0,.714286,.457221,72209e-9,0,.746032,.436803,697448e-10,0,.777778,.417083,675333e-10,0,.809524,.397749,648058e-10,0,.84127,.379177,625759e-10,0,.873016,.361061,598584e-10,0,.904762,.343713,575797e-10,0,.936508,.326894,549999e-10,0,.968254,.310816,527482e-10,0,1,1,1.0153e-8,0,0,1,1.01544e-8,0,0,1,1.01751e-8,0,0,1,1.02662e-8,0,0,1,1.0521e-8,0,0,.999999,1.11049e-8,0,0,.999999,1.23408e-8,0,0,.999996,1.4924e-8,0,0,.999992,2.04471e-8,0,0,.999989,3.26539e-8,0,0,.99998,6.03559e-8,0,0,.999971,1.23936e-7,0,0,.999955,2.69058e-7,0,0,.999933,5.93604e-7,0,0,.999901,129633e-11,0,0,.999847,275621e-11,0,0,.999761,564494e-11,0,0,.999607,110485e-10,0,0,.999282,204388e-10,0,0,.99831,341084e-10,0,2.2038e-7,.993288,294949e-10,0,242388e-9,.987855,192736e-10,0,.0012503,.983167,182383e-10,0,.0032745,.977908,218633e-10,0,.00646321,.971194,290662e-10,0,.0109133,.963867,386401e-10,0,.0166927,.95982,462827e-10,0,.0238494,.953497,420705e-10,0,.0324178,.947621,477743e-10,0,.0424225,.940611,568258e-10,0,.0538808,.931174,618061e-10,0,.0668047,.919919,627098e-10,0,.0812014,.907856,694714e-10,0,.0970745,.894509,735008e-10,0,.114424,.881954,763369e-10,0,.133246,.868309,821896e-10,0,.153534,.852511,83769e-9,0,.175275,.835821,881615e-10,0,.198453,.817981,896368e-10,0,.223042,.800504,930906e-10,0,.249009,.78141,945056e-10,0,.276304,.761427,963605e-10,0,.304862,.74094,968088e-10,0,.334584,.720233,981481e-10,0,.365322,.698592,979122e-10,0,.396826,.676763,981057e-10,0,.428571,.654808,973956e-10,0,.460318,.632326,962619e-10,0,.492064,.610049,952996e-10,0,.52381,.58763,933334e-10,0,.555556,.565261,917573e-10,0,.587302,.543244,896636e-10,0,.619048,.521273,873304e-10,0,.650794,.499818,852648e-10,0,.68254,.478536,823961e-10,0,.714286,.457826,79939e-9,0,.746032,.437549,77126e-9,0,.777778,.41776,743043e-10,0,.809524,.39863,716426e-10,0,.84127,.379954,686456e-10,0,.873016,.362025,660514e-10,0,.904762,.344581,630755e-10,0,.936508,.327909,605439e-10,0,.968254,.311736,576345e-10,0,1,1,2.63344e-8,0,0,1,2.63373e-8,0,0,1,2.63815e-8,0,0,1,2.65753e-8,0,0,1,2.71132e-8,0,0,.999999,2.83279e-8,0,0,.999997,3.0833e-8,0,0,.999995,3.58711e-8,0,0,.999992,4.61266e-8,0,0,.999985,6.7574e-8,0,0,.999977,1.1358e-7,0,0,.999966,2.13657e-7,0,0,.999948,4.31151e-7,0,0,.999923,8.96656e-7,0,0,.999884,186603e-11,0,0,.999826,381115e-11,0,0,.999732,754184e-11,0,0,.999561,143192e-10,0,0,.999191,257061e-10,0,0,.997955,405724e-10,0,744132e-10,.992228,276537e-10,0,716477e-9,.987638,208885e-10,0,.0022524,.983395,215226e-10,0,.00484816,.978614,270795e-10,0,.00860962,.972389,365282e-10,0,.0136083,.964392,474747e-10,0,.0198941,.95861,509141e-10,0,.0275023,.952806,48963e-9,0,.0364584,.94712,571119e-10,0,.04678,.940104,671704e-10,0,.0584799,.930398,687586e-10,0,.0715665,.919866,738161e-10,0,.086045,.907853,813235e-10,0,.101918,.894078,834582e-10,0,.119186,.881177,892093e-10,0,.137845,.867575,944548e-10,0,.157891,.852107,969607e-10,0,.179316,.835502,101456e-9,0,.202106,.81756,103256e-9,0,.226243,.79984,106954e-9,0,.251704,.780998,108066e-9,0,.278451,.761132,110111e-9,0,.306436,.740429,110459e-9,0,.335586,.719836,111219e-9,0,.365796,.698467,11145e-8,0,.3969,.676446,110393e-9,0,.428571,.654635,110035e-9,0,.460318,.632411,108548e-9,0,.492064,.609986,106963e-9,0,.52381,.587872,105238e-9,0,.555556,.565528,102665e-9,0,.587302,.543563,100543e-9,0,.619048,.52176,976182e-10,0,.650794,.500188,947099e-10,0,.68254,.479204,919929e-10,0,.714286,.458413,886139e-10,0,.746032,.438314,857839e-10,0,.777778,.418573,82411e-9,0,.809524,.39947,792211e-10,0,.84127,.380892,759546e-10,0,.873016,.362953,727571e-10,0,.904762,.345601,695738e-10,0,.936508,.328895,664907e-10,0,.968254,.312808,634277e-10,0,1,1,6.28647e-8,0,0,1,6.28705e-8,0,0,1,6.29587e-8,0,0,1,6.33441e-8,0,0,.999999,6.44087e-8,0,0,.999998,6.67856e-8,0,0,.999997,7.15889e-8,0,0,.999995,8.09577e-8,0,0,.999989,9.92764e-8,0,0,.999983,1.35834e-7,0,0,.999974,2.10482e-7,0,0,.999959,3.65215e-7,0,0,.999939,6.86693e-7,0,0,.999911,13472e-10,0,0,.999868,26731e-10,0,0,.999804,524756e-11,0,0,.9997,100403e-10,0,0,.99951,185019e-10,0,0,.999078,322036e-10,0,620676e-11,.997428,470002e-10,0,341552e-9,.99162,287123e-10,0,.00143727,.987479,234706e-10,0,.00349201,.983582,260083e-10,0,.0066242,.979186,337927e-10,0,.0109113,.97325,454689e-10,0,.0164064,.965221,573759e-10,0,.0231463,.957262,544114e-10,0,.0311571,.952211,587006e-10,0,.0404572,.946631,692256e-10,0,.0510592,.939391,787819e-10,0,.0629723,.929795,792368e-10,0,.0762025,.91965,875075e-10,0,.090753,.907737,950903e-10,0,.106626,.893899,972963e-10,0,.123822,.880239,10459e-8,0,.142337,.866562,107689e-9,0,.16217,.85164,113081e-9,0,.183314,.835021,116636e-9,0,.20576,.817311,120074e-9,0,.229496,.798845,121921e-9,0,.254502,.780479,12475e-8,0,.280753,.760694,125255e-9,0,.308212,.740142,126719e-9,0,.336825,.719248,12636e-8,0,.366517,.698209,126712e-9,0,.397167,.676398,125769e-9,0,.428578,.654378,124432e-9,0,.460318,.632484,123272e-9,0,.492064,.610113,12085e-8,0,.52381,.587931,118411e-9,0,.555556,.565872,11569e-8,0,.587302,.543814,112521e-9,0,.619048,.522265,109737e-9,0,.650794,.500835,106228e-9,0,.68254,.479818,102591e-9,0,.714286,.459258,991288e-10,0,.746032,.439061,952325e-10,0,.777778,.419552,91895e-9,0,.809524,.400399,879051e-10,0,.84127,.381976,844775e-10,0,.873016,.364009,806316e-10,0,.904762,.346761,771848e-10,0,.936508,.330049,735429e-10,0,.968254,.314018,702103e-10,0,1,1,1.39968e-7,0,0,1,1.39979e-7,0,0,1,1.40145e-7,0,0,1,1.4087e-7,0,0,.999999,1.42865e-7,0,0,.999998,1.47279e-7,0,0,.999997,1.56057e-7,0,0,.999992,1.7276e-7,0,0,.999989,2.04352e-7,0,0,.99998,2.6494e-7,0,0,.999969,3.83435e-7,0,0,.999953,6.18641e-7,0,0,.999929,108755e-11,0,0,.999898,201497e-11,0,0,.999849,381346e-11,0,0,.999778,719815e-11,0,0,.999661,133215e-10,0,0,.999451,238313e-10,0,0,.998936,401343e-10,0,113724e-9,.99662,517346e-10,0,820171e-9,.991094,304323e-10,0,.00238143,.987487,281757e-10,0,.00493527,.983731,320048e-10,0,.00856859,.979647,423905e-10,0,.0133393,.973837,562935e-10,0,.0192863,.96584,677442e-10,0,.0264369,.956309,623073e-10,0,.03481,.951523,704131e-10,0,.0444184,.946003,836594e-10,0,.0552713,.938454,911736e-10,0,.0673749,.929279,938264e-10,0,.0807329,.919239,103754e-9,0,.0953479,.907293,109928e-9,0,.111221,.893936,115257e-9,0,.128352,.879674,122265e-9,0,.14674,.865668,125733e-9,0,.166382,.850998,132305e-9,0,.187276,.834498,134844e-9,0,.209413,.816903,139276e-9,0,.232786,.798235,140984e-9,0,.257382,.779724,14378e-8,0,.283181,.760251,144623e-9,0,.310156,.739808,145228e-9,0,.338269,.718762,14539e-8,0,.367461,.697815,144432e-9,0,.397646,.67631,143893e-9,0,.428685,.654278,141846e-9,0,.460318,.632347,13935e-8,0,.492064,.610296,137138e-9,0,.52381,.588039,133806e-9,0,.555556,.566218,130755e-9,0,.587302,.544346,127128e-9,0,.619048,.522701,123002e-9,0,.650794,.501542,119443e-9,0,.68254,.480508,115055e-9,0,.714286,.460092,111032e-9,0,.746032,.440021,106635e-9,0,.777778,.420446,102162e-9,0,.809524,.401512,98184e-9,0,.84127,.38299,936497e-10,0,.873016,.365232,89813e-9,0,.904762,.347865,853073e-10,0,.936508,.331342,817068e-10,0,.968254,.315202,773818e-10,0,1,1,2.9368e-7,0,0,1,2.937e-7,0,0,1,2.93998e-7,0,0,1,2.95298e-7,0,0,.999999,2.98865e-7,0,0,.999998,3.067e-7,0,0,.999995,3.22082e-7,0,0,.999992,3.50767e-7,0,0,.999986,4.03538e-7,0,0,.999976,5.01372e-7,0,0,.999964,6.8562e-7,0,0,.999945,10374e-10,0,0,.999919,171269e-11,0,0,.999882,300175e-11,0,0,.999829,542144e-11,0,0,.999749,984182e-11,0,0,.99962,176213e-10,0,0,.999382,305995e-10,0,138418e-10,.998751,496686e-10,0,389844e-9,.995344,510733e-10,0,.00150343,.990768,345829e-10,0,.00352451,.987464,342841e-10,0,.00655379,.983846,399072e-10,0,.0106554,.980007,533219e-10,0,.0158723,.974494,696992e-10,0,.0222333,.96622,776754e-10,0,.029758,.956273,747718e-10,0,.0384596,.950952,864611e-10,0,.0483473,.945215,100464e-9,0,.0594266,.937287,103729e-9,0,.0717019,.928649,111665e-9,0,.0851752,.918791,12353e-8,0,.0998479,.906685,127115e-9,0,.115721,.893706,13628e-8,0,.132794,.879248,142427e-9,0,.151067,.864685,148091e-9,0,.170538,.850032,153517e-9,0,.191204,.833853,157322e-9,0,.213063,.816353,161086e-9,0,.236107,.797834,164111e-9,0,.260329,.778831,165446e-9,0,.285714,.759756,167492e-9,0,.312243,.739419,166928e-9,0,.339887,.718491,167e-6,0,.368604,.697392,165674e-9,0,.398329,.676102,163815e-9,0,.428961,.654243,162003e-9,0,.460331,.632176,158831e-9,0,.492064,.610407,155463e-9,0,.52381,.588394,152062e-9,0,.555556,.56645,147665e-9,0,.587302,.5449,14375e-8,0,.619048,.523276,138905e-9,0,.650794,.502179,134189e-9,0,.68254,.481359,129392e-9,0,.714286,.46092,124556e-9,0,.746032,.441084,11957e-8,0,.777778,.421517,114652e-9,0,.809524,.402721,109688e-9,0,.84127,.384222,104667e-9,0,.873016,.366534,999633e-10,0,.904762,.349205,950177e-10,0,.936508,.332702,907301e-10,0,.968254,.316599,859769e-10,0,1,1,5.85473e-7,0,0,1,5.85507e-7,0,0,1,5.8602e-7,0,0,.999999,5.88259e-7,0,0,.999999,5.94381e-7,0,0,.999998,6.07754e-7,0,0,.999995,6.33729e-7,0,0,.99999,6.8137e-7,0,0,.999984,7.67003e-7,0,0,.999973,9.21212e-7,0,0,.999959,120218e-11,0,0,.999936,172024e-11,0,0,.999907,268088e-11,0,0,.999866,445512e-11,0,0,.999806,768481e-11,0,0,.999716,1342e-8,0,0,.999576,232473e-10,0,0,.9993,391694e-10,0,129917e-9,.998498,608429e-10,0,845035e-9,.994132,489743e-10,0,.00237616,.99031,384644e-10,0,.00484456,.987409,421768e-10,0,.00832472,.983981,504854e-10,0,.0128643,.980268,671028e-10,0,.0184947,.974875,852749e-10,0,.025237,.966063,85531e-9,0,.0331046,.956779,900588e-10,0,.0421067,.950259,10577e-8,0,.0522487,.944239,119458e-9,0,.0635343,.936341,122164e-9,0,.0759654,.928047,134929e-9,0,.0895434,.918065,145544e-9,0,.104269,.906267,150531e-9,0,.120142,.893419,161652e-9,0,.137163,.878758,16593e-8,0,.15533,.863699,174014e-9,0,.174645,.848876,177877e-9,0,.195106,.833032,184049e-9,0,.21671,.815557,186088e-9,0,.239454,.797323,19054e-8,0,.263332,.778124,191765e-9,0,.288336,.758929,192535e-9,0,.314451,.738979,192688e-9,0,.341658,.718213,191522e-9,0,.369924,.696947,190491e-9,0,.399202,.675807,187913e-9,0,.429416,.654147,184451e-9,0,.460447,.63229,181442e-9,0,.492064,.610499,177139e-9,0,.523809,.588747,172596e-9,0,.555555,.566783,167457e-9,0,.587301,.545359,162518e-9,0,.619048,.523984,156818e-9,0,.650794,.502917,151884e-9,0,.68254,.482294,145514e-9,0,.714286,.461945,140199e-9,0,.746032,.442133,134101e-9,0,.777778,.422705,128374e-9,0,.809524,.403916,122996e-9,0,.84127,.38554,116808e-9,0,.873016,.367909,111973e-9,0,.904762,.350651,105938e-9,0,.936508,.334208,101355e-9,0,.968254,.318123,957629e-10,0,1,1,111633e-11,0,0,1,111639e-11,0,0,1,111725e-11,0,0,1,112096e-11,0,0,.999999,11311e-10,0,0,.999997,115315e-11,0,0,.999995,11956e-10,0,0,.999989,127239e-11,0,0,.999981,140772e-11,0,0,.999969,164541e-11,0,0,.999952,206607e-11,0,0,.999928,281783e-11,0,0,.999895,416835e-11,0,0,.999848,658728e-11,0,0,.999781,108648e-10,0,0,.999682,182579e-10,0,0,.999523,306003e-10,0,159122e-10,.999205,499862e-10,0,391184e-9,.998131,73306e-9,0,.00147534,.993334,513229e-10,0,.0034227,.99016,467783e-10,0,.00632232,.987321,523413e-10,0,.0102295,.984099,64267e-9,0,.0151794,.980432,843042e-10,0,.0211947,.974976,102819e-9,0,.0282899,.966429,996234e-10,0,.0364739,.957633,111074e-9,0,.0457522,.949422,128644e-9,0,.0561278,.943045,140076e-9,0,.0676023,.935448,146349e-9,0,.0801762,.927225,161854e-9,0,.0938499,.917033,169135e-9,0,.108623,.905762,179987e-9,0,.124496,.892879,189832e-9,0,.141469,.878435,195881e-9,0,.159541,.863114,20466e-8,0,.178713,.84776,209473e-9,0,.198985,.832084,214861e-9,0,.220355,.814915,217695e-9,0,.242823,.796711,220313e-9,0,.266385,.777603,22313e-8,0,.291036,.757991,222471e-9,0,.316767,.738371,222869e-9,0,.343563,.717872,221243e-9,0,.371402,.696619,218089e-9,0,.400248,.675379,21562e-8,0,.430047,.65411,21169e-8,0,.460709,.63241,206947e-9,0,.492079,.61046,201709e-9,0,.52381,.58903,196753e-9,0,.555556,.567267,189637e-9,0,.587302,.545886,184735e-9,0,.619048,.524714,177257e-9,0,.650794,.503789,171424e-9,0,.68254,.483204,164688e-9,0,.714286,.462976,157172e-9,0,.746032,.443294,151341e-9,0,.777778,.423988,143737e-9,0,.809524,.405325,138098e-9,0,.84127,.386981,130698e-9,0,.873016,.369436,125276e-9,0,.904762,.35219,118349e-9,0,.936508,.335804,11312e-8,0,.968254,.319749,106687e-9,0,1,1,204685e-11,0,0,1,204694e-11,0,0,1,204831e-11,0,0,.999999,205428e-11,0,0,.999999,207056e-11,0,0,.999997,210581e-11,0,0,.999993,21732e-10,0,0,.999987,229365e-11,0,0,.999979,250243e-11,0,0,.999965,286127e-11,0,0,.999947,348028e-11,0,0,.999918,455588e-11,0,0,.999881,643303e-11,0,0,.999828,970064e-11,0,0,.999753,153233e-10,0,0,.999642,24793e-9,0,0,.999464,402032e-10,0,122947e-9,.999089,635852e-10,0,807414e-9,.997567,857026e-10,0,.00227206,.992903,594912e-10,0,.00462812,.990011,578515e-10,0,.00794162,.987192,65399e-9,0,.0122534,.98418,819675e-10,0,.0175888,.980491,105514e-9,0,.0239635,.974779,121532e-9,0,.031387,.96675,119144e-9,0,.0398644,.958248,136125e-9,0,.0493982,.948884,155408e-9,0,.0599896,.941673,162281e-9,0,.0716382,.934521,176754e-9,0,.0843437,.926205,192873e-9,0,.0981056,.916089,200038e-9,0,.112923,.904963,213624e-9,0,.128796,.892089,221834e-9,0,.145725,.878028,232619e-9,0,.163709,.86249,238632e-9,0,.182749,.846587,247002e-9,0,.202847,.830988,250702e-9,0,.224001,.814165,255562e-9,0,.246214,.796135,257505e-9,0,.269482,.777052,258625e-9,0,.293805,.757201,258398e-9,0,.319176,.737655,256714e-9,0,.345587,.717477,255187e-9,0,.373021,.696433,251792e-9,0,.401454,.675084,247223e-9,0,.430844,.653907,242213e-9,0,.461125,.632561,237397e-9,0,.492187,.610658,229313e-9,0,.52381,.589322,224402e-9,0,.555556,.567857,216116e-9,0,.587302,.54652,209124e-9,0,.619048,.525433,201601e-9,0,.650794,.504679,192957e-9,0,.68254,.484203,186052e-9,0,.714286,.464203,177672e-9,0,.746032,.444549,170005e-9,0,.777778,.425346,162401e-9,0,.809524,.406706,1544e-7,0,.84127,.388576,147437e-9,0,.873016,.37094,139493e-9,0,.904762,.353996,133219e-9,0,.936508,.337391,125573e-9,0,.968254,.321648,119867e-9,0,1,1,362511e-11,0,0,1,362525e-11,0,0,1,362739e-11,0,0,.999999,363673e-11,0,0,.999998,366214e-11,0,0,.999996,371698e-11,0,0,.999992,382116e-11,0,0,.999986,400554e-11,0,0,.999976,432058e-11,0,0,.999961,485194e-11,0,0,.999938,574808e-11,0,0,.999908,726643e-11,0,0,.999865,984707e-11,0,0,.999807,142217e-10,0,0,.999723,215581e-10,0,0,.999602,336114e-10,0,119113e-10,.999398,527353e-10,0,355813e-9,.998946,805809e-10,0,.00137768,.996647,942908e-10,0,.00322469,.992298,668733e-10,0,.00597897,.989802,716564e-10,0,.00968903,.987019,821355e-10,0,.0143845,.984219,104555e-9,0,.0200831,.980425,131245e-9,0,.0267948,.974241,139613e-9,0,.034525,.967006,145931e-9,0,.0432757,.95893,167153e-9,0,.0530471,.949157,188146e-9,0,.0638386,.94062,194625e-9,0,.0756487,.933509,213721e-9,0,.0884762,.925088,229616e-9,0,.10232,.915178,239638e-9,0,.117178,.904093,254814e-9,0,.133051,.891337,263685e-9,0,.149939,.877326,274789e-9,0,.167841,.861794,280534e-9,0,.18676,.845758,289534e-9,0,.206696,.829792,294446e-9,0,.22765,.813037,296877e-9,0,.249625,.795285,300217e-9,0,.27262,.776323,299826e-9,0,.296636,.756673,299787e-9,0,.321671,.736856,297867e-9,0,.347718,.716883,294052e-9,0,.374768,.696089,289462e-9,0,.402804,.67505,285212e-9,0,.431796,.653509,27653e-8,0,.461695,.63258,271759e-9,0,.49242,.61104,262811e-9,0,.523822,.589567,255151e-9,0,.555556,.568322,246434e-9,0,.587302,.547235,237061e-9,0,.619048,.52616,228343e-9,0,.650794,.505716,219236e-9,0,.68254,.485274,209595e-9,0,.714286,.465411,201011e-9,0,.746032,.445854,19109e-8,0,.777778,.426911,182897e-9,0,.809524,.408222,173569e-9,0,.84127,.390307,165496e-9,0,.873016,.372624,156799e-9,0,.904762,.355804,14917e-8,0,.936508,.33924,140907e-9,0,.968254,.323534,134062e-9,0,1,1,622487e-11,0,0,1,62251e-10,0,0,1,622837e-11,0,0,.999999,624259e-11,0,0,.999998,628127e-11,0,0,.999996,636451e-11,0,0,.999991,65218e-10,0,0,.999984,679782e-11,0,0,.999973,726361e-11,0,0,.999955,803644e-11,0,0,.999931,931397e-11,0,0,.999896,114299e-10,0,0,.999847,149402e-10,0,0,.999784,207461e-10,0,0,.999692,302493e-10,0,0,.999554,454957e-10,0,997275e-10,.999326,690762e-10,0,724813e-9,.998757,101605e-9,0,.0020972,.995367,958745e-10,0,.00432324,.99209,832808e-10,0,.00746347,.989517,887601e-10,0,.0115534,.987008,10564e-8,0,.0166134,.98421,133179e-9,0,.0226552,.98021,161746e-9,0,.0296838,.973676,161821e-9,0,.0377016,.967052,178635e-9,0,.0467079,.959385,206765e-9,0,.0567013,.949461,22476e-8,0,.0676796,.939578,23574e-8,0,.0796403,.932416,25893e-8,0,.0925812,.923759,271228e-9,0,.106501,.914223,289165e-9,0,.121397,.902942,301156e-9,0,.13727,.890419,313852e-9,0,.15412,.876639,324408e-9,0,.171946,.861316,33249e-8,0,.190751,.84496,338497e-9,0,.210537,.828427,345861e-9,0,.231305,.811871,347863e-9,0,.253057,.794397,350225e-9,0,.275797,.775726,349915e-9,0,.299525,.75617,347297e-9,0,.324242,.736091,344232e-9,0,.349947,.716213,340835e-9,0,.376633,.695736,332369e-9,0,.404289,.674961,327943e-9,0,.432895,.653518,318533e-9,0,.462415,.632574,310391e-9,0,.492788,.61134,300755e-9,0,.523909,.590017,290506e-9,0,.555556,.568752,280446e-9,0,.587302,.548061,269902e-9,0,.619048,.52711,258815e-9,0,.650794,.506682,248481e-9,0,.68254,.486524,237141e-9,0,.714286,.466812,226872e-9,0,.746032,.44732,216037e-9,0,.777778,.428473,205629e-9,0,.809524,.409921,195691e-9,0,.84127,.392028,185457e-9,0,.873016,.374606,176436e-9,0,.904762,.357601,166508e-9,0,.936508,.341348,158385e-9,0,.968254,.32542,149203e-9,0,1,1,103967e-10,0,0,1,10397e-9,0,0,1,104019e-10,0,0,.999999,104231e-10,0,0,.999998,104806e-10,0,0,.999995,106042e-10,0,0,.999991,108366e-10,0,0,.999982,112415e-10,0,0,.999968,119174e-10,0,0,.99995,130227e-10,0,0,.999922,148176e-10,0,0,.999884,177303e-10,0,0,.99983,224564e-10,0,0,.999758,300966e-10,0,0,.999654,423193e-10,0,549083e-11,.999503,614848e-10,0,296087e-9,.999237,903576e-10,0,.00123144,.998491,1271e-7,0,.00295954,.994594,107754e-9,0,.00555829,.99178,103025e-9,0,.00907209,.989265,11154e-8,0,.0135257,.986998,136296e-9,0,.0189327,.984137,169154e-9,0,.0252993,.979798,196671e-9,0,.0326272,.97337,196678e-9,0,.0409157,.967239,223121e-9,0,.0501623,.959543,253809e-9,0,.0603638,.949466,265972e-9,0,.0715171,.939074,288372e-9,0,.0836187,.931118,310983e-9,0,.0966657,.922525,325561e-9,0,.110656,.912983,345725e-9,0,.125588,.901617,3556e-7,0,.141461,.889487,374012e-9,0,.158275,.875787,383445e-9,0,.176031,.860654,393972e-9,0,.19473,.844417,400311e-9,0,.214374,.82741,405004e-9,0,.234967,.810545,407378e-9,0,.256512,.793312,407351e-9,0,.279011,.774847,406563e-9,0,.302468,.755621,404903e-9,0,.326887,.735511,397486e-9,0,.352266,.715435,39357e-8,0,.378605,.695403,384739e-9,0,.405897,.674681,376108e-9,0,.43413,.65359,365997e-9,0,.463277,.632471,354957e-9,0,.493295,.61151,343593e-9,0,.524106,.59064,331841e-9,0,.555561,.569386,318891e-9,0,.587302,.548785,3072e-7,0,.619048,.528146,29361e-8,0,.650794,.507872,281709e-9,0,.68254,.487805,268627e-9,0,.714286,.468196,255887e-9,0,.746032,.448922,243997e-9,0,.777778,.430093,231662e-9,0,.809524,.411845,220339e-9,0,.84127,.393808,208694e-9,0,.873016,.376615,198045e-9,0,.904762,.359655,187375e-9,0,.936508,.343452,177371e-9,0,.968254,.32765,167525e-9,0,1,1,169351e-10,0,0,1,169356e-10,0,0,1,169427e-10,0,0,.999999,169736e-10,0,0,.999998,170575e-10,0,0,.999995,172372e-10,0,0,.99999,175739e-10,0,0,.999979,181568e-10,0,0,.999966,191206e-10,0,0,.999944,20677e-9,0,0,.999912,231644e-10,0,0,.999869,271268e-10,0,0,.999811,334272e-10,0,0,.99973,433979e-10,0,0,.999617,590083e-10,0,680315e-10,.999445,829497e-10,0,612796e-9,.999138,118019e-9,0,.00187408,.998095,156712e-9,0,.00395791,.993919,125054e-9,0,.00692144,.991333,126091e-9,0,.0107962,.989226,144912e-9,0,.0155986,.986954,175737e-9,0,.0213364,.983982,213883e-9,0,.0280114,.979128,234526e-9,0,.0356226,.973327,243725e-9,0,.0441668,.967416,2773e-7,0,.0536399,.959729,308799e-9,0,.0640376,.949758,322447e-9,0,.0753554,.939173,350021e-9,0,.0875893,.9296,370089e-9,0,.100736,.921181,391365e-9,0,.114793,.91164,413636e-9,0,.129759,.900435,427068e-9,0,.145632,.888183,441046e-9,0,.162412,.874772,454968e-9,0,.180101,.859566,461882e-9,0,.1987,.843579,471556e-9,0,.218213,.826453,474335e-9,0,.238641,.809164,477078e-9,0,.259989,.792179,47755e-8,0,.282262,.773866,472573e-9,0,.305464,.754944,469765e-9,0,.329599,.735133,462371e-9,0,.35467,.714858,453674e-9,0,.380678,.694829,443888e-9,0,.407622,.674453,432052e-9,0,.435493,.653685,420315e-9,0,.464275,.632666,406829e-9,0,.493938,.611676,392234e-9,0,.524422,.591193,379208e-9,0,.555624,.570145,36319e-8,0,.587302,.549566,349111e-9,0,.619048,.529278,334166e-9,0,.650794,.509026,318456e-9,0,.68254,.489186,30449e-8,0,.714286,.469662,289051e-9,0,.746032,.450691,275494e-9,0,.777778,.431841,261437e-9,0,.809524,.413752,247846e-9,0,.84127,.395951,235085e-9,0,.873016,.378633,222245e-9,0,.904762,.36194,210533e-9,0,.936508,.345599,198494e-9,0,.968254,.329999,188133e-9,0,1,1,269663e-10,0,0,1,26967e-9,0,0,1,269772e-10,0,0,.999999,270214e-10,0,0,.999998,271415e-10,0,0,.999994,27398e-9,0,0,.999988,278771e-10,0,0,.999977,287019e-10,0,0,.999961,300544e-10,0,0,.999937,322138e-10,0,0,.999904,356163e-10,0,0,.999854,409465e-10,0,0,.99979,492651e-10,0,0,.999699,621722e-10,0,8.8288e-7,.999572,819715e-10,0,223369e-9,.999381,111689e-9,0,.00105414,.999016,153862e-9,0,.0026493,.997437,187667e-9,0,.00508608,.993545,155672e-9,0,.00840554,.991135,161455e-9,0,.012629,.989157,188241e-9,0,.0177661,.986874,226229e-9,0,.0238198,.983714,268668e-9,0,.0307887,.978301,277109e-9,0,.0386688,.973227,303446e-9,0,.0474554,.967317,341851e-9,0,.0571428,.959477,370885e-9,0,.0677256,.950012,392753e-9,0,.0791988,.939484,42781e-8,0,.0915576,.928135,443866e-9,0,.104798,.919819,472959e-9,0,.118918,.910049,491551e-9,0,.133915,.899181,512616e-9,0,.149788,.886881,523563e-9,0,.166537,.87359,540183e-9,0,.184164,.858613,547386e-9,0,.202669,.842809,554809e-9,0,.222056,.825727,558316e-9,0,.242329,.808086,557824e-9,0,.263492,.790728,556346e-9,0,.285551,.772987,552672e-9,0,.30851,.7541,543738e-9,0,.332376,.734669,536107e-9,0,.357153,.714411,523342e-9,0,.382845,.694196,512238e-9,0,.409454,.674252,497465e-9,0,.436977,.65357,481096e-9,0,.465404,.632999,467054e-9,0,.494713,.611994,448771e-9,0,.524864,.591604,431889e-9,0,.555779,.571134,415238e-9,0,.587302,.550528,396369e-9,0,.619048,.530292,379477e-9,0,.650794,.510364,361488e-9,0,.68254,.490749,343787e-9,0,.714286,.471266,327822e-9,0,.746032,.452462,310626e-9,0,.777778,.433907,295352e-9,0,.809524,.415659,279179e-9,0,.84127,.398138,264685e-9,0,.873016,.380833,249905e-9,0,.904762,.364247,236282e-9,0,.936508,.348041,222905e-9,0,.968254,.332389,210522e-9,0,1,1,420604e-10,0,0,1,420614e-10,0,0,1,420757e-10,0,0,.999999,42138e-9,0,0,.999997,423067e-10,0,0,.999993,426668e-10,0,0,.999986,433372e-10,0,0,.999974,444857e-10,0,0,.999956,463554e-10,0,0,.99993,493105e-10,0,0,.999892,539077e-10,0,0,.999838,610005e-10,0,0,.999767,718822e-10,0,0,.999666,884581e-10,0,365471e-10,.999525,113398e-9,0,485623e-9,.999311,150043e-9,0,.00162096,.998865,200063e-9,0,.00355319,.996278,211014e-9,0,.00633818,.992956,189672e-9,0,.0100043,.991017,210262e-9,0,.0145648,.989055,244292e-9,0,.0200237,.986741,290481e-9,0,.0263798,.983288,334303e-9,0,.033629,.977784,340307e-9,0,.0417652,.973037,377864e-9,0,.0507821,.967181,4239e-7,0,.060673,.958971,443854e-9,0,.0714314,.950093,483039e-9,0,.0830518,.939552,517934e-9,0,.0955288,.927678,539449e-9,0,.108859,.918278,568604e-9,0,.123038,.908449,588505e-9,0,.138065,.897713,612473e-9,0,.153938,.885533,625575e-9,0,.170657,.872131,63854e-8,0,.188224,.857517,647034e-9,0,.20664,.841796,65209e-8,0,.225909,.824726,6544e-7,0,.246035,.807297,655744e-9,0,.267022,.789058,646716e-9,0,.288878,.77189,643898e-9,0,.311607,.753082,629973e-9,0,.335216,.7341,621564e-9,0,.359713,.714094,605171e-9,0,.385103,.693839,588752e-9,0,.41139,.673891,573294e-9,0,.438576,.653565,552682e-9,0,.466656,.633326,533446e-9,0,.495617,.612582,514635e-9,0,.525431,.59205,49303e-8,0,.556041,.571918,471842e-9,0,.587338,.551572,451713e-9,0,.619048,.531553,430049e-9,0,.650794,.51175,410445e-9,0,.68254,.49238,390098e-9,0,.714286,.473143,370033e-9,0,.746032,.45423,351205e-9,0,.777778,.435963,332049e-9,0,.809524,.41787,315021e-9,0,.84127,.400387,297315e-9,0,.873016,.383332,281385e-9,0,.904762,.366665,265397e-9,0,.936508,.350633,250601e-9,0,.968254,.334964,23589e-8,0,1,1,643736e-10,0,0,1,64375e-9,0,0,1,643947e-10,0,0,.999999,64481e-9,0,0,.999997,647143e-10,0,0,.999994,652119e-10,0,0,.999985,661359e-10,0,0,.999972,677116e-10,0,0,.999952,702599e-10,0,0,.999922,742517e-10,0,0,.99988,803906e-10,0,0,.99982,897315e-10,0,0,.999741,103838e-9,0,0,.999629,12496e-8,0,149024e-9,.999474,156161e-9,0,861027e-9,.999229,201034e-9,0,.00231198,.998662,259069e-9,0,.00458147,.995299,245439e-9,0,.00770895,.992732,24498e-8,0,.0117126,.990847,273211e-9,0,.0165989,.988911,316492e-9,0,.0223674,.98654,37161e-8,0,.0290135,.982636,410352e-9,0,.0365309,.977346,421756e-9,0,.0449117,.972909,475578e-9,0,.0541481,.966821,522482e-9,0,.0642326,.958686,545008e-9,0,.075158,.949754,589286e-9,0,.0869181,.939184,619995e-9,0,.0995074,.927505,654266e-9,0,.112922,.916606,682362e-9,0,.127157,.906707,704286e-9,0,.142212,.895937,725909e-9,0,.158085,.883913,743939e-9,0,.174776,.870642,755157e-9,0,.192287,.856241,764387e-9,0,.210619,.84069,771032e-9,0,.229775,.823728,765906e-9,0,.249761,.806481,767604e-9,0,.270582,.787924,754385e-9,0,.292243,.770588,749668e-9,0,.314753,.751991,731613e-9,0,.338118,.733407,717655e-9,0,.362347,.713688,700604e-9,0,.387447,.693595,678765e-9,0,.413424,.673426,657042e-9,0,.440284,.65359,635892e-9,0,.468027,.633576,611569e-9,0,.496645,.613144,586011e-9,0,.526122,.592711,563111e-9,0,.556417,.572722,537699e-9,0,.587451,.552762,512556e-9,0,.619048,.532985,489757e-9,0,.650794,.513219,464139e-9,0,.68254,.493992,442193e-9,0,.714286,.47509,418629e-9,0,.746032,.456287,397045e-9,0,.777778,.438152,375504e-9,0,.809524,.420294,35492e-8,0,.84127,.402749,335327e-9,0,.873016,.385879,316422e-9,0,.904762,.369352,298333e-9,0,.936508,.353301,281417e-9,0,.968254,.337781,265203e-9,0,1,1,968267e-10,0,0,1,968284e-10,0,0,1,968556e-10,0,0,.999999,969733e-10,0,0,.999997,972913e-10,0,0,.999993,979688e-10,0,0,.999984,992239e-10,0,0,.999969,101356e-9,0,0,.999946,104784e-9,0,0,.999913,110111e-9,0,0,.999868,118217e-9,0,0,.999801,130396e-9,0,0,.999712,148523e-9,0,124907e-10,.999589,175233e-9,0,355405e-9,.999416,213999e-9,0,.0013528,.999136,268529e-9,0,.00312557,.998367,333088e-9,0,.00573045,.994701,304757e-9,0,.00919397,.992497,318031e-9,0,.0135261,.990608,353863e-9,0,.0187278,.988715,409044e-9,0,.0247947,.986241,472967e-9,0,.0317196,.981696,495104e-9,0,.039494,.977097,532873e-9,0,.0481087,.972583,594447e-9,0,.0575549,.966142,636867e-9,0,.0678242,.95823,669899e-9,0,.0789089,.949677,719499e-9,0,.0908023,.939226,750584e-9,0,.103499,.927501,793183e-9,0,.116993,.915199,81995e-8,0,.131282,.90498,847654e-9,0,.146364,.894243,868929e-9,0,.162237,.882154,884278e-9,0,.178902,.869161,898108e-9,0,.196358,.854751,901254e-9,0,.21461,.839368,90679e-8,0,.23366,.822874,901541e-9,0,.253512,.805514,897297e-9,0,.274174,.78716,881856e-9,0,.29565,.769061,870032e-9,0,.31795,.751,851719e-9,0,.341081,.732614,830671e-9,0,.365053,.713171,806569e-9,0,.389874,.693472,78338e-8,0,.415553,.673528,756404e-9,0,.442098,.653397,726872e-9,0,.469512,.633781,700494e-9,0,.497794,.613877,67105e-8,0,.526935,.593506,640361e-9,0,.556908,.573667,613502e-9,0,.587657,.553932,583177e-9,0,.61906,.534345,554375e-9,0,.650794,.515042,527811e-9,0,.68254,.495674,499367e-9,0,.714286,.477132,47429e-8,0,.746032,.458609,447726e-9,0,.777778,.440354,424205e-9,0,.809524,.422765,399549e-9,0,.84127,.405472,378315e-9,0,.873016,.388482,355327e-9,0,.904762,.372191,336122e-9,0,.936508,.356099,315247e-9,0,.968254,.340737,29794e-8,0,1,1,143327e-9,0,0,1,14333e-8,0,0,1,143366e-9,0,0,.999999,143524e-9,0,0,.999996,143952e-9,0,0,.999991,144862e-9,0,0,.999981,146544e-9,0,0,.999966,149391e-9,0,0,.999941,153946e-9,0,0,.999905,160971e-9,0,0,.999852,171562e-9,0,0,.99978,18729e-8,0,0,.999681,210386e-9,0,826239e-10,.999546,243906e-9,0,664807e-9,.999352,291739e-9,0,.00196192,.999027,357419e-9,0,.00405941,.997886,422349e-9,0,.00699664,.99419,385008e-9,0,.0107896,.99214,409775e-9,0,.0154415,.990274,456418e-9,0,.0209488,.988455,527008e-9,0,.0273037,.985804,597685e-9,0,.0344969,.98103,613124e-9,0,.0425183,.976674,668321e-9,0,.0513575,.972021,736985e-9,0,.0610046,.965274,773789e-9,0,.0714508,.958046,830852e-9,0,.0826877,.949333,875766e-9,0,.0947085,.939135,917088e-9,0,.107507,.927119,952244e-9,0,.121078,.91469,990626e-9,0,.135419,.903006,.00101304,0,.150526,.892368,.00103834,0,.166399,.880231,.00105002,0,.183038,.867432,.00106331,0,.200443,.853208,.00106783,0,.218618,.837956,.00106458,0,.237566,.821772,.00105945,0,.257291,.804328,.00104685,0,.2778,.786465,.00103178,0,.2991,.768004,.00101077,0,.321199,.74972,985504e-9,0,.344106,.731682,962893e-9,0,.36783,.712813,932146e-9,0,.392383,.693139,89871e-8,0,.417774,.673566,869678e-9,0,.444013,.653483,835525e-9,0,.471107,.633891,799853e-9,0,.49906,.614433,766838e-9,0,.527869,.594586,732227e-9,0,.557517,.574769,696442e-9,0,.587966,.555149,663935e-9,0,.61913,.535898,629826e-9,0,.650794,.516753,596486e-9,0,.68254,.497816,567078e-9,0,.714286,.479034,534399e-9,0,.746032,.460975,507013e-9,0,.777778,.442935,477421e-9,0,.809524,.425263,451101e-9,0,.84127,.408248,424964e-9,0,.873016,.391339,39993e-8,0,.904762,.37513,377619e-9,0,.936508,.359172,354418e-9,0,.968254,.343876,334823e-9,0,1,1,209042e-9,0,0,1,209045e-9,0,0,1,209093e-9,0,0,.999999,209304e-9,0,0,.999996,209871e-9,0,0,.999991,211078e-9,0,0,.999979,213304e-9,0,0,.999963,217061e-9,0,0,.999933,223042e-9,0,0,.999894,232206e-9,0,0,.999837,245901e-9,0,0,.999756,266023e-9,0,102927e-11,.999648,295204e-9,0,233468e-9,.999499,336958e-9,0,.00108237,.999283,395563e-9,0,.00268832,.998896,473785e-9,0,.00511138,.997006,520008e-9,0,.00837705,.993819,497261e-9,0,.0124928,.991632,523722e-9,0,.0174561,.989875,587258e-9,0,.0232596,.988109,676329e-9,0,.0298932,.985155,747701e-9,0,.0373453,.980479,768803e-9,0,.0456045,.976271,841054e-9,0,.0546593,.971347,911469e-9,0,.0644994,.964528,953057e-9,0,.0751152,.957632,.00102221,0,.0864981,.948681,.00106122,0,.0986407,.938716,.00111857,0,.111537,.926629,.00114762,0,.125182,.914025,.00118995,0,.139571,.901026,.00121228,0,.154703,.890358,.00123946,0,.170576,.878283,.0012527,0,.18719,.865459,.00125536,0,.204547,.851407,.00126134,0,.222648,.836276,.00124759,0,.241498,.820436,.00124443,0,.261101,.803253,.00122071,0,.281465,.785562,.00120107,0,.302595,.76718,.00117762,0,.324501,.748551,.00114289,0,.347192,.730564,.00110872,0,.370679,.712253,.00107636,0,.394973,.692867,.00103646,0,.420085,.673695,996793e-9,0,.446027,.653912,95675e-8,0,.47281,.634129,916739e-9,0,.500441,.615004,874401e-9,0,.528921,.595587,833411e-9,0,.558244,.575965,794556e-9,0,.588384,.5566,75196e-8,0,.619281,.537428,716381e-9,0,.650795,.518623,676558e-9,0,.68254,.499964,64074e-8,0,.714286,.481356,605984e-9,0,.746032,.463279,570256e-9,0,.777778,.445673,540138e-9,0,.809524,.428032,507299e-9,0,.84127,.411112,479553e-9,0,.873016,.394444,450737e-9,0,.904762,.378247,424269e-9,0,.936508,.362415,399111e-9,0,.968254,.347103,375274e-9,0,1,1,300729e-9,0,0,1,300733e-9,0,0,1,300797e-9,0,0,.999998,301072e-9,0,0,.999996,301817e-9,0,0,.999989,303398e-9,0,0,.999977,306309e-9,0,0,.999958,311209e-9,0,0,.999927,318975e-9,0,0,.999884,330804e-9,0,0,.99982,34834e-8,0,0,.999733,373854e-9,0,326995e-10,.999613,410424e-9,0,477174e-9,.999447,462047e-9,0,.00161099,.999204,533322e-9,0,.00353153,.998725,624964e-9,0,.00627965,.995871,631786e-9,0,.0098693,.993194,632017e-9,0,.0143011,.991541,68923e-8,0,.019568,.989773,766892e-9,0,.0256593,.987647,863668e-9,0,.0325625,.984193,922089e-9,0,.0402647,.980016,970749e-9,0,.0487532,.975859,.00106027,0,.058016,.970514,.00112239,0,.0680419,.963625,.00117212,0,.0788208,.956959,.00125211,0,.0903439,.947956,.00129411,0,.102604,.93809,.00135879,0,.115594,.92659,.00139309,0,.129309,.913829,.00143253,0,.143745,.90005,.00145809,0,.158901,.888129,.0014748,0,.174774,.87607,.00148756,0,.191365,.863461,.00148714,0,.208674,.849594,.00148892,0,.226705,.834531,.00146496,0,.245461,.81903,.0014579,0,.264947,.802122,.00143039,0,.28517,.78445,.00139717,0,.306137,.766434,.00136312,0,.327857,.747816,.00132597,0,.350341,.729519,.00128323,0,.373598,.711454,.00123803,0,.397642,.692699,.00119097,0,.422485,.673723,.00114565,0,.448139,.654386,.00109552,0,.474619,.634673,.00104553,0,.501933,.615554,99985e-8,0,.530089,.596462,948207e-9,0,.559087,.577385,902299e-9,0,.588913,.558257,856448e-9,0,.619525,.5392,810395e-9,0,.650826,.520543,768558e-9,0,.68254,.502206,7239e-7,0,.714286,.48402,685794e-9,0,.746032,.465779,64471e-8,0,.777778,.448455,609583e-9,0,.809524,.431091,57227e-8,0,.84127,.414147,54042e-8,0,.873016,.39765,506545e-9,0,.904762,.381576,477635e-9,0,.936508,.365881,448446e-9,0,.968254,.350582,421424e-9,0,1,1,427144e-9,0,0,1,427151e-9,0,0,1,427232e-9,0,0,.999998,42759e-8,0,0,.999995,428555e-9,0,0,.999988,430603e-9,0,0,.999976,434368e-9,0,0,.999952,440688e-9,0,0,.999919,450667e-9,0,0,.999871,46578e-8,0,0,.999801,488024e-9,0,0,.999704,520092e-9,0,129791e-9,.999572,565553e-9,0,821056e-9,.999389,628906e-9,0,.00225241,.999114,714911e-9,0,.00449109,.998488,819218e-9,0,.00756249,.995234,80415e-8,0,.0114716,.993021,830181e-9,0,.0162131,.991407,902645e-9,0,.021776,.989625,996934e-9,0,.0281471,.987064,.00109707,0,.0353118,.983265,.00114353,0,.0432562,.979535,.0012272,0,.0519665,.975224,.00132642,0,.0614298,.969574,.00138092,0,.0716348,.963021,.00145896,0,.0825709,.956046,.00152834,0,.094229,.947136,.00158217,0,.106602,.937313,.0016347,0,.119682,.926073,.00168383,0,.133465,.913121,.00171627,0,.147947,.899165,.00174229,0,.163125,.885891,.00176137,0,.178998,.873783,.00176406,0,.195566,.861331,.00176156,0,.21283,.847569,.00175346,0,.230793,.832785,.00172753,0,.249459,.817442,.00170204,0,.268832,.800613,.00166576,0,.28892,.783597,.00162909,0,.30973,.76571,.0015826,0,.331271,.747021,.00153106,0,.353554,.728593,.00148036,0,.37659,.710661,.00142808,0,.400391,.692426,.00136906,0,.424973,.673623,.00131066,0,.450347,.65494,.00125569,0,.476531,.635448,.00119517,0,.503535,.616221,.00113828,0,.531372,.597531,.0010816,0,.560047,.578795,.00102673,0,.589554,.559892,970985e-9,0,.619869,.541307,919773e-9,0,.650923,.522608,868479e-9,0,.68254,.504484,82137e-8,0,.714286,.486603,772916e-9,0,.746032,.468802,730353e-9,0,.777778,.451172,684955e-9,0,.809524,.434348,647565e-9,0,.84127,.417445,605863e-9,0,.873016,.401077,571885e-9,0,.904762,.385039,536034e-9,0,.936508,.369483,504227e-9,0,.968254,.354272,473165e-9,0,1,1,599525e-9,0,0,1,599533e-9,0,0,1,599639e-9,0,0,.999998,600097e-9,0,0,.999994,601336e-9,0,0,.999987,603958e-9,0,0,.999972,608775e-9,0,0,.999949,616842e-9,0,0,.999912,629534e-9,0,0,.999857,648658e-9,0,0,.999781,676615e-9,0,538873e-11,.999674,716574e-9,0,308602e-9,.999528,772641e-9,0,.00127003,.999326,849806e-9,0,.00300783,.999009,952682e-9,0,.00556637,.998112,.00106394,0,.00895889,.994496,.00102228,0,.0131827,.992806,.00108586,0,.0182277,.991211,.0011759,0,.0240795,.989415,.00128955,0,.030723,.986499,.00139038,0,.0381418,.982679,.00144539,0,.046321,.978839,.00153954,0,.0552459,.974295,.00164417,0,.0649034,.968784,.00171517,0,.0752814,.962324,.00180282,0,.0863693,.954956,.00186387,0,.0981578,.94624,.00193817,0,.110639,.936517,.00198156,0,.123806,.925186,.00203042,0,.137655,.91252,.0020664,0,.15218,.898441,.00207822,0,.16738,.884394,.0020992,0,.183253,.871273,.00208748,0,.199799,.859057,.00208686,0,.21702,.845243,.00205519,0,.234918,.830723,.00202868,0,.253496,.815801,.00199501,0,.272761,.79914,.00194193,0,.292719,.782372,.00188824,0,.313377,.76482,.00183695,0,.334745,.746586,.00177418,0,.356833,.7281,.00170628,0,.379654,.709842,.00164063,0,.403221,.692019,.00157355,0,.427548,.67364,.00150262,0,.452651,.655277,.00143473,0,.478545,.636438,.00136371,0,.505246,.617364,.00129911,0,.532768,.598603,.00123014,0,.561122,.580195,.00116587,0,.590309,.561786,.00110398,0,.620318,.543377,.00104148,0,.651102,.525093,983984e-9,0,.682545,.506791,92667e-8,0,.714286,.489291,874326e-9,0,.746032,.471811,821734e-9,0,.777778,.454435,774698e-9,0,.809524,.437493,727302e-9,0,.84127,.420977,684039e-9,0,.873016,.404729,64373e-8,0,.904762,.388756,60285e-8,0,.936508,.373344,56765e-8,0,.968254,.358191,531929e-9,0,1,1,832169e-9,0,0,1,832178e-9,0,0,1,83231e-8,0,0,.999998,832893e-9,0,0,.999995,834465e-9,0,0,.999985,837791e-9,0,0,.999969,843893e-9,0,0,.999944,854086e-9,0,0,.999903,870071e-9,0,0,.999843,894042e-9,0,0,.999759,928865e-9,0,531805e-10,.999643,978242e-9,0,579365e-9,.99948,.00104684,0,.00182774,.999255,.00114012,0,.00387804,.998885,.00126188,0,.00675709,.997405,.00135888,0,.010468,.99424,.00133626,0,.0150018,.992458,.00140905,0,.0203443,.990929,.00152305,0,.0264786,.989116,.00165882,0,.0333875,.985624,.00174128,0,.0410536,.982003,.00182108,0,.0494609,.978336,.00194498,0,.0585941,.973184,.00202708,0,.0684396,.9678,.00212166,0,.0789851,.961348,.00221366,0,.0902199,.953841,.00228219,0,.102134,.94534,.00235662,0,.114721,.935552,.00240572,0,.127972,.924064,.00244405,0,.141884,.911827,.00247557,0,.156451,.897731,.00248374,0,.171672,.883409,.00249863,0,.187545,.868625,.00246688,0,.20407,.856529,.00246523,0,.221249,.842999,.00242368,0,.239083,.828505,.00237354,0,.257578,.813825,.00232588,0,.276738,.797813,.00226731,0,.296569,.781097,.00219704,0,.31708,.764038,.00212394,0,.338281,.746067,.00204786,0,.360181,.727687,.00196728,0,.382794,.709571,.00188779,0,.406133,.691503,.00180532,0,.430213,.673673,.00171849,0,.45505,.655732,.00164147,0,.480662,.637399,.00155858,0,.507065,.618616,.00147641,0,.534278,.60005,.00140125,0,.562313,.581713,.00132441,0,.59118,.563546,.00125014,0,.620875,.545605,.00118249,0,.651373,.527559,.0011116,0,.682593,.509764,.00104979,0,.714286,.49193,985977e-9,0,.746032,.475011,928592e-9,0,.777778,.457878,873466e-9,0,.809524,.440979,819585e-9,0,.84127,.424613,772365e-9,0,.873016,.408549,722195e-9,0,.904762,.392771,680014e-9,0,.936508,.377317,636797e-9,0,.968254,.362352,598318e-9,0,1,1,.00114313,0,0,1,.00114314,0,0,.999999,.00114331,0,0,.999998,.00114404,0,0,.999994,.00114601,0,0,.999984,.00115019,0,0,.999967,.00115784,0,0,.999937,.0011706,0,0,.999894,.00119054,0,0,.999828,.00122031,0,0,.999735,.00126331,0,169263e-9,.999606,.00132382,0,949167e-9,.999426,.0014071,0,.00249668,.999173,.00151895,0,.00486392,.99873,.00166102,0,.00806323,.996243,.0017023,0,.0120895,.993779,.00172782,0,.0169288,.9919,.0018108,0,.0225633,.990524,.00196028,0,.028974,.98868,.00212014,0,.036142,.984663,.00217598,0,.044049,.981457,.00230563,0,.0526781,.977608,.00243966,0,.0620137,.972215,.00251336,0,.0720418,.966798,.0026285,0,.0827499,.960241,.00271409,0,.0941271,.952489,.00278381,0,.106164,.944127,.00285399,0,.118852,.934282,.00290994,0,.132185,.923271,.00294558,0,.146157,.910803,.00296269,0,.160766,.896705,.00296803,0,.176007,.88238,.00296637,0,.19188,.867116,.00293163,0,.208385,.853636,.00289418,0,.225523,.840469,.00284663,0,.243296,.82639,.00278594,0,.261709,.811759,.00271618,0,.280767,.796113,.00263187,0,.300476,.779518,.00254589,0,.320845,.763142,.00246003,0,.341883,.745464,.00236529,0,.363601,.727491,.00226536,0,.386011,.709414,.00216375,0,.409128,.691396,.00207127,0,.432967,.67368,.00197106,0,.457545,.656049,.00187022,0,.482881,.638188,.00177605,0,.508992,.620177,.00168482,0,.535899,.601506,.00158909,0,.563619,.58362,.00150583,0,.592165,.565496,.00141791,0,.621544,.54789,.00133693,0,.651743,.530323,.00126038,0,.682709,.512795,.00118556,0,.714286,.495199,.00111527,0,.746032,.478101,.0010489,0,.777778,.461511,984264e-9,0,.809524,.444879,92591e-8,0,.84127,.428424,866582e-9,0,.873016,.412495,814463e-9,0,.904762,.396975,764498e-9,0,.936508,.381614,715967e-9,0,.968254,.366732,672483e-9,0,1,1,.00155501,0,0,1,.00155503,0,0,1,.00155524,0,0,.999998,.00155615,0,0,.999994,.0015586,0,0,.999983,.00156379,0,0,.999963,.0015733,0,0,.999932,.00158911,0,0,.999882,.00161376,0,0,.99981,.00165041,0,100875e-10,.999708,.00170304,0,367658e-9,.999565,.00177658,0,.0014234,.999368,.00187688,0,.00327939,.999081,.00200989,0,.00596629,.99852,.00217177,0,.0094852,.99549,.0021745,0,.013824,.993252,.00222357,0,.0189642,.991727,.00235022,0,.0248856,.989951,.00250561,0,.0315669,.988029,.00268829,0,.0389882,.984029,.0027496,0,.0471302,.980683,.00289793,0,.0559754,.976554,.00303315,0,.0655081,.97139,.00313257,0,.0757138,.965544,.00323656,0,.08658,.95912,.00333432,0,.0980954,.951183,.0034039,0,.110251,.942974,.00347515,0,.123038,.932642,.00350381,0,.13645,.922158,.00354519,0,.150482,.909404,.00353851,0,.165129,.896071,.0035435,0,.18039,.881206,.00349936,0,.196263,.866077,.00347256,0,.212748,.85093,.003415,0,.229847,.837703,.00333367,0,.247561,.823878,.003249,0,.265895,.809449,.00316347,0,.284854,.794379,.00306351,0,.304445,.778138,.0029499,0,.324675,.761997,.00284099,0,.345555,.744938,.00272104,0,.367095,.727212,.00260715,0,.389309,.709549,.00248855,0,.41221,.691704,.00236783,0,.435814,.673689,.00225178,0,.460138,.656453,.00213765,0,.485203,.639128,.00202178,0,.511028,.621512,.00191443,0,.537634,.603598,.00180977,0,.565041,.58559,.00170456,0,.593268,.567852,.00160927,0,.622327,.5503,.00151395,0,.652217,.533033,.00142499,0,.682907,.515942,.00133955,0,.714296,.498814,.0012602,0,.746032,.481595,.00118188,0,.777778,.465117,.00111171,0,.809524,.448865,.00104091,0,.84127,.432711,976618e-9,0,.873016,.416822,91859e-8,0,.904762,.401272,857704e-9,0,.936508,.386226,807172e-9,0,.968254,.371321,75464e-8,0,1,1,.00209596,0,0,1,.00209598,0,0,1,.00209624,0,0,.999997,.00209736,0,0,.999991,.00210039,0,0,.999979,.00210678,0,0,.999959,.00211847,0,0,.999925,.0021379,0,0,.99987,.00216809,0,0,.999791,.00221281,0,681487e-10,.999677,.00227669,0,658161e-9,.999521,.00236533,0,.00200635,.999301,.00248514,0,.0041779,.998977,.00264185,0,.00718648,.998191,.00281695,0,.0110239,.994801,.00278518,0,.015672,.993091,.00288774,0,.0211091,.991571,.00303931,0,.0273123,.9897,.00321643,0,.034259,.987023,.00337332,0,.0419282,.983289,.00346146,0,.0502998,.979892,.00363704,0,.0593562,.975111,.00373601,0,.069081,.970351,.0038842,0,.0794598,.964131,.00397053,0,.0904798,.957747,.00408078,0,.10213,.949536,.00413533,0,.1144,.941372,.00420305,0,.127284,.931049,.00422815,0,.140772,.920647,.00425048,0,.154862,.908033,.0042281,0,.169548,.895028,.00422026,0,.184828,.879968,.00415042,0,.200701,.864875,.00408821,0,.217167,.84918,.00400909,0,.234227,.834934,.00391178,0,.251884,.821397,.00380066,0,.270141,.807135,.00367974,0,.289004,.792363,.00355172,0,.308479,.776661,.003411,0,.328575,.760705,.00328123,0,.349301,.744408,.00314003,0,.370668,.726994,.0029906,0,.392689,.709598,.00285034,0,.415379,.692112,.00271179,0,.438754,.674435,.00257185,0,.46283,.65676,.00243425,0,.48763,.639982,.00230351,0,.513173,.622983,.0021777,0,.539482,.605471,.00204991,0,.566579,.58796,.00193759,0,.594488,.570463,.00181976,0,.623226,.553058,.00171497,0,.6528,.535894,.00161109,0,.683198,.519089,.00151394,0,.714354,.502454,.00142122,0,.746032,.485681,.00133488,0,.777778,.468935,.00124975,0,.809524,.452951,.00117309,0,.84127,.437139,.00110155,0,.873016,.421446,.00103124,0,.904762,.405951,966387e-9,0,.936508,.391003,908119e-9,0,.968254,.376198,848057e-9,0,1,1,.00280076,0,0,1,.00280078,0,0,.999999,.00280109,0,0,.999997,.00280246,0,0,.999992,.00280616,0,0,.999979,.00281396,0,0,.999956,.00282822,0,0,.999916,.00285186,0,0,.999857,.0028885,0,0,.999768,.00294259,0,196026e-9,.999645,.00301946,0,.00104842,.99947,.00312541,0,.00270199,.999229,.00326733,0,.00519449,.998852,.00344992,0,.00852602,.997558,.00361052,0,.0126804,.994417,.0035898,0,.017635,.992824,.00372393,0,.023365,.991344,.00390695,0,.0298456,.989337,.00410392,0,.0370529,.985811,.00420987,0,.0449651,.982772,.00437488,0,.0535615,.979001,.00455069,0,.0628243,.974102,.00464462,0,.0727368,.969197,.00480577,0,.0832844,.962759,.00487818,0,.0944545,.956207,.00498176,0,.106236,.947909,.00503392,0,.118619,.939596,.00507474,0,.131595,.929642,.00509798,0,.145159,.918807,.00508476,0,.159305,.906921,.00505634,0,.174028,.893312,.00498845,0,.189327,.878933,.0049133,0,.2052,.863986,.0048259,0,.221647,.847936,.00470848,0,.23867,.832253,.00456889,0,.25627,.818619,.00442726,0,.274453,.804788,.00427677,0,.293222,.790241,.00411906,0,.312585,.775162,.00394833,0,.33255,.759463,.00377366,0,.353126,.743598,.00361026,0,.374324,.72697,.00343627,0,.396158,.709646,.00326422,0,.418641,.69277,.00309717,0,.44179,.675371,.0029356,0,.465624,.657863,.00277712,0,.490163,.640772,.00261738,0,.515429,.624441,.0024737,0,.541445,.607497,.00233125,0,.568236,.590438,.00218994,0,.595828,.573224,.0020664,0,.624242,.556168,.00193526,0,.653496,.539232,.00182463,0,.683588,.522352,.00170735,0,.714482,.506172,.00160555,0,.746032,.489842,.00150451,0,.777778,.473463,.00140938,0,.809524,.457266,.00132568,0,.84127,.441609,.0012376,0,.873016,.426348,.00116265,0,.904762,.411002,.00108935,0,.936508,.396045,.00101946,0,.968254,.381448,955665e-9,0,1,1,.0037121,0,0,1,.00371213,0,0,1,.00371251,0,0,.999997,.00371417,0,0,.99999,.00371863,0,0,.999977,.00372807,0,0,.99995,.00374529,0,0,.999908,.0037738,0,0,.999843,.00381789,0,123596e-10,.999745,.00388273,0,407442e-9,.999608,.00397443,0,.0015447,.999415,.00409998,0,.00351385,.999143,.00426662,0,.0063316,.9987,.00447625,0,.00998679,.996363,.00455323,0,.0144569,.994021,.00461052,0,.0197151,.992372,.00476359,0,.0257344,.991007,.00499101,0,.0324882,.988767,.0051972,0,.0399517,.984872,.00528407,0,.0481022,.982004,.00548926,0,.0569191,.977714,.00564385,0,.0663839,.973076,.0057693,0,.0764801,.967565,.0058924,0,.0871928,.961384,.00599629,0,.0985095,.954435,.00605998,0,.110419,.946303,.0061133,0,.122912,.937662,.00612028,0,.13598,.927867,.00612209,0,.149617,.916475,.00604813,0,.163817,.90541,.00603088,0,.178577,.891591,.00592218,0,.193894,.877573,.00578854,0,.209767,.862511,.00566648,0,.226196,.846861,.00551481,0,.243182,.83068,.00533754,0,.260728,.815725,.00515487,0,.278837,.802321,.0049655,0,.297515,.787826,.00475421,0,.316768,.773454,.00456002,0,.336605,.758224,.00434727,0,.357034,.74265,.00414444,0,.378067,.726729,.00393738,0,.399717,.710155,.00373575,0,.421998,.693312,.00353736,0,.444928,.67653,.00334368,0,.468523,.659444,.00315981,0,.492806,.642051,.00297809,0,.517798,.625758,.00280592,0,.543525,.609615,.00264254,0,.570012,.592919,.00248459,0,.597288,.576298,.00233327,0,.625379,.559489,.00219519,0,.654307,.542891,.00205441,0,.684084,.526255,.00193385,0,.714693,.509853,.00180745,0,.746044,.494131,.00169817,0,.777778,.478114,.0015913,0,.809524,.462274,.00148981,0,.84127,.446412,.00139537,0,.873016,.431274,.00130984,0,.904762,.41635,.00122403,0,.936508,.401476,.00114809,0,.968254,.386993,.00107563,0,1,1,.00488216,0,0,1,.0048822,0,0,1,.00488265,0,0,.999997,.00488463,0,0,.999988,.00488999,0,0,.999974,.00490129,0,0,.999946,.00492191,0,0,.999897,.00495598,0,0,.999825,.00500855,0,744791e-10,.999718,.00508559,0,712744e-9,.999565,.005194,0,.00215249,.999352,.00534147,0,.00444576,.999046,.00553523,0,.00759218,.998492,.00577016,0,.0115714,.995564,.00578487,0,.0163557,.993339,.00586414,0,.021915,.991834,.00606002,0,.0282201,.990496,.00633312,0,.0352433,.987826,.00651941,0,.042959,.98383,.00660842,0,.0513439,.98109,.00685523,0,.0603772,.976131,.00695778,0,.0700402,.971922,.00714236,0,.0803163,.965901,.00721437,0,.0911908,.959606,.00732017,0,.102651,.952504,.00735788,0,.114686,.944365,.00738493,0,.127286,.935652,.00737969,0,.140443,.925813,.00733612,0,.154151,.914397,.00723094,0,.168405,.903257,.00714002,0,.183201,.890015,.00700149,0,.198536,.876014,.00682813,0,.214409,.861436,.00665567,0,.23082,.845752,.00644526,0,.24777,.829169,.00621635,0,.265263,.813435,.00597789,0,.283301,.799701,.00575694,0,.301889,.785726,.00549866,0,.321035,.77152,.0052503,0,.340746,.75683,.00499619,0,.361032,.741951,.0047543,0,.381904,.726367,.0045084,0,.403374,.710537,.00426784,0,.425457,.693965,.00403487,0,.448169,.677724,.0038075,0,.47153,.66117,.00359431,0,.495561,.644274,.00338354,0,.520284,.627449,.00318163,0,.545725,.611645,.00299672,0,.571911,.595614,.00281016,0,.598873,.579426,.00264252,0,.62664,.563016,.00247509,0,.655239,.546728,.00232647,0,.684692,.530539,.00217803,0,.714999,.514164,.00204216,0,.746106,.498344,.00191403,0,.777778,.482957,.00179203,0,.809524,.467336,.00167695,0,.84127,.451994,.00157567,0,.873016,.436514,.00147113,0,.904762,.42178,.00138034,0,.936508,.407271,.00129219,0,.968254,.392822,.0012098,0,1,1,.00637427,0,0,1,.00637431,0,0,.999999,.00637485,0,0,.999996,.00637721,0,0,.999987,.00638357,0,0,.999971,.006397,0,0,.999939,.00642142,0,0,.999888,.00646177,0,0,.999807,.00652387,0,207916e-9,.999689,.00661454,0,.00112051,.99952,.00674155,0,.00287719,.999283,.00691313,0,.00550145,.998936,.00713598,0,.00897928,.998165,.00738501,0,.0132829,.994847,.00734388,0,.01838,.993182,.00749991,0,.0242381,.991665,.0077246,0,.030826,.989708,.00797579,0,.0381152,.986663,.00813011,0,.0460794,.983288,.00830365,0,.0546951,.980104,.00853496,0,.0639411,.974855,.00861045,0,.0737988,.97045,.00879133,0,.0842516,.964509,.00886377,0,.0952848,.957594,.00890346,0,.106886,.950546,.00893289,0,.119044,.942225,.00890074,0,.131749,.933365,.00886826,0,.144994,.923202,.0087316,0,.158772,.912605,.00863082,0,.173078,.901099,.00847403,0,.187908,.888177,.00825838,0,.203261,.873955,.00801834,0,.219134,.860091,.00779026,0,.235527,.84434,.00752478,0,.252443,.828517,.00724074,0,.269883,.81239,.00693769,0,.287851,.79721,.00664817,0,.306352,.783489,.00634763,0,.325393,.769514,.00604221,0,.344981,.755419,.00573568,0,.365126,.741083,.00544359,0,.385839,.726059,.00515515,0,.407132,.710809,.00487139,0,.42902,.695052,.00459846,0,.45152,.678886,.00433412,0,.474651,.663042,.00407981,0,.498433,.646634,.00384264,0,.52289,.630117,.00360897,0,.548048,.613804,.00338863,0,.573936,.598338,.00318486,0,.600584,.582687,.00298377,0,.628027,.566809,.00280082,0,.656295,.550817,.00262255,0,.685417,.534937,.00245835,0,.715406,.519151,.00230574,0,.74624,.503118,.0021549,0,.777778,.487723,.00202008,0,.809524,.472725,.00189355,0,.84127,.457599,.00177108,0,.873016,.442558,.00165843,0,.904762,.427624,.00155494,0,.936508,.413171,.00145273,0,.968254,.399122,.00136454,0,1,1,.00826496,0,0,1,.00826499,0,0,1,.00826564,0,0,.999996,.00826842,0,0,.999987,.00827589,0,0,.999967,.00829167,0,0,.999933,.00832037,0,0,.999876,.00836768,0,109338e-10,.999786,.00844031,0,427145e-9,.999655,.00854603,0,.0016384,.999468,.00869337,0,.00372392,.999203,.008891,0,.00668513,.998803,.00914387,0,.0104968,.99748,.00935838,0,.015125,.994446,.00933309,0,.0205338,.99292,.00953084,0,.0266884,.991414,.0097893,0,.0335565,.989049,.0100228,0,.0411086,.98582,.0101664,0,.0493181,.982441,.0103582,0,.0581613,.978595,.0105292,0,.0676169,.973495,.0106274,0,.0776661,.968405,.0107261,0,.0882926,.962717,.0108234,0,.0994817,.955478,.0108102,0,.111221,.948275,.0107914,0,.123499,.940006,.0107161,0,.136308,.930831,.0106309,0,.149639,.920648,.0104083,0,.163485,.910205,.0102312,0,.177843,.898445,.0100051,0,.192707,.885986,.00971928,0,.208077,.872204,.00940747,0,.22395,.858436,.0091085,0,.240326,.843454,.00876595,0,.257208,.827437,.00839794,0,.274596,.811488,.00803692,0,.292496,.796039,.00767352,0,.310911,.781083,.0073097,0,.329849,.767642,.00694032,0,.349316,.753901,.00657476,0,.369323,.740131,.00622699,0,.38988,.725845,.0058838,0,.410999,.710991,.00555586,0,.432696,.696002,.00523089,0,.454987,.680461,.00492494,0,.47789,.664875,.00463464,0,.501426,.649273,.00435422,0,.52562,.63302,.0040875,0,.550498,.61705,.00384075,0,.576089,.601154,.00359557,0,.602427,.586008,.00337636,0,.629544,.570699,.00316019,0,.657479,.555166,.00296033,0,.686264,.539645,.00277552,0,.715924,.524159,.00259499,0,.746459,.508682,.00243257,0,.777789,.493163,.00227851,0,.809524,.478004,.00213083,0,.84127,.46347,.00199502,0,.873016,.448778,.00186967,0,.904762,.434105,.00174732,0,.936508,.419576,.00163861,0,.968254,.405541,.00153341,0,1,1,.0106462,0,0,1,.0106462,0,0,.999999,.010647,0,0,.999995,.0106502,0,0,.999985,.0106589,0,0,.999964,.0106773,0,0,.999925,.0107106,0,0,.999861,.0107655,0,712986e-10,.999763,.0108497,0,743959e-9,.999616,.0109716,0,.00227361,.999408,.0111408,0,.0046983,.999112,.0113659,0,.00800158,.998637,.0116475,0,.0121493,.996223,.0117231,0,.0171023,.994006,.0118064,0,.0228218,.992444,.0120254,0,.0292711,.991028,.0123314,0,.036417,.98803,.0124954,0,.0442295,.984816,.0126538,0,.0526815,.981399,.0128537,0,.0617492,.977085,.0129694,0,.0714114,.972154,.013091,0,.0816495,.966617,.0131166,0,.0924472,.960628,.0131583,0,.10379,.953295,.0131094,0,.115665,.94575,.0129966,0,.128062,.937654,.0128796,0,.140972,.927716,.0126477,0,.154387,.917932,.0123889,0,.168301,.907719,.012131,0,.182709,.89584,.0118013,0,.197608,.883526,.0114145,0,.212994,.870301,.0110075,0,.228867,.856272,.0106019,0,.245227,.842251,.0101938,0,.262074,.826466,.00973254,0,.279412,.810859,.0092846,0,.297244,.795051,.00883304,0,.315575,.780053,.00840272,0,.334412,.76575,.00796438,0,.35376,.752298,.00752526,0,.373631,.739153,.00711486,0,.394034,.725514,.00670361,0,.414983,.711473,.00632656,0,.436491,.696936,.00595206,0,.458575,.682126,.00559191,0,.481253,.667027,.00525362,0,.504547,.651875,.00493805,0,.528481,.636463,.00462848,0,.553081,.620641,.00433936,0,.578377,.604931,.00407,0,.604404,.589549,.00380864,0,.631197,.574712,.00357049,0,.658795,.559775,.00334466,0,.687238,.544514,.00312505,0,.716559,.529555,.00293199,0,.746776,.514402,.00274204,0,.777849,.499302,.00256647,0,.809524,.484114,.00239901,0,.84127,.469308,.00225148,0,.873016,.455133,.00210178,0,.904762,.440939,.0019727,0,.936508,.426627,.00184382,0,.968254,.412509,.00172548,0,1,1,.013628,0,0,1,.0136281,0,0,.999999,.0136289,0,0,.999995,.0136327,0,0,.999983,.0136427,0,0,.99996,.0136638,0,0,.999917,.0137022,0,0,.999846,.0137652,0,204597e-9,.999736,.0138615,0,.00116837,.999573,.0140007,0,.00303325,.99934,.0141927,0,.00580613,.999004,.0144457,0,.00945626,.998407,.0147489,0,.0139421,.995464,.014731,0,.0192202,.993328,.0148283,0,.0252495,.991799,.0150797,0,.0319921,.990397,.0154316,0,.0394138,.986835,.0155005,0,.0474843,.983938,.0157308,0,.0561763,.980154,.0158753,0,.0654661,.975659,.0159581,0,.0753326,.970171,.0159832,0,.0857571,.964803,.0160084,0,.0967236,.958366,.0159484,0,.108218,.950613,.0158001,0,.120227,.942874,.0155845,0,.132741,.935005,.0154292,0,.145751,.924991,.0150742,0,.159249,.914814,.0146757,0,.17323,.904743,.0143097,0,.187687,.893216,.0138695,0,.202619,.880769,.0133706,0,.218021,.868136,.0128606,0,.233894,.85469,.0123403,0,.250238,.840593,.0118091,0,.267052,.825808,.011253,0,.284341,.81009,.0107099,0,.302106,.79504,.0101636,0,.320354,.779757,.00964041,0,.33909,.764697,.00911896,0,.358322,.750913,.00859533,0,.378059,.738175,.00811592,0,.398311,.725242,.00764504,0,.41909,.711864,.00718885,0,.440412,.698009,.00675843,0,.462292,.683841,.00634984,0,.484748,.669391,.00595502,0,.507802,.654731,.00558671,0,.531477,.639805,.00523578,0,.555802,.624789,.00490834,0,.580805,.609325,.00459448,0,.606522,.593975,.00430342,0,.63299,.578983,.00403019,0,.66025,.564442,.0037707,0,.688346,.549835,.0035316,0,.717319,.535039,.00330255,0,.7472,.520403,.00308932,0,.777982,.505687,.00289335,0,.809524,.490939,.00270818,0,.84127,.476233,.0025343,0,.873016,.461624,.00237097,0,.904762,.447833,.00222065,0,.936508,.433992,.00207561,0,.968254,.420147,.00194955,0,1,1,.0173415,0,0,1,.0173416,0,0,.999999,.0173426,0,0,.999995,.0173468,0,0,.999983,.0173582,0,0,.999954,.0173822,0,0,.999908,.0174258,0,669501e-11,.999828,.0174973,0,427399e-9,.999705,.0176063,0,.00171019,.999524,.0177631,0,.0039248,.999263,.0179781,0,.00705382,.998878,.018258,0,.0110552,.998012,.0185551,0,.0158812,.994614,.0184264,0,.0214852,.993132,.0186385,0,.0278239,.991563,.0189067,0,.0348585,.989298,.0191577,0,.0425544,.986036,.0192522,0,.050881,.982558,.0194063,0,.059811,.978531,.019486,0,.0693209,.974198,.0195847,0,.0793895,.968148,.0194749,0,.0899984,.962565,.0194277,0,.101132,.956041,.0192991,0,.112775,.947749,.0189893,0,.124917,.94018,.018704,0,.137547,.93165,.0183458,0,.150655,.921798,.0178775,0,.164236,.911573,.0173618,0,.178281,.901569,.0168482,0,.192788,.890341,.016265,0,.207752,.877835,.0156199,0,.223171,.865472,.0149516,0,.239044,.852905,.0143274,0,.255371,.838906,.0136643,0,.272153,.824888,.0129903,0,.289393,.809977,.0123218,0,.307093,.794697,.0116572,0,.325259,.780028,.0110307,0,.343896,.765124,.0104236,0,.363012,.750411,.0098219,0,.382617,.737264,.00924397,0,.402719,.724799,.00868719,0,.423332,.712253,.00816476,0,.444469,.699267,.00767262,0,.466146,.685618,.00719746,0,.488383,.671736,.00673916,0,.511199,.657777,.00631937,0,.534618,.643497,.00592411,0,.558668,.62889,.00553928,0,.58338,.614299,.0051934,0,.608787,.599197,.00485985,0,.634929,.584175,.00454357,0,.661849,.569541,.00425787,0,.689594,.555193,.00397905,0,.718211,.540947,.00372364,0,.747742,.526593,.00348599,0,.778205,.512335,.00326103,0,.80953,.498017,.00305137,0,.84127,.483609,.00285485,0,.873016,.469368,.00267472,0,.904762,.455037,.00249945,0,.936508,.441493,.00234792,0,.968254,.428147,.00219936,0,1,1,.0219422,0,0,1,.0219423,0,0,.999998,.0219434,0,0,.999993,.0219481,0,0,.999981,.021961,0,0,.999949,.0219879,0,0,.999896,.0220367,0,593194e-10,.999808,.0221167,0,75364e-8,.99967,.0222383,0,.00237884,.999466,.0224125,0,.00495612,.999174,.0226495,0,.00844887,.998725,.0229525,0,.0128058,.996979,.0231123,0,.0179742,.994317,.0230742,0,.0239047,.992781,.0232895,0,.0305526,.991191,.0235734,0,.0378786,.987787,.0236152,0,.0458475,.985092,.0237994,0,.0544287,.981121,.0238553,0,.0635952,.976924,.0238706,0,.0733233,.97218,.0238704,0,.0835922,.965956,.0236598,0,.0943839,.959998,.0234735,0,.105682,.953245,.0232277,0,.117474,.944445,.0226973,0,.129747,.937087,.0223527,0,.142491,.928341,.0218144,0,.155697,.9184,.0211516,0,.169358,.907959,.0204553,0,.183469,.89808,.0197673,0,.198024,.887047,.0189915,0,.21302,.875221,.0182082,0,.228455,.86269,.0173584,0,.244329,.850735,.0165718,0,.260639,.837545,.0157524,0,.277389,.823639,.0149482,0,.29458,.809699,.0141431,0,.312216,.794797,.0133527,0,.3303,.780578,.0126193,0,.34884,.766019,.0118914,0,.367842,.751447,.0111839,0,.387315,.737275,.010514,0,.40727,.724545,.00987277,0,.427717,.712644,.00926569,0,.448671,.700432,.00869029,0,.470149,.687664,.00814691,0,.492167,.674288,.00763012,0,.514746,.660966,.00714437,0,.537911,.647264,.00668457,0,.561688,.633431,.00626581,0,.586108,.619133,.00585593,0,.611206,.604935,.00548188,0,.637022,.590236,.00513288,0,.663599,.575473,.0047906,0,.690989,.561228,.00448895,0,.719242,.547054,.00420233,0,.748411,.533175,.00392869,0,.778531,.519163,.00367445,0,.809583,.505328,.00344097,0,.84127,.491446,.00322003,0,.873016,.477356,.00301283,0,.904762,.46356,.00282592,0,.936508,.449623,.00264956,0,.968254,.436068,.00246956,0,1,1,.0276135,0,0,1,.0276136,0,0,.999998,.0276148,0,0,.999993,.0276201,0,0,.999976,.0276342,0,0,.999945,.027664,0,0,.999884,.0277179,0,18679e-8,.999784,.027806,0,.00119607,.99963,.0279394,0,.00318407,.999401,.0281295,0,.00613601,.999066,.0283858,0,.00999963,.998524,.0287027,0,.0147164,.995702,.0286256,0,.0202295,.993593,.0286733,0,.0264876,.992067,.0288989,0,.0334452,.990548,.0292135,0,.0410621,.986775,.0291296,0,.0493032,.984054,.0293099,0,.0581381,.979481,.0291881,0,.0675397,.975297,.0291598,0,.0774848,.96981,.028954,0,.0879528,.963524,.028628,0,.0989258,.957398,.0283135,0,.110388,.950088,.0278469,0,.122327,.941538,.0271798,0,.134729,.933332,.0265388,0,.147587,.924392,.0257776,0,.160889,.914581,.024916,0,.174631,.904347,.0240242,0,.188806,.894324,.0231229,0,.203409,.883724,.022153,0,.218437,.872207,.0211355,0,.233888,.859927,.0201048,0,.249761,.848373,.0191263,0,.266056,.836023,.0181306,0,.282774,.82289,.0171718,0,.299917,.809324,.0162196,0,.317488,.795361,.0152622,0,.335493,.781253,.01439,0,.353936,.767338,.013533,0,.372825,.753156,.0127244,0,.392168,.739122,.0119454,0,.411976,.725358,.0112054,0,.432259,.712949,.010487,0,.453032,.701621,.00984032,0,.47431,.689703,.00921495,0,.496111,.677216,.00862492,0,.518456,.664217,.00806882,0,.541367,.65137,.00755922,0,.564872,.638,.00705705,0,.589001,.62453,.00661266,0,.613789,.610601,.00618432,0,.639277,.59676,.00578033,0,.66551,.582433,.00540927,0,.692539,.568026,.00506104,0,.720422,.55414,.0047353,0,.749216,.540178,.00442889,0,.778974,.526513,.00414363,0,.809711,.512954,.00388237,0,.84127,.499403,.00362875,0,.873016,.486026,.00340827,0,.904762,.472345,.00318598,0,.936508,.458828,.00297635,0,.968254,.445379,.00279447,0,1,1,.0345716,0,0,1,.0345717,0,0,.999999,.034573,0,0,.999991,.0345787,0,0,.999974,.0345941,0,0,.999937,.0346263,0,188589e-11,.999869,.0346847,0,409238e-9,.999757,.0347798,0,.0017674,.999582,.0349233,0,.00413658,.999322,.0351265,0,.00747408,.998939,.0353967,0,.0117157,.998219,.0357018,0,.0167966,.994974,.0354726,0,.0226572,.993201,.0355621,0,.0292445,.991573,.0357641,0,.0365123,.989301,.0359252,0,.0444203,.985712,.0358017,0,.0529334,.982411,.0358353,0,.0620214,.977827,.035617,0,.0716574,.973278,.0354398,0,.0818186,.967397,.0350483,0,.0924846,.960696,.0344795,0,.103638,.954349,.0339861,0,.115263,.946066,.0331323,0,.127348,.938012,.032359,0,.13988,.929413,.0314413,0,.152849,.920355,.0304103,0,.166248,.910586,.0292785,0,.18007,.900609,.0281391,0,.194308,.890093,.0269103,0,.208958,.880013,.0257269,0,.224018,.869001,.0244671,0,.239485,.85751,.0232252,0,.255359,.84582,.0220117,0,.271638,.834383,.0208274,0,.288324,.822158,.0196628,0,.305419,.809056,.0185306,0,.322927,.795832,.0174174,0,.340851,.782547,.0163758,0,.359199,.7689,.015391,0,.377975,.755526,.0144488,0,.397189,.741681,.0135372,0,.416851,.728178,.0126957,0,.436971,.714642,.0118812,0,.457564,.702756,.0111165,0,.478644,.69175,.0104145,0,.500229,.680159,.00974439,0,.522339,.668073,.00911926,0,.544997,.655405,.00851393,0,.56823,.642921,.00797637,0,.592068,.629993,.00745119,0,.616546,.616828,.00696972,0,.641705,.603305,.00652425,0,.66759,.589833,.00610188,0,.694255,.575945,.00570834,0,.72176,.561745,.00533384,0,.750168,.548277,.00500001,0,.779545,.534467,.00467582,0,.809933,.521032,.00438092,0,.841272,.507877,.00410348,0,.873016,.494654,.00383618,0,.904762,.481592,.00358699,0,.936508,.468509,.00337281,0,.968254,.455293,.00316196,0,1,1,.0430698,0,0,1,.0430699,0,0,.999998,.0430713,0,0,.999991,.0430773,0,0,.99997,.0430936,0,0,.999928,.0431277,0,406396e-10,.999852,.0431893,0,744376e-9,.999724,.0432895,0,.0024806,.999527,.0434397,0,.00524779,.99923,.0436507,0,.00898164,.998783,.0439255,0,.0136083,.997507,.0441104,0,.0190582,.994418,.0438225,0,.0252694,.992864,.0439396,0,.0321879,.991127,.0440962,0,.039767,.987331,.0438408,0,.0479667,.984819,.0438991,0,.056752,.980384,.0435906,0,.0660929,.975846,.0432543,0,.075963,.970748,.0428293,0,.0863398,.964303,.042153,0,.0972035,.95772,.0414111,0,.108537,.950747,.0405893,0,.120325,.942533,.0394887,0,.132554,.934045,.0383544,0,.145215,.924942,.037057,0,.158296,.915811,.0356993,0,.17179,.90612,.0342401,0,.185691,.896434,.0328078,0,.199993,.886021,.031288,0,.214691,.876081,.0297776,0,.229782,.865608,.0282334,0,.245265,.854924,.026749,0,.261138,.843607,.02526,0,.277401,.832456,.0238214,0,.294056,.821342,.0224682,0,.311104,.809303,.0211297,0,.328548,.796468,.0198387,0,.346394,.784046,.0186227,0,.364645,.771262,.0174561,0,.38331,.758118,.0163806,0,.402396,.745075,.0153287,0,.421912,.731926,.0143647,0,.44187,.71863,.0134363,0,.462283,.705414,.0125603,0,.483165,.693792,.0117508,0,.504535,.683108,.0110016,0,.52641,.67183,.0102757,0,.548816,.66015,.00962044,0,.571776,.647907,.00898031,0,.595323,.635734,.00840811,0,.619489,.623208,.00786211,0,.644317,.610438,.00734953,0,.669852,.597345,.00687688,0,.696148,.584138,.00643469,0,.723267,.5707,.00602236,0,.75128,.556966,.0056324,0,.780258,.543607,.00528277,0,.810268,.530213,.00493999,0,.841311,.516912,.00462265,0,.873016,.503916,.0043307,0,.904762,.491146,.00406858,0,.936508,.478439,.00381436,0,.968254,.465834,.00358003,0,1,1,.0534039,0,0,1,.053404,0,0,.999998,.0534055,0,0,.999989,.0534116,0,0,.999968,.0534283,0,0,.999918,.0534633,0,155895e-9,.99983,.0535262,0,.00120914,.999685,.0536281,0,.00334944,.999461,.0537799,0,.00653077,.999119,.0539902,0,.0106718,.998582,.0542524,0,.0156907,.995919,.0540318,0,.0215147,.993735,.0538914,0,.0280801,.992126,.0539557,0,.0353323,.990266,.0540401,0,.0432247,.986317,.0536064,0,.0517172,.983213,.0534425,0,.0607754,.978303,.0528622,0,.0703698,.973665,.0523363,0,.0804742,.968091,.0516165,0,.0910667,.961026,.0505434,0,.102128,.954333,.049523,0,.113641,.946372,.0481698,0,.125591,.938254,.0467674,0,.137965,.929516,.0452341,0,.150754,.920106,.0435083,0,.163947,.910899,.0417399,0,.177537,.901532,.0399389,0,.191516,.891919,.0380901,0,.205881,.882006,.0362341,0,.220626,.871965,.0343444,0,.235749,.862145,.0324832,0,.251248,.852058,.0306681,0,.267121,.84161,.0289097,0,.283368,.830806,.0272079,0,.299992,.820476,.0256089,0,.316992,.809514,.0240394,0,.334374,.797865,.0225379,0,.35214,.785621,.0211235,0,.370296,.773765,.0197908,0,.388849,.761629,.0185235,0,.407807,.748891,.0173358,0,.427178,.736437,.0162305,0,.446974,.723707,.0151778,0,.467207,.710606,.0141791,0,.487892,.698019,.0132592,0,.509046,.686203,.0123887,0,.530687,.675692,.0115976,0,.552839,.664826,.0108325,0,.575527,.65349,.0101348,0,.59878,.641774,.00947756,0,.622634,.629794,.00886058,0,.647128,.617647,.00828526,0,.672308,.60534,.00775312,0,.698231,.592718,.00726033,0,.724958,.579746,.00679731,0,.752563,.566763,.00636111,0,.781127,.553515,.00595228,0,.810733,.540118,.00556876,0,.841426,.527325,.00523051,0,.873016,.514265,.00490712,0,.904762,.501406,.00460297,0,.936508,.488922,.00431247,0,.968254,.476541,.0040472,0,1,1,.0659184,0,0,1,.0659185,0,0,.999998,.06592,0,0,.999988,.0659259,0,0,.999963,.0659423,0,0,.999907,.0659764,0,374198e-9,.999806,.0660376,0,.00182071,.999639,.0661361,0,.0043894,.999378,.0662814,0,.00800055,.998985,.0664779,0,.0125594,.998285,.0666914,0,.0179786,.995071,.0661989,0,.0241822,.993172,.0660454,0,.031106,.991438,.0660105,0,.0386952,.988428,.0656875,0,.0469032,.985218,.0652913,0,.0556905,.981128,.0647107,0,.065023,.976015,.0638491,0,.0748717,.97097,.062993,0,.0852112,.964582,.0617927,0,.0960199,.957383,.0603626,0,.107279,.949969,.0588128,0,.118971,.941843,.0570274,0,.131084,.933624,.0551885,0,.143604,.924543,.053122,0,.156521,.914919,.0508897,0,.169825,.905773,.0486418,0,.18351,.896434,.0463364,0,.197569,.887195,.0440623,0,.211997,.877706,.0417799,0,.226789,.867719,.03945,0,.241944,.858587,.037243,0,.257458,.849317,.0350956,0,.273331,.839585,.0329852,0,.289563,.829856,.0310028,0,.306154,.819589,.0290953,0,.323108,.809714,.0272738,0,.340426,.79934,.0255631,0,.358113,.788224,.0239175,0,.376175,.776619,.0223831,0,.394616,.76521,.0209298,0,.413445,.753716,.0195786,0,.432671,.741564,.0183001,0,.452305,.729413,.0171259,0,.472358,.717146,.0159933,0,.492845,.70436,.0149495,0,.513783,.69219,.0139681,0,.535189,.680289,.0130577,0,.557087,.669611,.0122198,0,.5795,.659113,.0114174,0,.602459,.648148,.0106729,0,.625997,.636905,.00998997,0,.650154,.625154,.00934313,0,.674976,.613481,.00874839,0,.700518,.60154,.00818265,0,.726845,.58943,.00766889,0,.754032,.576828,.00717153,0,.782167,.564194,.00672696,0,.811344,.551501,.00630863,0,.841644,.538635,.00592177,0,.873016,.525724,.00554888,0,.904762,.513209,.00520225,0,.936508,.500457,.00488231,0,.968254,.48799,.00457153,0,1,1,.0810131,0,0,1,.0810133,0,0,.999997,.0810145,0,0,.999985,.08102,0,0,.999956,.0810347,0,195026e-10,.999893,.0810656,0,719316e-9,.999777,.0811205,0,.00259774,.999583,.081208,0,.00561807,.999281,.0813343,0,.00967472,.998813,.0814969,0,.0146627,.997597,.0815217,0,.0204902,.994379,.0808502,0,.0270802,.992744,.0806792,0,.0343674,.990745,.0804589,0,.0422974,.986646,.0796107,0,.0508242,.983611,.0790913,0,.0599087,.978869,.0780746,0,.0695175,.973475,.0768218,0,.0796223,.967845,.0754926,0,.0901983,.960778,.0737063,0,.101224,.953333,.0718052,0,.112682,.945274,.0695946,0,.124555,.936955,.0672492,0,.136831,.928319,.0647732,0,.149496,.919075,.0620947,0,.162542,.909114,.0591816,0,.175958,.900137,.0563917,0,.189739,.891069,.0535392,0,.203877,.882262,.0507642,0,.218368,.873232,.0479793,0,.233208,.864042,.045226,0,.248393,.855002,.0425413,0,.263923,.846569,.0400126,0,.279796,.837714,.0375269,0,.296012,.828918,.0352027,0,.312573,.819783,.0330011,0,.329479,.810129,.0308908,0,.346734,.800866,.0289112,0,.364342,.79093,.0270255,0,.382307,.780593,.0252758,0,.400637,.769511,.0236178,0,.419337,.758558,.0220652,0,.438418,.747632,.0206289,0,.457889,.736146,.0192873,0,.477761,.724093,.0180333,0,.49805,.71234,.0168264,0,.51877,.700201,.015746,0,.53994,.687949,.0147027,0,.561581,.676163,.0137512,0,.583718,.665001,.0128655,0,.60638,.65472,.0120366,0,.629599,.644213,.0112604,0,.653415,.633382,.0105413,0,.677874,.62212,.00986498,0,.70303,.610631,.00923308,0,.728948,.599078,.00864206,0,.755706,.587519,.00811784,0,.783396,.575505,.00761237,0,.812121,.563148,.00713949,0,.841989,.550828,.00668379,0,.873035,.538458,.00627715,0,.904762,.525905,.00588336,0,.936508,.513517,.00552687,0,.968254,.501395,.00519681,0,1,1,.0991506,0,0,1,.0991504,0,0,.999996,.0991515,0,0,.999984,.0991558,0,0,.999947,.0991672,0,114389e-9,.999874,.0991912,0,.00121503,.999739,.0992331,0,.00356108,.999514,.0992983,0,.00705578,.999159,.0993877,0,.011574,.998586,.0994837,0,.017003,.995731,.0988425,0,.0232484,.993384,.098276,0,.0302318,.991615,.0979269,0,.0378884,.989029,.0973432,0,.0461641,.985373,.0963539,0,.0550136,.981278,.0952306,0,.0643988,.975777,.0936233,0,.0742868,.970526,.0920219,0,.0846501,.963755,.0898912,0,.0954644,.956676,.0876064,0,.106709,.948099,.0847751,0,.118367,.939718,.0818638,0,.130423,.931305,.078857,0,.142862,.922342,.0756127,0,.155674,.912842,.0721473,0,.168849,.903304,.0686195,0,.182378,.89411,.0650589,0,.196255,.885512,.0616022,0,.210473,.877193,.0582434,0,.225027,.86877,.0548979,0,.239915,.860267,.0516095,0,.255132,.851915,.048468,0,.270678,.843912,.0454447,0,.286551,.83604,.0425612,0,.302751,.828245,.0398752,0,.31928,.820159,.0373198,0,.336138,.81167,.034916,0,.35333,.802659,.0326402,0,.370858,.793921,.0304901,0,.388728,.784713,.0284857,0,.406944,.774946,.0266186,0,.425515,.76448,.0248593,0,.444449,.753793,.0232114,0,.463756,.743506,.0217039,0,.483447,.732555,.0202841,0,.503535,.720965,.0189648,0,.524036,.709422,.0177189,0,.544968,.697756,.0165626,0,.56635,.685565,.015483,0,.588208,.673987,.0144892,0,.610569,.66244,.0135607,0,.633466,.651675,.0126956,0,.656936,.641598,.0118788,0,.681025,.63121,.0111261,0,.705788,.620514,.010437,0,.731289,.609366,.00978747,0,.757606,.598137,.00917257,0,.784834,.586966,.00859778,0,.813085,.575549,.00806803,0,.842485,.563797,.00757294,0,.87313,.551758,.00710592,0,.904762,.539894,.0066841,0,.936508,.527901,.00627901,0,.968254,.515819,.00590506,0,1,1,.120864,0,0,1,.120864,0,0,.999996,.120864,0,0,.99998,.120867,0,0,.99994,.120872,0,323781e-9,.999852,.120884,0,.00188693,.999693,.120903,0,.00473489,.999426,.120929,0,.00872704,.999002,.120955,0,.0137237,.998235,.120918,0,.0196068,.994608,.119764,0,.0262803,.992997,.119265,0,.0336657,.990968,.11863,0,.0416987,.987002,.117261,0,.0503261,.983524,.116009,0,.0595035,.97875,.114252,0,.0691935,.972652,.11193,0,.0793645,.966613,.109555,0,.0899894,.959275,.106612,0,.101045,.951272,.103375,0,.112512,.942323,.0996594,0,.124372,.933679,.0958841,0,.136611,.924822,.0919265,0,.149216,.915742,.0878061,0,.162176,.906348,.0834894,0,.175482,.896883,.079085,0,.189125,.88774,.0746745,0,.203098,.87986,.0705773,0,.217396,.871998,.0665005,0,.232015,.864325,.0625413,0,.24695,.856685,.0586781,0,.2622,.84925,.0550063,0,.277761,.841719,.0514727,0,.293634,.834755,.0481398,0,.309819,.827853,.0450172,0,.326315,.820888,.0420969,0,.343126,.813616,.0393702,0,.360254,.805767,.0367771,0,.377701,.797338,.0343274,0,.395474,.789122,.0320529,0,.413577,.780601,.0299485,0,.432018,.771424,.0279812,0,.450804,.761502,.0261054,0,.469944,.751166,.0243942,0,.489451,.741276,.0228087,0,.509337,.730898,.0213265,0,.529617,.719878,.0199307,0,.550307,.708379,.0186574,0,.571428,.697165,.0174446,0,.593003,.685554,.0163144,0,.615059,.673631,.015276,0,.637628,.662385,.0143003,0,.660746,.651059,.0134112,0,.68446,.640451,.0125794,0,.70882,.630536,.011793,0,.733893,.620316,.0110547,0,.759756,.609722,.0103668,0,.786505,.598804,.00973009,0,.814259,.587871,.00912812,0,.843157,.577121,.00858916,0,.87334,.566019,.00807333,0,.904762,.554664,.00759687,0,.936508,.543101,.00714759,0,.968254,.531558,.00673418,0,1,1,.146767,0,0,1,.146767,0,0,.999997,.146767,0,0,.999977,.146765,0,320658e-11,.999929,.146762,0,682576e-9,.999823,.146753,0,.00276402,.999633,.146735,0,.00614771,.999314,.146699,0,.0106613,.998796,.14662,0,.0161546,.997124,.146107,0,.0225063,.994062,.144857,0,.0296198,.992154,.144011,0,.037417,.989186,.142712,0,.0458348,.985279,.140926,0,.0548211,.980826,.13885,0,.0643326,.975056,.136168,0,.074333,.969005,.133217,0,.0847917,.961554,.12959,0,.0956828,.954206,.125886,0,.106984,.945046,.121335,0,.118675,.935678,.116492,0,.130741,.926748,.111635,0,.143166,.917764,.106625,0,.155939,.908358,.101325,0,.169049,.899219,.0960249,0,.182487,.890089,.0906527,0,.196245,.881488,.0853905,0,.210317,.874031,.0804177,0,.224697,.866932,.0756005,0,.23938,.859976,.0709019,0,.254364,.853375,.0664391,0,.269646,.846971,.0622012,0,.285223,.840483,.058129,0,.301096,.833969,.0542762,0,.317265,.82806,.0507042,0,.333729,.822128,.047368,0,.350491,.815989,.044272,0,.367554,.809336,.0413444,0,.38492,.802177,.038601,0,.402594,.79441,.0360227,0,.420582,.786573,.0336383,0,.438891,.778619,.0314321,0,.457527,.77,.029362,0,.476499,.760698,.0274102,0,.49582,.750932,.0256146,0,.5155,.740993,.023974,0,.535555,.731159,.0224182,0,.556,.720836,.0209889,0,.576855,.709913,.0196411,0,.598143,.698415,.0183824,0,.619888,.68745,.0172222,0,.642123,.676154,.0161509,0,.664883,.664383,.0151397,0,.688211,.6533,.0141873,0,.71216,.642072,.0133105,0,.736792,.631412,.0124932,0,.762186,.621622,.0117408,0,.788439,.611681,.0110358,0,.815672,.60142,.0103775,0,.844034,.59083,.00975623,0,.873699,.580254,.00918084,0,.904765,.569841,.00864721,0,.936508,.559224,.00815731,0,.968254,.548315,.00767924,0,1,1,.177563,0,0,1,.177563,0,0,.999994,.177562,0,0,.999972,.177555,0,664171e-10,.999914,.177536,0,.0012276,.999787,.177496,0,.00388025,.999556,.17742,0,.00783463,.999165,.177285,0,.0128953,.9985,.177037,0,.0189053,.995388,.175634,0,.025742,.993102,.174375,0,.033309,.990992,.173121,0,.0415298,.986932,.170896,0,.0503425,.982786,.16847,0,.0596964,.977592,.165455,0,.0695498,.971075,.161676,0,.0798676,.963967,.157458,0,.0906201,.956397,.152836,0,.101783,.947489,.147467,0,.113333,.937564,.14145,0,.125254,.928182,.135383,0,.137529,.919027,.129212,0,.150144,.909618,.12276,0,.163088,.900492,.116273,0,.176351,.891671,.1098,0,.189924,.883146,.103362,0,.203799,.875151,.0970799,0,.21797,.868338,.0911732,0,.232433,.862033,.0854966,0,.247182,.856107,.0800691,0,.262216,.850644,.0749618,0,.27753,.845261,.070079,0,.293124,.839885,.0654321,0,.308997,.834609,.0610975,0,.325149,.829083,.0569741,0,.341581,.82404,.0531736,0,.358294,.818968,.049665,0,.37529,.813496,.0463856,0,.392573,.807533,.0433217,0,.410148,.80099,.0404402,0,.428019,.793891,.0377578,0,.446192,.786281,.0352616,0,.464676,.778773,.0329577,0,.483478,.770737,.030808,0,.502608,.762094,.0287964,0,.522079,.752898,.0269254,0,.541905,.743306,.0251926,0,.5621,.733416,.023595,0,.582684,.723742,.0221155,0,.603677,.713542,.0207435,0,.625106,.702755,.019434,0,.646998,.691484,.0182046,0,.66939,.680531,.0170771,0,.692324,.66953,.0160339,0,.715849,.658126,.0150677,0,.740028,.646933,.0141551,0,.764937,.636107,.0133179,0,.790673,.625271,.0125284,0,.817358,.615225,.0117937,0,.84515,.605678,.0111181,0,.874244,.59583,.0104759,0,.904828,.585704,.00986672,0,.936508,.575413,.00929712,0,.968254,.565373,.00876713,0,1,1,.214058,0,0,.999999,.214058,0,0,.999994,.214055,0,0,.999966,.214039,0,259642e-9,.999893,.213998,0,.00200075,.999737,.21391,0,.00527775,.999449,.213745,0,.00983959,.99896,.213458,0,.0154755,.9979,.212855,0,.0220249,.994278,.210779,0,.0293654,.992254,.20926,0,.0374021,.98881,.206908,0,.0460604,.984715,.204009,0,.0552802,.979738,.200471,0,.0650127,.972884,.195813,0,.0752175,.965996,.190856,0,.0858612,.957974,.185077,0,.0969155,.949155,.17868,0,.108356,.939288,.171513,0,.120163,.928996,.163838,0,.132319,.919563,.156246,0,.144808,.910004,.148359,0,.157618,.900791,.140417,0,.170737,.892135,.132569,0,.184155,.883803,.124741,0,.197866,.876034,.117091,0,.211861,.869219,.109835,0,.226134,.863062,.102859,0,.240682,.857795,.0962928,0,.255499,.853009,.0900725,0,.270583,.848603,.0842101,0,.285931,.844335,.0786527,0,.301542,.840208,.0734397,0,.317415,.836035,.0685334,0,.33355,.83172,.0639275,0,.349948,.827135,.0595909,0,.36661,.822797,.0556204,0,.383539,.818387,.0519394,0,.400738,.813565,.0485317,0,.41821,.808142,.0453138,0,.435961,.802212,.0423354,0,.453997,.79573,.0395553,0,.472324,.788741,.036988,0,.490951,.781093,.0345688,0,.509887,.773597,.0323297,0,.529144,.765622,.0302719,0,.548735,.757083,.0283477,0,.568674,.747992,.0265562,0,.588979,.738591,.0248844,0,.609671,.728719,.0233342,0,.630773,.719146,.0219081,0,.652314,.709165,.0205711,0,.674328,.69875,.0193248,0,.696854,.687884,.0181582,0,.719942,.676818,.0170746,0,.743651,.666247,.0160718,0,.768057,.655284,.0151262,0,.793253,.64401,.0142561,0,.819363,.633353,.0134327,0,.846547,.622674,.012653,0,.875017,.612265,.0119354,0,.905021,.602455,.0112533,0,.936508,.593147,.0106234,0,.968254,.583592,.0100213,0,1,1,.25717,0,0,1,.25717,0,0,.999992,.257164,0,0,.999958,.257135,0,641715e-9,.999864,.25706,0,.00305314,.999666,.256897,0,.00700975,.999302,.256596,0,.0122194,.998663,.25607,0,.0184622,.995607,.254123,0,.0255773,.993094,.252081,0,.0334439,.9907,.249867,0,.0419696,.98594,.246118,0,.0510823,.981214,.242049,0,.0607242,.974966,.236869,0,.0708486,.967589,.230724,0,.081417,.95915,.223635,0,.0923974,.950257,.21596,0,.103763,.940165,.207296,0,.115491,.929396,.197901,0,.127562,.919288,.188437,0,.13996,.909428,.178762,0,.15267,.900105,.169072,0,.165679,.891418,.159478,0,.178979,.883347,.15002,0,.192558,.875992,.140813,0,.20641,.869466,.13196,0,.220529,.863699,.123501,0,.234907,.858553,.115436,0,.249542,.854379,.107901,0,.264428,.850894,.10088,0,.279564,.847632,.0942296,0,.294947,.844571,.0879861,0,.310575,.84163,.0821534,0,.326448,.838542,.0766409,0,.342566,.835412,.0715322,0,.358929,.831899,.0666883,0,.37554,.828177,.0622175,0,.392399,.82416,.0580452,0,.409511,.820393,.054267,0,.426878,.816068,.0507172,0,.444506,.811201,.0474041,0,.4624,.805785,.0443174,0,.480566,.799878,.0414562,0,.499013,.793469,.0388147,0,.517749,.786473,.0363453,0,.536785,.778874,.0340225,0,.556134,.771277,.0318599,0,.575809,.763426,.0298859,0,.595827,.755044,.0280357,0,.616207,.746161,.0262979,0,.636973,.737124,.0247295,0,.65815,.72761,.0232514,0,.679772,.717822,.0218755,0,.701876,.708279,.0205942,0,.724509,.698333,.0193947,0,.74773,.68802,.0182717,0,.771609,.677321,.0172044,0,.79624,.666504,.0162122,0,.821743,.656184,.0152924,0,.84828,.64556,.0144326,0,.876069,.634636,.0136157,0,.905404,.624124,.0128612,0,.936508,.613914,.0121435,0,.968254,.603589,.0114887,0,1,1,.307946,0,0,.999999,.307945,0,0,.999988,.307934,0,204479e-10,.999944,.307886,0,.00127833,.999824,.307756,0,.00445047,.999565,.30748,0,.00914673,.999085,.306966,0,.0150498,.998103,.306004,0,.0219367,.994249,.303028,0,.0296485,.991807,.300435,0,.038068,.987773,.296554,0,.0471062,.982673,.2916,0,.0566942,.976623,.285641,0,.0667768,.968757,.27815,0,.0773099,.959849,.269529,0,.088257,.950663,.260248,0,.0995879,.940129,.249704,0,.111277,.92895,.238291,0,.123304,.917996,.226501,0,.13565,.907813,.214669,0,.148299,.898305,.202835,0,.161237,.889626,.191158,0,.174455,.88175,.179695,0,.187941,.874715,.168548,0,.201687,.868746,.15792,0,.215687,.863703,.147807,0,.229933,.859315,.138149,0,.24442,.855538,.128993,0,.259145,.852428,.120414,0,.274103,.850168,.112498,0,.289293,.848132,.105054,0,.304711,.846291,.0981087,0,.320357,.844431,.0915942,0,.33623,.842493,.0855056,0,.35233,.840368,.0798204,0,.368658,.83798,.0745097,0,.385214,.83523,.0695424,0,.402002,.832091,.0649092,0,.419023,.828667,.0606291,0,.436282,.824805,.0566523,0,.453782,.820988,.0530229,0,.471529,.816635,.0496364,0,.489528,.811725,.0464658,0,.507788,.806316,.0435082,0,.526317,.800469,.0407873,0,.545124,.794107,.038255,0,.564221,.787218,.0358825,0,.583621,.779872,.0336785,0,.603341,.772097,.0316379,0,.623397,.764484,.0297379,0,.643812,.756428,.0279581,0,.664611,.748022,.0263153,0,.685824,.739268,.0247799,0,.707488,.73024,.0233385,0,.729646,.720893,.0220035,0,.752354,.71119,.0207555,0,.77568,.701791,.0195843,0,.799715,.692184,.0184891,0,.824574,.682258,.0174541,0,.850417,.67206,.0164873,0,.877466,.661717,.0155959,0,.90604,.651462,.0147519,0,.936528,.641467,.0139727,0,.968254,.631229,.0132363,0,1,1,.367573,0,0,.999999,.367571,0,0,.999984,.367553,0,183382e-9,.999925,.367473,0,.00225254,.999759,.367259,0,.00628165,.99941,.366801,0,.0117858,.998739,.365946,0,.0184359,.995529,.363191,0,.0260114,.992875,.360171,0,.0343581,.989135,.355981,0,.0433637,.984166,.350401,0,.0529438,.977871,.343348,0,.0630334,.96951,.334341,0,.0735805,.959964,.323862,0,.0845437,.950162,.312521,0,.095889,.938882,.299577,0,.107588,.926992,.285573,0,.119617,.915589,.271212,0,.131957,.904791,.256611,0,.144591,.895177,.242224,0,.157503,.886403,.227952,0,.170682,.878957,.214192,0,.184117,.872418,.200795,0,.197799,.867029,.188015,0,.21172,.862835,.175975,0,.225873,.859411,.164526,0,.240253,.856655,.153693,0,.254854,.854519,.14352,0,.269673,.852828,.13397,0,.284707,.851412,.124984,0,.299953,.850609,.116748,0,.315408,.849855,.10905,0,.331073,.849017,.101839,0,.346946,.848079,.0951359,0,.363028,.846911,.0888774,0,.379318,.845445,.0830375,0,.395818,.84362,.0775844,0,.41253,.841411,.0725054,0,.429457,.838768,.0677691,0,.446602,.835801,.0634016,0,.463968,.832341,.0593095,0,.481561,.828424,.0555121,0,.499386,.824312,.052024,0,.51745,.819918,.0487865,0,.535761,.815072,.0457801,0,.554328,.809863,.0430184,0,.573162,.804164,.0404245,0,.592275,.798034,.0380146,0,.611681,.791436,.0357436,0,.631398,.784498,.0336475,0,.651445,.777125,.0316666,0,.671845,.769365,.0298122,0,.692628,.761579,.0281001,0,.713827,.753746,.0265049,0,.735484,.745573,.0250067,0,.75765,.737083,.0236026,0,.78039,.728545,.0223302,0,.803789,.719691,.0211243,0,.82796,.710569,.0199983,0,.853056,.701216,.0189569,0,.879298,.692094,.0179702,0,.907014,.682909,.0170418,0,.936691,.673509,.0161732,0,.968254,.663863,.0153406,0,1,1,.437395,0,0,.999998,.437394,0,0,.99998,.437363,0,616704e-9,.999891,.437232,0,.00367925,.999656,.436877,0,.00867446,.999148,.436121,0,.0150679,.997959,.434564,0,.022531,.993464,.430134,0,.0308507,.990606,.426077,0,.0398805,.985027,.419397,0,.0495148,.978491,.41118,0,.0596749,.969643,.40048,0,.0703001,.959189,.38769,0,.0813427,.948223,.373575,0,.0927641,.935955,.357622,0,.104533,.923237,.34043,0,.116624,.911074,.322735,0,.129015,.899724,.30479,0,.141687,.890189,.287392,0,.154626,.881796,.270248,0,.167818,.874781,.253659,0,.181252,.869166,.237786,0,.194918,.864725,.222618,0,.208807,.861565,.208356,0,.222913,.859284,.194867,0,.237229,.857677,.18212,0,.25175,.856714,.17018,0,.266473,.856155,.158969,0,.281392,.8558,.148413,0,.296505,.855672,.138578,0,.311811,.855538,.129345,0,.327306,.855689,.120861,0,.342991,.855767,.112969,0,.358864,.855618,.105593,0,.374925,.85525,.0987451,0,.391176,.854583,.0923727,0,.407616,.853534,.0864143,0,.424249,.852061,.0808338,0,.441076,.850253,.0756771,0,.4581,.848004,.0708612,0,.475324,.845333,.0663784,0,.492754,.842376,.0622631,0,.510394,.838956,.0584112,0,.528251,.835121,.0548328,0,.546331,.830842,.0514838,0,.564644,.826212,.048355,0,.583198,.821522,.0454714,0,.602005,.816551,.0428263,0,.621078,.811211,.0403612,0,.640434,.805479,.038039,0,.660089,.799409,.0358739,0,.680066,.79306,.0338727,0,.70039,.786395,.0319985,0,.721094,.779416,.030241,0,.742215,.77214,.0285951,0,.7638,.764636,.0270747,0,.785912,.756836,.0256354,0,.808628,.749315,.0243027,0,.832055,.741561,.0230497,0,.856338,.733589,.0218801,0,.88169,.725479,.020784,0,.908441,.717255,.0197702,0,.937125,.708829,.0188168,0,.968254,.700191,.0179113,0,1,1,.518937,0,0,.999998,.518933,0,0,.999967,.518883,0,.00147741,.999832,.51866,0,.00573221,.999466,.518057,0,.011826,.998644,.516752,0,.0192116,.994458,.512347,0,.027573,.991223,.507675,0,.0367099,.985515,.500188,0,.046487,.978308,.490408,0,.0568071,.968359,.477357,0,.0675984,.95682,.461752,0,.0788059,.943929,.443796,0,.090386,.930224,.423893,0,.102304,.916514,.402682,0,.114532,.903653,.380914,0,.127047,.892315,.359212,0,.139828,.882942,.338102,0,.152861,.875438,.31773,0,.16613,.869642,.298186,0,.179624,.865304,.279491,0,.193332,.862382,.261804,0,.207247,.860666,.245146,0,.22136,.859788,.229406,0,.235666,.859608,.214605,0,.250158,.859912,.200691,0,.264832,.86053,.187623,0,.279684,.861368,.17539,0,.294711,.862237,.163901,0,.309911,.863127,.153175,0,.32528,.863923,.143147,0,.340819,.864567,.133781,0,.356524,.865013,.125042,0,.372397,.86539,.116952,0,.388438,.865591,.109476,0,.404645,.865517,.102542,0,.421022,.865084,.0960688,0,.437569,.864309,.0900499,0,.454287,.863151,.0844328,0,.471181,.861649,.0792218,0,.488253,.859742,.0743482,0,.505507,.857446,.0697963,0,.522947,.854757,.0655364,0,.54058,.851783,.061608,0,.558412,.848516,.0579701,0,.576449,.844897,.0545742,0,.594701,.840956,.0514167,0,.613178,.836676,.0484598,0,.631892,.832075,.0456934,0,.650856,.827191,.0431178,0,.670088,.822295,.0407718,0,.689606,.817294,.0386032,0,.709434,.812013,.0365675,0,.7296,.806465,.0346547,0,.750138,.800691,.0328717,0,.771093,.794709,.031211,0,.792519,.788493,.0296504,0,.814488,.782049,.0281782,0,.837097,.775403,.0267965,0,.860481,.76857,.0255002,0,.884842,.761536,.0242759,0,.910494,.754303,.0231142,0,.937985,.74692,.0220305,0,.968254,.739745,.0210192,0,1,1,.613914,0,0,.999996,.613907,0,963597e-10,.999942,.613814,0,.00301247,.999704,.613407,0,.00870385,.999046,.612302,0,.0160714,.995516,.608266,0,.0245899,.991726,.602863,0,.0339681,.985157,.593956,0,.0440254,.97642,.581748,0,.0546409,.964404,.565183,0,.0657284,.950601,.545273,0,.0772246,.935158,.522129,0,.0890812,.919364,.496782,0,.10126,.904754,.470571,0,.113731,.89176,.444037,0,.126469,.881492,.418322,0,.139454,.873656,.393522,0,.15267,.868053,.369795,0,.166101,.864336,.347171,0,.179736,.862259,.325737,0,.193565,.861556,.305532,0,.207578,.861776,.286416,0,.221769,.862661,.268355,0,.23613,.864015,.251334,0,.250656,.865711,.235352,0,.265343,.867519,.220302,0,.280187,.869351,.206161,0,.295183,.871144,.192908,0,.31033,.872839,.180505,0,.325624,.874307,.168848,0,.341065,.875667,.158021,0,.35665,.876758,.147877,0,.37238,.87764,.138441,0,.388253,.878237,.129627,0,.404269,.878563,.121415,0,.42043,.878572,.113741,0,.436735,.87842,.106652,0,.453187,.878057,.100097,0,.469786,.877413,.0940128,0,.486536,.87646,.0883462,0,.503439,.875233,.0830924,0,.520498,.8737,.0781975,0,.537717,.871873,.07364,0,.555102,.86978,.0694103,0,.572657,.867405,.0654696,0,.59039,.864751,.0617914,0,.608307,.861818,.0583491,0,.626419,.858645,.0551443,0,.644733,.855307,.0521894,0,.663264,.851736,.0494334,0,.682025,.847927,.0468504,0,.701032,.843888,.0444261,0,.720308,.839629,.0421497,0,.739875,.835158,.0400082,0,.759764,.830509,.0380076,0,.780014,.825714,.0361488,0,.800673,.820729,.0343956,0,.821803,.815751,.0327781,0,.843492,.810752,.031275,0,.86586,.805587,.0298542,0,.889087,.800317,.0285397,0,.913466,.79489,.0272948,0,.93952,.789314,.0261139,0,.96835,.783593,.0249938,0,1,1,.724258,0,0,.999992,.724243,0,726889e-9,.99987,.724044,0,.00569574,.999336,.72317,0,.0131702,.996271,.719432,0,.0220738,.991159,.712576,0,.0319405,.982465,.700927,0,.0425202,.97049,.684297,0,.0536599,.953973,.661244,0,.065258,.935546,.633804,0,.0772427,.916596,.603071,0,.0895616,.899353,.57105,0,.102175,.885216,.539206,0,.11505,.875076,.508714,0,.128164,.868334,.479571,0,.141495,.864414,.451796,0,.155026,.862678,.425328,0,.168745,.862835,.400352,0,.182639,.864067,.376532,0,.196699,.866086,.35391,0,.210915,.868557,.332424,0,.225282,.871271,.312053,0,.239792,.874058,.292764,0,.25444,.8768,.27453,0,.269223,.87939,.257297,0,.284135,.8819,.24114,0,.299174,.884187,.225934,0,.314337,.886262,.211669,0,.329622,.888119,.198311,0,.345026,.889709,.185783,0,.360549,.891054,.174063,0,.376189,.892196,.163143,0,.391946,.893101,.152952,0,.407819,.893803,.143475,0,.423808,.894277,.134647,0,.439914,.894532,.126434,0,.456137,.894576,.1188,0,.472479,.894393,.111694,0,.48894,.893976,.105069,0,.505523,.893346,.0989077,0,.52223,.892502,.0931724,0,.539064,.891441,.0878276,0,.556028,.890276,.082903,0,.573125,.888972,.0783505,0,.590361,.887469,.0741083,0,.607741,.885785,.0701633,0,.62527,.883914,.0664835,0,.642957,.881872,.0630567,0,.660809,.879651,.0598527,0,.678836,.877267,.0568615,0,.69705,.874717,.05406,0,.715465,.872012,.0514378,0,.734098,.869157,.0489805,0,.752968,.866155,.0466727,0,.772101,.863014,.0445056,0,.791529,.859748,.0424733,0,.81129,.856416,.0405957,0,.831438,.852958,.0388273,0,.852044,.849382,.0371619,0,.87321,.845694,.0355959,0,.89509,.841893,.0341155,0,.917932,.837981,.0327141,0,.942204,.833963,.0313856,0,.968981,.829847,.0301275,0,1,1,.85214,0,0,.999969,.852095,0,.00279627,.999483,.851408,0,.0107635,.994545,.84579,0,.0206454,.986188,.835231,0,.0315756,.969847,.814687,0,.0432021,.945951,.783735,0,.0553396,.91917,.746074,0,.0678766,.895488,.706938,0,.0807395,.878232,.669534,0,.0938767,.868252,.635168,0,.10725,.863873,.603069,0,.120832,.863369,.572514,0,.134598,.86545,.543169,0,.148533,.868803,.514578,0,.16262,.872794,.486762,0,.176849,.87702,.459811,0,.19121,.881054,.433654,0,.205694,.884974,.408574,0,.220294,.888587,.384525,0,.235005,.891877,.36156,0,.24982,.894793,.339661,0,.264737,.89743,.318913,0,.279751,.899796,.299302,0,.294859,.901943,.280843,0,.310058,.903858,.263481,0,.325346,.905574,.247197,0,.340721,.907069,.231915,0,.356181,.908379,.217614,0,.371725,.90952,.20425,0,.387353,.910483,.191758,0,.403063,.91128,.180092,0,.418854,.911936,.169222,0,.434727,.912454,.159098,0,.450682,.912835,.149668,0,.466718,.913078,.140884,0,.482837,.913192,.132709,0,.499038,.913175,.125095,0,.515324,.91304,.118012,0,.531695,.912781,.111417,0,.548153,.91241,.105281,0,.5647,.911924,.0995691,0,.581338,.911331,.0942531,0,.59807,.910637,.0893076,0,.6149,.90984,.0846998,0,.63183,.908941,.0804044,0,.648865,.907944,.0763984,0,.666011,.906857,.0726638,0,.683273,.90568,.0691783,0,.700659,.904416,.0659222,0,.718176,.903067,.0628782,0,.735834,.901637,.0600307,0,.753646,.900128,.0573647,0,.771625,.898544,.0548668,0,.78979,.89689,.052527,0,.808162,.895165,.0503306,0,.826771,.893371,.0482668,0,.845654,.891572,.0463605,0,.864863,.889763,.0445998,0,.884472,.887894,.0429451,0,.904592,.885967,.0413884,0,.925407,.883984,.0399225,0,.947271,.881945,.0385405,0,.97105,.879854,.0372362,0,1,.999804,.995833,0,0,.938155,.933611,0,.0158731,.864755,.854311,0,.0317461,.888594,.865264,0,.0476191,.905575,.863922,0,.0634921,.915125,.850558,0,.0793651,.920665,.829254,0,.0952381,.924073,.802578,0,.111111,.926304,.772211,0,.126984,.927829,.739366,0,.142857,.928924,.705033,0,.15873,.92973,.670019,0,.174603,.930339,.634993,0,.190476,.930811,.600485,0,.206349,.931191,.566897,0,.222222,.93149,.534485,0,.238095,.931737,.503429,0,.253968,.931939,.473811,0,.269841,.932108,.445668,0,.285714,.93225,.418993,0,.301587,.932371,.393762,0,.31746,.932474,.369939,0,.333333,.932562,.347479,0,.349206,.932638,.326336,0,.365079,.932703,.306462,0,.380952,.93276,.287805,0,.396825,.932809,.270313,0,.412698,.932851,.253933,0,.428571,.932887,.23861,0,.444444,.932917,.224289,0,.460317,.932943,.210917,0,.47619,.932965,.19844,0,.492063,.932982,.186807,0,.507937,.932995,.175966,0,.52381,.933005,.165869,0,.539683,.933011,.156468,0,.555556,.933013,.147719,0,.571429,.933013,.139579,0,.587302,.93301,.132007,0,.603175,.933004,.124965,0,.619048,.932994,.118416,0,.634921,.932982,.112326,0,.650794,.932968,.106663,0,.666667,.93295,.101397,0,.68254,.932931,.0964993,0,.698413,.932908,.0919438,0,.714286,.932883,.0877057,0,.730159,.932856,.0837623,0,.746032,.932827,.0800921,0,.761905,.932796,.0766754,0,.777778,.932762,.0734936,0,.793651,.932727,.0705296,0,.809524,.932689,.0677676,0,.825397,.93265,.0651929,0,.84127,.932609,.0627917,0,.857143,.932565,.0605515,0,.873016,.932521,.0584606,0,.888889,.932474,.0565082,0,.904762,.932427,.0546841,0,.920635,.932377,.0529793,0,.936508,.932326,.0513851,0,.952381,.932274,.0498936,0,.968254,.93222,.0484975,0,.984127,.932164,.0471899,0,1],i=new Float32Array(t),r=new Float32Array(e);Du.LTC_FLOAT_1=new Pu(i,64,64,Fu,Cu,Nu,Eu,Eu,Ru,Ou,1),Du.LTC_FLOAT_2=new Pu(r,64,64,Fu,Cu,Nu,Eu,Eu,Ru,Ou,1),Du.LTC_FLOAT_1.needsUpdate=!0,Du.LTC_FLOAT_2.needsUpdate=!0;const n=new Uint16Array(t.length);t.forEach((function(t,e){n[e]=Mu.toHalfFloat(t)}));const s=new Uint16Array(e.length);e.forEach((function(t,e){s[e]=Mu.toHalfFloat(t)})),Du.LTC_HALF_1=new Pu(n,64,64,Fu,Lu,Nu,Eu,Eu,Ru,Ou,1),Du.LTC_HALF_2=new Pu(s,64,64,Fu,Lu,Nu,Eu,Eu,Ru,Ou,1),Du.LTC_HALF_1.needsUpdate=!0,Du.LTC_HALF_2.needsUpdate=!0}}class Uu extends THREE.RectAreaLight{constructor(t){Iu.inited||(Iu.inited=!0,Iu.init());const e=pt({color:"#ffffff",intensity:1,width:1,height:1},t);super(ni(e.color),e.intensity,e.width,e.height),this.isThing=!0,this.name="RectAreaLight",Mo.prototype._initOption.call(this,e)}setupStyle(){}toJSON(t){const e=super.toJSON(t),i=Mo.prototype.toJSON.call(this);return i.config={...e.object,...i.config},i.config.color=this.color.toHexString(),i.config.intensity=this.intensity,i.config.width=this.width,i.config.height=this.height,delete i.config.matrix,i}}class Bu extends be.EventDispatcher{static signMeasure(t){t.traverse((t=>{t.layers.set(pe.IGNORE_RAYCAST),t.userData.isMeasure=!0,t.userData.hideInTree=!0}))}constructor(t){super(),this.isMeasure=!0,this.option=pt({unit:"m",onTop:!0,linewidth:.002,lineColor:"#FF9900",pointColor:"#FF9900",fillColor:"#FF9900",textFillColor:"#FFFFFF",textStrokeColor:"rgba(0,0,0,.6)",textStrokeWidth:2,fontSize:16,pointOffset:[.5,.5]},t||{}),this.picks={},this.name=this.option.name||"Measure",this.id=be.MathUtils.generateUUID(),this.root=new Ya,this.root.name="Measure",this.root.userData.hideInTree=!0,this.pointsGroup=new Ya,this.root.add(this.pointsGroup),this.line=new cc({points:[],layers:pe.IGNORE_RAYCAST,material:{linewidth:this.option.linewidth,color:this.option.lineColor,worldUnits:!1}}),Bu.signMeasure(this.line),this.root.add(this.line)}addHelperLine(){this.helperLine=new cc({material:{linewidth:this.option.linewidth,color:this.option.lineColor,worldUnits:!1,dashed:!0,dashSize:.15,gapSize:.15}}),this.helperLine.name="HelperLine",this.helperLine.mesh.material.color=new be.Color(this.option.lineColor).addScalar(.6),Bu.signMeasure(this.helperLine),this.root.add(this.helperLine)}setHelper(t){this.helperLine.clear(),this.helperLine.vertices.length<2&&this.helperLine.addPoint(t)}setOnTop(t){[this.line?this.line.mesh?.material:null,this.area?this.area.mesh?.material:null,this.helperLine?this.helperLine.mesh?.material:null].forEach((t=>{t&&(t.depthTest=!1,t.depthWrite=!1,t.side=be.DoubleSide,t.needsUpdate=!0)})),this.line.renderOrder=t?Bu.RENDER_ORDER:0,this.area&&(this.area.renderOrder=t?Bu.RENDER_ORDER:0),this.helperLine&&(this.helperLine.renderOrder=t?Bu.RENDER_ORDER:0),this.root.traverse((t=>{}))}addPick(t,e){this.picks[t]=e||{picked:[],raycasterPicked:[]}}getPick(t){return this.picks[t]}clear(){this.clearHelper(),this.picks={},this.pointsGroup.clear(),this.line.clear(),this.hLine&&this.hLine.clear(),this.area&&this.area.clear()}remove(){this.root.removeFromParent(),this.dispatchEvent({type:"removed",measure:this})}isComplete(){return!1}_updateDistancePoints(){}addPoint(t,e){}getLineDistance(t){if(0===t)return 0;t||(t=this.line.vertices.length);let e=0,i=this.line.vertices.slice(0,t+1);return i.forEach(((t,r)=>{i[r-1]&&(e+=t.distanceTo(i[r-1]))})),e}getDistance(t){let e=0;return t.forEach(((i,r)=>{t[r-1]&&(e+=i.distanceTo(ti(t[r-1])))})),e}getArea(t){return _o(t.map((t=>ti(t))))}getHeight(t,e){return Math.abs(ti(t).y-ti(e).y)}getPoints(){return this.line.vertices.map((t=>t.toArray()))}toJSON(){const t={};return t.id=this.id,t.type=this.type,this.option.mode&&(t.mode=this.option.mode),t.result=this.result,t.points=this.getPoints(),t}fromJSON(t){this.id=t.id,this.option.mode&&t.mode&&(this.option.mode=t.mode),this.setPoints(t.points||[]),this._updateDistancePoints()}setVisible(t){this.root.visible=!!t}updateHelper(){}createLabel(t,e){const i=new Co({position:t,center:e.center||[.5,.5],material:{depthWrite:!1,depthTest:!1,map:{text:"",icon:"",iconWidth:6,iconHeight:6,fontColor:e.fontColor||this.option.textFillColor,strokeWidth:this.option.textStrokeWidth,strokeColor:this.option.textStrokeColor,fontSize:e.fontSize||this.option.fontSize,...e||{}}}});return i.sprite.material.depthTest=!1,i.sprite.material.depthWrite=!1,Bu.signMeasure(i),this.pointsGroup.add(i),i}_createLine(t,e,i){const r=new THING.Line({points:[t,e],material:{color:i||"#FFFFFF",depthTest:!1,depthWrite:!1}});Bu.signMeasure(r),this.root.add(r);let n=new be.Line3(t,e),s=new be.Vector3;n.getCenter(s);let o=ti(t).distanceTo(ti(e));return this.createLabel(s,{text:o.toFixed(2)+"m",center:[.5,-.5],fontColor:"#ffffff"}),o}clearHelper(){this.helperLine&&this.helperLine.clear()}setHelper(t){this.helperLine&&(this.clearHelper(),this.helperLine.addPoint(t))}updateHelper(t){this.helperLine&&(1==this.helperLine.vertices.length&&this.helperLine.addPoint(t),this.helperLine.setPoint(1,t))}setPoints(t){this.clear(),t.forEach((t=>{this.addPoint(t)}))}}Bu.RENDER_ORDER=99999;const ku={SNAP_VERTEX:0,SNAP_MIDPOINT:1,SNAP_CIRCLE_CENTER:2,SNAP_EDGE:3,SNAP_FACE:4,SNAP_CIRCULARARC:5,SNAP_CURVEDEDGE:6,SNAP_CURVEDFACE:7,MEASUREMENT_DISTANCE:1,MEASUREMENT_ANGLE:2,MEASUREMENT_AREA:3,CALIBRATION:4,MEASUREMENT_CHANGED_EVENT:"measurement-changed",UNITS_CALIBRATION_STARTS_EVENT:"units_calibration_starts_event",EPSILON:1e-4},ju=function(t){var e=t.map((t=>ti(t)));if(3!==e.length||function(t){for(var e=0;e<t.length;e++)for(var i=0;i<t.length;i++)if(e!==i&&zu(t[e],t[i],ku.EPSILON))return!0;return!1}(e))return null;var i=new be.Vector3,r=new be.Vector3;return i.subVectors(e[0],e[1]),r.subVectors(e[2],e[1]),Gu(i,r)},Vu=function(t,e){return 0===ti(t).distanceTo(ti(e))},zu=function(t,e,i=ku.EPSILON){return!(!t||!e)&&(Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i&&Math.abs(t.z-e.z)<=i)},Gu=function(t,e){return 180*t.angleTo(e)/Math.PI};var Hu=Object.freeze({__proto__:null,DistanceMeasure:class extends Bu{constructor(t){super(t),this.type="DistanceMeasure",this.maxPickCount=Number.MAX_SAFE_INTEGER,this.minPickCount=3,this.distance=0,this.addHelperLine(),this.setOnTop(this.option.onTop)}get result(){return(this.distance?Number(this.distance).toFixed(2):0)+"m"}isComplete(){return 2==this.line.vertices.length}_updateDistancePoints(t){this.pointsGroup.clear();const e=this.line.vertices.map((t=>[t.x,t.y,t.z]));if(e.forEach(((t,e)=>{this.createLabel(t,{icon:"thing-point",center:this.option.pointOffset})})),this.distance=0,e.length<2)return;let i=this.line.vertices[0],r=this.line.vertices[1];this._createLine(i,r,"#FFFFFF");var n=new be.Vector3(r.x,i.y,r.z),s=new be.Vector3(i.x,i.y,r.z);this.createLabel(n,{icon:"thing-point",center:this.option.pointOffset}),this.createLabel(s,{icon:"thing-point",center:this.option.pointOffset});let o=0;o+=this._createLine(n,s,"#FF0000"),o+=this._createLine(i,s,"#0066ff"),o+=this._createLine(r,n,"#00FF00"),this.distance=o,this.root.locked=!0}addPoint(t,e){let i=this.line.vertices.length;(0==i||i>0&&i<2&&!Vu(t,this.line.vertices[i-1]))&&(this.addPick(i,e),this.line.addPoint(t),this.setHelper(t),this._updateDistancePoints())}},SimpleDistanceMeasure:class extends Bu{constructor(t){super(t),this.type="SimpleDistanceMeasure",this.maxPickCount=2,this.minPickCount=2,this.distance=0,this.addHelperLine(),this.setOnTop(this.option.onTop)}get result(){return(this.distance?Number(this.distance).toFixed(2):0)+"m"}isComplete(){return 2==this.line.vertices.length}_updateLine(){}_updateLabel(){if(2!==this.line.vertices.length)return;let t=this.line.vertices[0],e=this.line.vertices[1],i=new be.Line3(t,e),r=new be.Vector3;i.getCenter(r);let n=ti(t).distanceTo(ti(e));this.distance=n,this.resultLabel=this.createLabel(r,{text:this.result,center:[.5,-.5],fontColor:"#FFFFFF"})}_updateDistancePoints(t){this.pointsGroup.clear(),this.option;this.line.vertices.map((t=>[t.x,t.y,t.z])).forEach(((t,e)=>{this.createLabel(t,{icon:"thing-point",center:this.option.pointOffset})})),this._updateLabel(),this.root.locked=!0}addPoint(t,e){let i=this.line.vertices.length;(0==i||i>0&&i<2&&!Vu(t,this.line.vertices[i-1]))&&(this.addPick(i,e),this.line.addPoint(t),this.setHelper(t),this._updateDistancePoints())}},RectilinearDistanceMeasure:class extends Bu{constructor(t){super(t),this.type="RectilinearDistanceMeasure",this.maxPickCount=this.minPickCount=2,this.distance=0,this.addHelperLine(),this.setOnTop(this.option.onTop)}get result(){return(this.distance?Number(this.distance).toFixed(2):0)+"m"}isComplete(){return 2==this.line.vertices.length}_updateDistancePoints(t){this.pointsGroup.clear();const e=this.line.vertices.map((t=>[t.x,t.y,t.z]));if(this.line.visible=!0,this.distance=0,e.length<2)return;let i=this.line.vertices[0],r=this.line.vertices[1];var n=new be.Vector3(r.x,i.y,r.z),s=new be.Vector3(i.x,i.y,r.z);this.createLabel(n,{icon:"thing-point",center:this.option.pointOffset}),this.createLabel(s,{icon:"thing-point",center:this.option.pointOffset}),this.createLabel(i,{icon:"thing-point",center:this.option.pointOffset}),this._createLine(n,s,"#FF0000"),this.distance=this._createLine(i,s,"#0066ff"),this.line.visible=!1,this.root.locked=!0}addPoint(t,e){let i=this.line.vertices.length;(0==i||i>0&&i<2&&!Vu(t,this.line.vertices[i-1]))&&(this.addPick(i,e),this.line.addPoint(t),this.setHelper(t),this._updateDistancePoints())}},MultipleDistanceMeasure:class extends Bu{constructor(t){super(pt({mode:"segment"},t)),this.type="MultipleDistanceMeasure",this.maxPickCount=Number.MAX_SAFE_INTEGER,this.minPickCount=3,this.distance=0,this.addHelperLine(),this.setOnTop(this.option.onTop)}get result(){return(this.distance?Number(this.distance).toFixed(2):0)+"m"}isComplete(){return this.line.vertices.length>=2}_updateDistancePoints(){this.pointsGroup.clear();const t=this.line.vertices,e=t.map((t=>[t.x,t.y,t.z]));let i=0;const r=this.option.mode;e.forEach(((n,s)=>{this.createLabel(n,{icon:"thing-point",center:this.option.pointOffset});let o=n,a=0;if(s>0&&"segment"==r){a=t[s].distanceTo(t[s-1]);let e=new THREE.Line3(t[s],t[s-1]);o=new THREE.Vector3,e.getCenter(o)}let l="total"==r?this.getLineDistance(s):a;i+=l,this.createLabel(o,{text:l.toFixed(2)+"m",center:[.5,-.5]}),s==e.length-1&&"segment"==r&&this.createLabel(n,{text:i.toFixed(2)+"m",center:[.5,-.5]})})),this.distance=i,this.root.locked=!0}addPoint(t,e){let i=this.line.vertices.length;(0==i||i>0&&!Vu(t,this.line.vertices[i-1]))&&(this.line.addPoint(t),this.addPick(i,e),this.setHelper(t),this._updateDistancePoints())}updateHelper(t){1==this.helperLine.vertices.length&&this.helperLine.addPoint(t),this.helperLine.setPoint(1,t)}},HeightMeasure:class extends Bu{constructor(t){super(t),this.type="HeightMeasure",this.maxPickCount=this.minPickCount=2,this.hLine=new cc({points:[],material:{linewidth:this.option.linewidth,color:this.option.lineColor}}),Bu.signMeasure(this.hLine),this.root.add(this.hLine),this.line.mesh.material.transparent=!0,this.line.mesh.material.opacity=.2,this.setOnTop(this.option.onTop)}get result(){return(this.height?Number(this.height).toFixed(2):0)+"m"}isComplete(){return 2==this.line.vertices.length}setOnTop(t){[this.line?this.line.mesh?.material:null,this.hLine?this.hLine.mesh?.material:null].forEach((t=>{t&&(t.depthTest=!1,t.needsUpdate=!0,t.transparent=!0,t.side=be.DoubleSide)})),this.line&&(this.line.renderOrder=t?Bu.RENDER_ORDER:0),this.hLine&&(this.hLine.renderOrder=t?Bu.RENDER_ORDER:0)}_updateDistancePoints(){this.pointsGroup.clear();const t=this.line.vertices.map((t=>[t.x,t.y,t.z]));if(t.forEach(((t,e)=>{this.createLabel(t,{icon:"thing-point",center:this.option.pointOffset})})),t.length<2)return;let e=t[t.length-1],i=Math.abs(t[0][1]-t[1][1]);this.height=i,this.createLabel(e,{text:i.toFixed(2)+"m(h)",center:[0,-.5]}),this.root.locked=!0}addPoint(t,e){let i=this.line.vertices.length;if(t=ti(t),(0==i||1==i&&!Vu(t,this.line.vertices[0]))&&(this.addPick(i,e),this.line.addPoint(t),this._updateDistancePoints()),i=this.line.vertices.length,2==i){const e=this.line.vertices[0];let i=e.y>=t.y?e:t,r=e.y>=t.y?t:e;this.hLine.addPoint(i);let n=[i.x,r.y,i.z];this.hLine.addPoint(n),this.createLabel(n,{icon:"thing-point",center:this.option.pointOffset})}}},AngleMeasure:class extends Bu{constructor(t){super(t),this.type="AngleMeasure",this.maxPickCount=3,this.minPickCount=3,this.addHelperLine(),this.setOnTop(this.option.onTop)}get result(){return(this.angle?Number(this.angle).toFixed(2):0)+"°"}isComplete(){return 3==this.line.vertices.length}_updateDistancePoints(t){this.pointsGroup.clear();this.line.vertices.forEach(((t,e)=>{this.createLabel(t,{icon:"thing-point",center:this.option.pointOffset})})),this.updateLabel()}updateLabel(){const t=this.line.vertices;null!=this.angle&&(this.label&&this.root.getObjectByProperty("uuid",this.label.uuid)?(this.label.updateMaterial({map:{text:this.result}}),this.label.position.copy(t[1])):this.label=this.createLabel(t[1],{text:this.result,center:[.5,-.5]}))}clearAngleMeshes(){}drawAngle(t,e,i,r,n,s){var o=.001;this.materialAngle||(this.materialAngle=new be.MeshPhongMaterial({color:10066329,opacity:.5,transparent:!0,depthTest:!1,depthWrite:!1,side:be.DoubleSide}),this.materialAngleOutline=new be.MeshBasicMaterial({color:16750848,depthTest:!1,depthWrite:!1}));var a=Math.min(t.distanceTo(e),t.distanceTo(i))/4;this.surfaceColor=new be.MeshBasicMaterial({color:new be.Color(this.option.lineColor),opacity:.4,transparent:!0,depthTest:!1,depthWrite:!1,side:be.DoubleSide});var l=new be.CircleGeometry(a,100,0,n*Math.PI/180),h=new be.Mesh(l,this.surfaceColor);h.traverse((t=>{t.userData.isLocked=!0,t.userData.isMeasure=!0,t.userData.hideInTree=!0})),this.arc&&this.arc.removeBySelf(),this.arc=h,this.root.add(h),h.position.set(t.x,t.y,t.z);var c=h.position.clone();c.add(r),h.lookAt(c),h.updateMatrixWorld();var d=ti(Nc.getPoint(h,1)),u=ti(Nc.getPoint(h,Nc.getVerticesLength(h.geometry)-2));d.applyMatrix4(h.matrixWorld),u.applyMatrix4(h.matrixWorld);var p=new be.Vector3,m=new be.Vector3,f=new be.Vector3,g=new be.Vector3;p.subVectors(d,t),m.subVectors(u,t),f.subVectors(e,t),g.subVectors(i,t);var v,y=p.angleTo(f),w=p.angleTo(g),x=m.angleTo(f),b=m.angleTo(g);v=(y<=o&&y>=-.001||w<=o&&w>=-.001)&&(x<=o&&x>=-.001||b<=o&&b>=-.001)?0:(y<=Math.PI+o&&y>=Math.PI-o||w<=Math.PI+o&&w>=Math.PI-o)&&(x<=Math.PI+o&&x>=Math.PI-o||b<=Math.PI+o&&b>=Math.PI-o)?Math.PI:y<=x+o&&y>=x-o||y<=b+o&&y>=b-o?y:w;var _=new be.Matrix4;_.makeRotationAxis(r,v),_.multiply(h.matrix),h.matrix=_,h.rotation.setFromRotationMatrix(h.matrix),h.updateMatrixWorld(),d=ti(Nc.getPoint(h,1)),u=ti(Nc.getPoint(h,Nc.getVerticesLength(h.geometry)-2)),d.applyMatrix4(h.matrixWorld),u.applyMatrix4(h.matrixWorld),p.subVectors(d,t),m.subVectors(u,t),y=p.angleTo(f),w=p.angleTo(g),x=m.angleTo(f),b=m.angleTo(g),y>=o&&w>=o&&((_=new be.Matrix4).makeRotationAxis(r,2*-v),_.multiply(h.matrix),h.matrix=_,h.rotation.setFromRotationMatrix(h.matrix)),this.midPoint=new be.Vector3;let A=Math.round(Nc.getVerticesLength(h.geometry)/2-1),S=ti(Nc.getPoint(h,A));this.midPoint.copy(S),this.midPoint.applyMatrix4(h.matrixWorld);var T=new be.Vector3;T.subVectors(this.midPoint,t).normalize(),T.multiplyScalar(a/2),this.midPoint.add(T)}updateAngle(){let t=this.line.vertices,e=this.helperLine.vertices,i=[].concat(t);if(2==t.length&&2==e.length&&i.push(e[1]),3!==i.length)return;const r=ju(i);this.angle=r;var n=new be.Vector3,s=new be.Vector3,o=new be.Vector3;s.subVectors(i[0],i[1]),o.subVectors(i[1],i[2]),n.crossVectors(s,o),n.normalize(),this.drawAngle(i[1],i[0],i[2],n,r),this.updateLabel()}addPoint(t,e){let i=this.line.vertices.length;(0==i||i>0&&i<3&&!Vu(t,this.line.vertices[i-1]))&&(this.addPick(i,e),this.line.addPoint(t),this.setHelper(t),this._updateDistancePoints(),this.root.locked=!0)}setHelper(t){this.helperLine.clear(),this.helperLine.addPoint(t)}updateHelper(t){let e=this.helperLine.vertices.length;1==e&&this.helperLine.addPoint(t),this.helperLine.setPoint(1,t),e>1&&this.updateAngle()}fromJSON(t){super.fromJSON(t),this.updateAngle()}},AreaMeasure:class extends Bu{constructor(t){super(t),this.type="AreaMeasure",this.maxPickCount=Number.MAX_SAFE_INTEGER,this.minPickCount=3,this.addHelperLine(),this.area=new Gc({points:[],polygon:{material:{color:this.option.fillColor,opacity:.1,transparent:!0,side:2,depthWrite:!1,depthTest:!1}},line:{material:{linewidth:this.option.linewidth,color:this.option.lineColor,depthWrite:!1,depthTest:!1}}}),this.areaValue=0,this.root.add(this.area),this.setOnTop(this.option.onTop)}get result(){return(this.areaValue?Number(this.areaValue).toFixed(2):0)+"m²"}isComplete(){return this.area.vertices.length>=3}setOnTop(t){[this.line?this.line.mesh.material:null,this.area?this.area?.mesh?.material:null,this.area?this.area?.line?.material:null].forEach((e=>{e&&(e.depthTest=!t,e.needsUpdate=!t,e.transparent=!0,e.side=be.DoubleSide)})),this.line&&(this.line.renderOrder=t?Bu.RENDER_ORDER:0),this.area&&(this.area.renderOrder=t?Bu.RENDER_ORDER:0)}_updateDistancePoints(){this.pointsGroup.clear();const t=this.area.vertices.map((t=>[t.x,t.y||this.area.position.y,t.z]));if(this.area.mesh){const i=this.area.centerPos;i[2]=i[1],i[1]=t[0][1];const r=_o(this.area.vertices);if(this.areaValue=r,r>0){var e=this.createLabel(i,{text:this.result,center:[.5,.5]});e.position.y+=.05,e.renderOrder=999}}t.forEach(((t,e)=>{this.createLabel(t,{icon:"thing-point",center:this.option.pointOffset})})),this.root.locked=!0}getPoints(){return this.area.getPoints().map((t=>[t[0],this.area.position.y||0,t[2]]))}addPoint(t){0==this.area.vertices.length&&this.setHelper(t),this.area.addPoint(t),this._updateDistancePoints()}updateHelper(t){this.area.vertices.length>2?this.clearHelper():(1==this.helperLine.vertices.length&&this.helperLine.addPoint(t),this.helperLine.setPoint(1,t))}}});const Xu=be.ObjectLoader;const Wu=be.ObjectLoader;class Yu extends jh{constructor(t,e,i){super(t),this.type="SetMaterialCommand",this.name="Set Material",this.updatable=!0,this.object=e,this.materialSlot=Q(i.slot)?this.getSlotIndex(i.slot):i.slot;let r=this.editor.getObjectMaterial(e,this.materialSlot);this.oldMaterial=r&&r.clone(),this.newValue=et(i);let n={};for(const t in i)n[t]=e.option?e.option[t]:void 0;this.oldValue=n}getSlotIndex(t){return this.object.materialSlot?this.object.materialSlot[t]:0}execute(){this.object.updateMaterial(this.newValue),this.editor.signals.materialChanged.dispatch(this.object)}undo(){this.editor.setObjectMaterial(this.object,this.materialSlot,this.oldMaterial.clone()),this.editor.signals.materialChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=null,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}const Qu=be.ObjectLoader;const Ju=be.Vector3;class Zu extends jh{constructor(t,e,i,r){super(t),this.type="SetPositionCommand",this.name="Set Position",this.updatable=!0,this.object=e,void 0!==e&&void 0!==i&&(this.oldPosition=e.position.clone(),this.newPosition=ti(i).clone()),void 0!==r&&(this.oldPosition=ti(r).clone())}execute(){this.object.position.copy(this.newPosition),this.object.updateMatrixWorld(!0),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.position.copy(this.oldPosition),this.object.updateMatrixWorld(!0),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newPosition.copy(t.newPosition)}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldPosition=this.oldPosition.toArray(),t.newPosition=this.newPosition.toArray(),t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.oldPosition=(new Ju).fromArray(t.oldPosition),this.newPosition=(new Ju).fromArray(t.newPosition)}}const qu=be.Euler;class Ku extends jh{constructor(t,e,i,r){super(t),this.type="SetRotationCommand",this.name="Set Rotation",this.updatable=!0,this.object=e,void 0!==e&&void 0!==i&&(this.oldRotation=e.rotation.clone(),this.newRotation=i.clone()),void 0!==r&&(this.oldRotation=r.clone())}execute(){this.object.rotation.copy(this.newRotation),this.object.updateMatrixWorld(!0),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.rotation.copy(this.oldRotation),this.object.updateMatrixWorld(!0),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newRotation.copy(t.newRotation)}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldRotation=this.oldRotation.toArray(),t.newRotation=this.newRotation.toArray(),t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.oldRotation=(new qu).fromArray(t.oldRotation),this.newRotation=(new qu).fromArray(t.newRotation)}}const $u=be.Vector3;class tp extends jh{constructor(t,e,i,r){super(t),this.type="SetScaleCommand",this.name="Set Scale",this.updatable=!0,this.object=e,void 0!==e&&void 0!==i&&(this.oldScale=e.scale.clone(),this.newScale=ti(i).clone()),void 0!==r&&(this.oldScale=ti(r).clone())}execute(){this.object.scale.copy(this.newScale),this.object.updateMatrixWorld(!0),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.scale.copy(this.oldScale),this.object.updateMatrixWorld(!0),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newScale.copy(t.newScale)}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldScale=this.oldScale.toArray(),t.newScale=this.newScale.toArray(),t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.oldScale=(new $u).fromArray(t.oldScale),this.newScale=(new $u).fromArray(t.newScale)}}class ep extends jh{constructor(t,e,i){super(t),this.type="SetUuidCommand",this.name="Update UUID",this.object=e,this.oldUuid=void 0!==e?e.uuid:void 0,this.newUuid=i}execute(){this.object.uuid=this.newUuid,this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.object.uuid=this.oldUuid,this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}toJSON(){const t=super.toJSON(this);return t.oldUuid=this.oldUuid,t.newUuid=this.newUuid,t}fromJSON(t){super.fromJSON(t),this.oldUuid=t.oldUuid,this.newUuid=t.newUuid,this.object=this.editor.objectByUuid(t.oldUuid),void 0===this.object&&(this.object=this.editor.objectByUuid(t.newUuid))}}const ip=["castShadow","receiveShadow"];class rp extends jh{constructor(t,e,i,r){super(t),this.type="SetValueCommand",this.name=`Set ${i}`,this.updatable=!0,this.object=e,this.attributeName=i,this.oldValue=void 0!==e?e[i]:void 0,this.newValue=r}execute(){this.object[this.attributeName]=this.newValue,ip.includes(this.attributeName)&&this.object.traverse((t=>{t[this.attributeName]=this.newValue})),this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.object[this.attributeName]=this.oldValue,ip.includes(this.attributeName)&&this.object.traverse((t=>{t[this.attributeName]=this.oldValue})),this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.attributeName=this.attributeName,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}class np extends jh{constructor(t,e,i,r){super(t),this.type="SetPointsCommand",this.name="Set Points",this.updatable=!0,this.object=e,this.oldValue=r||(e.getPoints?e.getPoints():e.points||[]),this.newValue=i}execute(){this.object.updatePoints(this.newValue),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.updatePoints(this.oldValue),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}class sp extends jh{constructor(t,e,i,r){super(t),this.type="SetGeometryConfigCommand",this.name="Set Geometry Config",this.updatable=!0,this.object=e,this.oldValue=r||et(e.option.geometry)||{},this.newValue=i}execute(){this.object.updateBy({geometry:this.newValue}),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.updateBy({geometry:this.oldValue}),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}class op extends jh{constructor(t,e,i,r){super(t),this.type="SetArrowCommand",this.name="Set Arrow",this.updatable=!0,this.object=e,this.oldValue=r||et(e.option.arrow)||{},this.newValue=i}execute(){this.object.updateBy({arrow:this.newValue}),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.updateBy({arrow:this.oldValue}),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}class ap extends jh{constructor(t,e,i,r){super(t),this.type="SetLineCommand",this.name="Set Line",this.updatable=!0,this.object=e,this.oldValue=r||et(e.option.line)||{},this.newValue=i}execute(){this.object.updateBy({line:this.newValue}),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.updateBy({line:this.oldValue}),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}class lp extends jh{constructor(t,e,i,r){super(t),this.type="SetPolygonCommand",this.name="Set Polygon",this.updatable=!0,this.object=e,this.oldValue=r||et(e.option.polygon)||{},this.newValue=i}execute(){this.object.updateBy({polygon:this.newValue}),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object.updateBy({polygon:this.oldValue}),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}var hp=Object.freeze({__proto__:null,AddObjectCommand:zh,MoveObjectCommand:Gh,AddMeasureCommand:class extends jh{constructor(t,e){super(t),this.type="AddMeasureCommand",this.measure=e,void 0!==e&&(this.name=`Add Measure: ${e.type} - ${e.result}`)}execute(){this.editor.viewer.measureControl.addMeasure(this.measure),this.editor.signals.measureChanged.dispatch(this.measure)}undo(){this.editor.viewer.measureControl.removeMeasure(this.measure),this.editor.signals.measureChanged.dispatch()}toJSON(){const t=super.toJSON(this);return t.measure=this.measure.toJSON(),t}fromJSON(t){super.fromJSON(t),this.measure=this.editor.viewer.measureControl.getMeasure(t.measure.id),void 0===this.measure&&(this.measure=new Hu[t.measure.type])}},RemoveMeasureCommand:class extends jh{constructor(t,e){super(t),this.type="RemoveMeasureCommand",this.measure=e,void 0!==e&&(this.name=`Removed Measure: ${e.type} - ${e.result}`)}execute(){this.editor.viewer.measureControl.removeMeasure(this.measure),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.editor.viewer.measureControl.addMeasure(this.measure),this.editor.signals.sceneGraphChanged.dispatch()}toJSON(){const t=super.toJSON(this);return t.measure=this.measure.toJSON(),t}fromJSON(t){super.fromJSON(t),this.measure=this.editor.viewer.measureControl.getMeasure(t.measure.id),void 0===this.measure&&(this.measure=new Hu[t.measure.type])}},MultiCmdsCommand:class extends jh{constructor(t,e){super(t),this.type="MultiCmdsCommand",this.name="Multiple Changes",this.cmdArray=void 0!==e?e:[]}execute(){this.editor.signals.sceneGraphChanged.active=!1;for(let t=0;t<this.cmdArray.length;t++)this.cmdArray[t].execute();this.editor.signals.sceneGraphChanged.active=!0,this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.editor.signals.sceneGraphChanged.active=!1;for(let t=this.cmdArray.length-1;t>=0;t--)this.cmdArray[t].undo();this.editor.signals.sceneGraphChanged.active=!0,this.editor.signals.sceneGraphChanged.dispatch()}toJSON(){const t=super.toJSON(this),e=[];for(let t=0;t<this.cmdArray.length;t++)e.push(this.cmdArray[t].toJSON());return t.cmds=e,t}fromJSON(t){super.fromJSON(t);const e=t.cmds;for(let t=0;t<e.length;t++){const i=new window[e[t].type];i.fromJSON(e[t]),this.cmdArray.push(i)}}},RemoveObjectCommand:class extends jh{constructor(t,e){super(t),this.type="RemoveObjectCommand",this.name="Remove Object",this.object=e,this.parent=void 0!==e?e.parent:void 0,void 0!==this.parent&&(this.index=this.parent.children.indexOf(this.object))}execute(){this.editor.removeObject(this.object),this.object==this.editor.selected&&this.editor.deselect()}undo(){this.editor.addObject(this.object,this.parent,this.index),this.editor.select(this.object)}toJSON(){const t=super.toJSON(this);return t.object=this.object.toJSON(),t.index=this.index,t.parentUuid=this.parent.uuid,t}fromJSON(t){if(super.fromJSON(t),this.parent=this.editor.objectByUuid(t.parentUuid),void 0===this.parent&&(this.parent=this.editor.scene),this.index=t.index,this.object=this.editor.objectByUuid(t.object.object.uuid),void 0===this.object){const e=new Xu;this.object=e.parse(t.object)}}},SetColorCommand:class extends jh{constructor(t,e,i,r){super(t),this.type="SetColorCommand",this.name=`Set ${i}`,this.updatable=!0,this.object=e,this.attributeName=i,this.oldValue=void 0!==e?this.object[this.attributeName].getHex():void 0,this.newValue=r}execute(){this.object[this.attributeName].setHex(this.newValue),this.editor.signals.objectChanged.dispatch(this.object)}undo(){this.object[this.attributeName].setHex(this.oldValue),this.editor.signals.objectChanged.dispatch(this.object)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.attributeName=this.attributeName,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue}},SetGeometryCommand:class extends jh{constructor(t,e,i){super(t),this.type="SetGeometryCommand",this.name="Set Geometry",this.updatable=!0,this.object=e,this.oldGeometry=void 0!==e?e.geometry:void 0,this.newGeometry=i}execute(){this.object.geometry.dispose(),this.object.geometry=this.newGeometry,this.object.geometry.computeBoundingSphere(),this.editor.signals.geometryChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.object.geometry.dispose(),this.object.geometry=this.oldGeometry,this.object.geometry.computeBoundingSphere(),this.editor.signals.geometryChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}update(t){this.newGeometry=t.newGeometry}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldGeometry=this.object.geometry.toJSON(),t.newGeometry=this.newGeometry.toJSON(),t}fromJSON(t){function e(t){return(new Wu).parseGeometries([t])[t.uuid]}super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.oldGeometry=e(t.oldGeometry),this.newGeometry=e(t.newGeometry)}},SetGeometryValueCommand:class extends jh{constructor(t,e,i,r){super(t),this.type="SetGeometryValueCommand",this.name=`Set Geometry.${i}`,this.object=e,this.attributeName=i,this.oldValue=void 0!==e?e.geometry[i]:void 0,this.newValue=r}execute(){this.object.geometry[this.attributeName]=this.newValue,this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.geometryChanged.dispatch(),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.object.geometry[this.attributeName]=this.oldValue,this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.geometryChanged.dispatch(),this.editor.signals.sceneGraphChanged.dispatch()}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.attributeName=this.attributeName,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue}},SetMaterialColorCommand:class extends jh{constructor(t,e,i,r,n){super(t),this.type="SetMaterialColorCommand",this.name=`Set Material.${i}`,this.updatable=!0,this.object=e,this.material=void 0!==this.object?this.editor.getObjectMaterial(e,n):void 0,this.oldValue=void 0!==this.material?this.material[i].getHex():void 0,this.newValue=r,this.attributeName=i}execute(){this.material[this.attributeName].setHex(this.newValue),this.editor.signals.materialChanged.dispatch(this.material)}undo(){this.material[this.attributeName].setHex(this.oldValue),this.editor.signals.materialChanged.dispatch(this.material)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.attributeName=this.attributeName,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue}},SetMaterialCommand:Yu,SetMaterialMapCommand:class extends jh{constructor(t,e,i,r,n){super(t),this.type="SetMaterialMapCommand",this.name=`Set Material.${i}`,this.object=e,this.material=this.editor.getObjectMaterial(e,n),this.oldMap=void 0!==e?this.material[i]:void 0,this.newMap=r,this.mapName=i}execute(){null!==this.oldMap&&void 0!==this.oldMap&&this.oldMap.dispose(),this.material[this.mapName]=this.newMap,this.material.needsUpdate=!0,this.editor.signals.materialChanged.dispatch(this.material)}undo(){this.material[this.mapName]=this.oldMap,this.material.needsUpdate=!0,this.editor.signals.materialChanged.dispatch(this.material)}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.mapName=this.mapName,t.newMap=e(this.newMap),t.oldMap=e(this.oldMap),t;function e(t){if(null==t)return null;const e={geometries:{},materials:{},textures:{},images:{}},i=t.toJSON(e),r=function(t){const e=[];for(const i in t){const r=t[i];delete r.metadata,e.push(r)}return e}(e.images);return r.length>0&&(i.images=r),i.sourceFile=t.sourceFile,i}}fromJSON(t){function e(t){let e=null;if(null!==t){const i=new Qu,r=i.parseImages(t.images);e=i.parseTextures([t],r)[t.uuid],e.sourceFile=t.sourceFile}return e}super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.mapName=t.mapName,this.oldMap=e(t.oldMap),this.newMap=e(t.newMap)}},SetMaterialValueCommand:class extends jh{constructor(t,e,i,r,n){super(t),this.type="SetMaterialValueCommand",this.name=`Set Material.${i}`,this.updatable=!0,this.object=e,this.material=this.editor.getObjectMaterial(e,n),this.oldValue=void 0!==this.material?this.material[i]:void 0,this.newValue=r,this.attributeName=i}execute(){this.material[this.attributeName]=this.newValue,this.material.needsUpdate=!0,this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.materialChanged.dispatch(this.material)}undo(){this.material[this.attributeName]=this.oldValue,this.material.needsUpdate=!0,this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.materialChanged.dispatch(this.material)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.attributeName=this.attributeName,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}},SetMaterialVectorCommand:class extends jh{constructor(t,e,i,r,n){super(t),this.type="SetMaterialColorCommand",this.name=`Set Material.${i}`,this.updatable=!0,this.object=e,this.material=this.editor.getObjectMaterial(e,n),this.oldValue=void 0!==this.material?this.material[i].toArray():void 0,this.newValue=r,this.attributeName=i}execute(){this.material[this.attributeName].fromArray(this.newValue),this.editor.signals.materialChanged.dispatch(this.material)}undo(){this.material[this.attributeName].fromArray(this.oldValue),this.editor.signals.materialChanged.dispatch(this.material)}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.attributeName=this.attributeName,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.object=this.editor.objectByUuid(t.objectUuid),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue}},SetPositionCommand:Zu,SetRotationCommand:Ku,SetScaleCommand:tp,SetSceneCommand:class extends jh{constructor(t,e){if(super(t),this.type="SetSceneCommand",this.name="Set Scene",this.cmdArray=[],void 0!==e)for(this.cmdArray.push(new ep(this.editor,this.editor.scene,e.uuid)),this.cmdArray.push(new rp(this.editor,this.editor.scene,"name",e.name)),this.cmdArray.push(new rp(this.editor,this.editor.scene,"userData",JSON.parse(JSON.stringify(e.userData))));e.children.length>0;){const t=e.children.pop();this.cmdArray.push(new zh(this.editor,t))}}execute(){this.editor.signals.sceneGraphChanged.active=!1;for(let t=0;t<this.cmdArray.length;t++)this.cmdArray[t].execute();this.editor.signals.sceneGraphChanged.active=!0,this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.editor.signals.sceneGraphChanged.active=!1;for(let t=this.cmdArray.length-1;t>=0;t--)this.cmdArray[t].undo();this.editor.signals.sceneGraphChanged.active=!0,this.editor.signals.sceneGraphChanged.dispatch()}toJSON(){const t=super.toJSON(this),e=[];for(let t=0;t<this.cmdArray.length;t++)e.push(this.cmdArray[t].toJSON());return t.cmds=e,t}fromJSON(t){super.fromJSON(t);const e=t.cmds;for(let t=0;t<e.length;t++){const i=new window[e[t].type];i.fromJSON(e[t]),this.cmdArray.push(i)}}},SetUuidCommand:ep,SetValueCommand:rp,SetPointsCommand:np,SetGeometryConfigCommand:sp,SetArrowCommand:op,SetLineCommand:ap,SetPolygonCommand:lp,SetLayersCommand:class extends jh{constructor(t,e,i){super(t),this.type="SetLayersCommand",this.name="Set Layers",this.updatable=!0,this.object=e,this.oldValue=void 0!==e?e.layers.getChannel():0,this.newValue=i}execute(){this.object.traverse((t=>{t.layers.set(this.newValue)})),this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}undo(){this.object.traverse((t=>{t.layers.set(this.oldValue)})),this.editor.signals.objectChanged.dispatch(this.object),this.editor.signals.sceneGraphChanged.dispatch()}update(t){this.newValue=t.newValue}toJSON(){const t=super.toJSON(this);return t.objectUuid=this.object.uuid,t.oldValue=this.oldValue,t.newValue=this.newValue,t}fromJSON(t){super.fromJSON(t),this.attributeName=t.attributeName,this.oldValue=t.oldValue,this.newValue=t.newValue,this.object=this.editor.objectByUuid(t.objectUuid)}}});function cp(t){this.enable=!0,this.editor=t,this.undos=[],this.redos=[],this.lastCmdTime=new Date,this.idCounter=0,this.historyDisabled=!1,this.config=t.config;const e=this;this.editor.signals.startPlayer.add((function(){e.historyDisabled=!0})),this.editor.signals.stopPlayer.add((function(){e.historyDisabled=!1}))}
/** @license
* JS Signals <http://millermedeiros.github.com/js-signals/>
* https://www.cnblogs.com/catherinezyr/p/7403485.html
* Released under the MIT license
* Author: Miller Medeiros
* Version: 1.0.0 - Build: 268 (2012/11/29 05:48 PM)
*/
function dp(t,e,i,r,n){this._listener=e,this._isOnce=i,this.context=r,this._signal=t,this._priority=n||0}function up(t,e){if("function"!=typeof t)throw new Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",e))}function pp(){this._bindings=[],this._prevParams=null;var t=this;this.dispatch=function(){pp.prototype.dispatch.apply(t,arguments)}}cp.prototype={execute:function(t,e){if(!this.enable)return;const i=this.undos[this.undos.length-1],r=(new Date).getTime()-this.lastCmdTime.getTime(),n=i&&i.updatable&&t.updatable&&i.object===t.object&&i.type===t.type&&i.script===t.script&&i.attributeName===t.attributeName;n&&"SetScriptValueCommand"===t.type||n&&r<500?(i.update(t),t=i):(this.undos.push(t),t.id=++this.idCounter),t.name=void 0!==e?e:t.name,t.execute(),t.inMemory=!0,this.config.getKey("settings/history")&&(t.json=t.toJSON()),this.lastCmdTime=new Date,this.redos=[],this.editor.signals.historyChanged.dispatch(t)},undo:function(){if(!this.enable)return;if(this.historyDisabled)return void alert("Undo/Redo disabled while scene is playing.");let t;return this.undos.length>0&&(t=this.undos.pop(),!1===t.inMemory&&t.fromJSON(t.json)),void 0!==t&&(t.undo(),this.redos.push(t),this.editor.signals.historyChanged.dispatch(t)),t},redo:function(){if(!this.enable)return;if(this.historyDisabled)return void alert("Undo/Redo disabled while scene is playing.");let t;return this.redos.length>0&&(t=this.redos.pop(),!1===t.inMemory&&t.fromJSON(t.json)),void 0!==t&&(t.execute(),this.undos.push(t),this.editor.signals.historyChanged.dispatch(t)),t},toJSON:function(){const t={undos:[],redos:[]};if(!this.config.getKey("settings/history"))return t;for(let e=0;e<this.undos.length;e++)this.undos[e].hasOwnProperty("json")&&t.undos.push(this.undos[e].json);for(let e=0;e<this.redos.length;e++)this.redos[e].hasOwnProperty("json")&&t.redos.push(this.redos[e].json);return t},fromJSON:function(t){if(void 0!==t){for(let e=0;e<t.undos.length;e++){const i=t.undos[e],r=new hp[i.type](this.editor);r.json=i,r.id=i.id,r.name=i.name,this.undos.push(r),this.idCounter=i.id>this.idCounter?i.id:this.idCounter}for(let e=0;e<t.redos.length;e++){const i=t.redos[e],r=new hp[i.type](this.editor);r.json=i,r.id=i.id,r.name=i.name,this.redos.push(r),this.idCounter=i.id>this.idCounter?i.id:this.idCounter}this.editor.signals.historyChanged.dispatch(this.undos[this.undos.length-1])}},clear:function(){this.undos=[],this.redos=[],this.idCounter=0,this.editor.signals.historyChanged.dispatch()},goToState:function(t){if(!this.enable)return;if(this.historyDisabled)return void alert("Undo/Redo disabled while scene is playing.");this.editor.signals.sceneGraphChanged.active=!1,this.editor.signals.historyChanged.active=!1;let e=this.undos.length>0?this.undos[this.undos.length-1]:void 0;if(void 0===e||t>e.id)for(e=this.redo();void 0!==e&&t>e.id;)e=this.redo();else for(;e=this.undos[this.undos.length-1],void 0!==e&&t!==e.id;)this.undo();this.editor.signals.sceneGraphChanged.active=!0,this.editor.signals.historyChanged.active=!0,this.editor.signals.sceneGraphChanged.dispatch(),this.editor.signals.historyChanged.dispatch(e)},enableSerialization:function(t){this.goToState(-1),this.editor.signals.sceneGraphChanged.active=!1,this.editor.signals.historyChanged.active=!1;let e=this.redo();for(;void 0!==e;)e.hasOwnProperty("json")||(e.json=e.toJSON()),e=this.redo();this.editor.signals.sceneGraphChanged.active=!0,this.editor.signals.historyChanged.active=!0,this.goToState(t)}},dp.prototype={active:!0,params:null,execute:function(t){var e,i;return this.active&&this._listener&&(i=this.params?this.params.concat(t):t,e=this._listener.apply(this.context,i),this._isOnce&&this.detach()),e},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},pp.prototype={VERSION:"1.0.0",memorize:!1,_shouldPropagate:!0,active:!0,_registerListener:function(t,e,i,r){var n,s=this._indexOfListener(t,i);if(-1!==s){if((n=this._bindings[s]).isOnce()!==e)throw new Error("You cannot add"+(e?"":"Once")+"() then add"+(e?"Once":"")+"() the same listener without removing the relationship first.")}else n=new dp(this,t,e,i,r),this._addBinding(n);return this.memorize&&this._prevParams&&n.execute(this._prevParams),n},_addBinding:function(t){var e=this._bindings.length;do{--e}while(this._bindings[e]&&t._priority<=this._bindings[e]._priority);this._bindings.splice(e+1,0,t)},_indexOfListener:function(t,e){for(var i,r=this._bindings.length;r--;)if((i=this._bindings[r])._listener===t&&i.context===e)return r;return-1},has:function(t,e){return-1!==this._indexOfListener(t,e)},add:function(t,e,i){return up(t,"add"),this._registerListener(t,!1,e,i)},addOnce:function(t,e,i){return up(t,"addOnce"),this._registerListener(t,!0,e,i)},remove:function(t,e){up(t,"remove");var i=this._indexOfListener(t,e);return-1!==i&&(this._bindings[i]._destroy(),this._bindings.splice(i,1)),t},removeAll:function(){for(var t=this._bindings.length;t--;)this._bindings[t]._destroy();this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate=!1},dispatch:function(t){if(this.active){var e,i=Array.prototype.slice.call(arguments),r=this._bindings.length;if(this.memorize&&(this._prevParams=i),r){e=this._bindings.slice(),this._shouldPropagate=!0;do{r--}while(e[r]&&this._shouldPropagate&&!1!==e[r].execute(i))}}},forget:function(){this._prevParams=null},dispose:function(){this.removeAll(),delete this._bindings,delete this._prevParams},toString:function(){return"[Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}};const mp=pp;function fp(){const t="ThingJS.Editor",e={language:"zh",autosave:!0,"project/title":"","project/editable":!1,"project/vr":!1,"project/renderer/antialias":!0,"project/renderer/shadows":!0,"project/renderer/shadowType":1,"project/renderer/physicallyCorrectLights":!1,"project/renderer/toneMapping":0,"project/renderer/toneMappingExposure":1,"settings/history":!1,"settings/shortcuts/translate":"w","settings/shortcuts/rotate":"e","settings/shortcuts/scale":"r","settings/shortcuts/undo":"z","settings/shortcuts/focus":"f"};if(void 0===window.localStorage[t])window.localStorage[t]=JSON.stringify(e);else{const i=JSON.parse(window.localStorage[t]);for(const t in i)e[t]=i[t]}return{getKey:function(t){return e[t]},setKey:function(){for(let t=0,i=arguments.length;t<i;t+=2)e[arguments[t]]=arguments[t+1];window.localStorage[t]=JSON.stringify(e),console.log("["+/\d\d\:\d\d\:\d\d/.exec(new Date)[0]+"]","Saved config to LocalStorage.")},clear:function(){delete window.localStorage[t]}}}mp.Signal=pp;const{BoxGeometry:gp,BufferGeometry:vp,CylinderGeometry:yp,DoubleSide:wp,Euler:xp,Float32BufferAttribute:bp,Line:_p,LineBasicMaterial:Ap,Matrix4:Sp,Mesh:Tp,MeshBasicMaterial:Ep,Object3D:Pp,OctahedronGeometry:Mp,PlaneGeometry:Cp,Quaternion:Lp,Raycaster:Rp,SphereGeometry:Op,TorusGeometry:Fp,Vector3:Np}=be,Dp=new Rp,Ip=new Np,Up=new Np,Bp=new Lp,kp={X:new Np(1,0,0),Y:new Np(0,1,0),Z:new Np(0,0,1)},jp={type:"change"},Vp={type:"mouseDown"},zp={type:"mouseUp",mode:null},Gp={type:"objectChange"};class Hp extends Pp{constructor(t,e){super(),void 0===e&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const i=new dm;this._gizmo=i,this.add(i);const r=new um;this._plane=r,this.add(r);const n=this;function s(t,e){let s=e;Object.defineProperty(n,t,{get:function(){return void 0!==s?s:e},set:function(e){s!==e&&(s=e,r[t]=e,i[t]=e,n.dispatchEvent({type:t+"-changed",value:e}),n.dispatchEvent(jp))}}),n[t]=e,r[t]=e,i[t]=e}s("camera",t),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const o=new Np,a=new Np,l=new Lp,h=new Lp,c=new Np,d=new Lp,u=new Np,p=new Np,m=new Np,f=new Np;s("worldPosition",o),s("worldPositionStart",a),s("worldQuaternion",l),s("worldQuaternionStart",h),s("cameraPosition",c),s("cameraQuaternion",d),s("pointStart",u),s("pointEnd",p),s("rotationAxis",m),s("rotationAngle",0),s("eye",f),this._offset=new Np,this._startNorm=new Np,this._endNorm=new Np,this._cameraScale=new Np,this._parentPosition=new Np,this._parentQuaternion=new Lp,this._parentQuaternionInv=new Lp,this._parentScale=new Np,this._worldScaleStart=new Np,this._worldQuaternionInv=new Lp,this._worldScale=new Np,this._positionStart=new Np,this._quaternionStart=new Lp,this._scaleStart=new Np,this._getPointer=Xp.bind(this),this._onPointerDown=Yp.bind(this),this._onPointerHover=Wp.bind(this),this._onPointerMove=Qp.bind(this),this._onPointerUp=Jp.bind(this)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(t){if(void 0===this.object||!0===this.dragging)return;Dp.setFromCamera(t,this.camera);const e=Zp(this._gizmo.picker[this.mode],Dp);this.axis=e?e.object.name:null,this.dispatchEvent({type:"hoverAxis",axis:this.axis})}pointerDown(t){if(void 0!==this.object&&!0!==this.dragging&&0===t.button&&null!==this.axis){Dp.setFromCamera(t,this.camera);const e=Zp(this._plane,Dp,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,Vp.mode=this.mode,this.dispatchEvent(Vp)}}pointerMove(t){const e=this.axis,i=this.mode,r=this.object;let n=this.space;if("scale"===i?n="local":"E"!==e&&"XYZE"!==e&&"XYZ"!==e||(n="world"),void 0===r||null===e||!1===this.dragging||-1!==t.button)return;Dp.setFromCamera(t,this.camera);const s=Zp(this._plane,Dp,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),"translate"===i)this._offset.copy(this.pointEnd).sub(this.pointStart),"local"===n&&"XYZ"!==e&&this._offset.applyQuaternion(this._worldQuaternionInv),-1===e.indexOf("X")&&(this._offset.x=0),-1===e.indexOf("Y")&&(this._offset.y=0),-1===e.indexOf("Z")&&(this._offset.z=0),"local"===n&&"XYZ"!==e?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&("local"===n&&(r.position.applyQuaternion(Bp.copy(this._quaternionStart).invert()),-1!==e.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==e.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==e.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),"world"===n&&(r.parent&&r.position.add(Ip.setFromMatrixPosition(r.parent.matrixWorld)),-1!==e.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==e.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==e.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(Ip.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===i){if(-1!==e.search("XYZ")){let t=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(t*=-1),Up.set(t,t,t)}else Ip.copy(this.pointStart),Up.copy(this.pointEnd),Ip.applyQuaternion(this._worldQuaternionInv),Up.applyQuaternion(this._worldQuaternionInv),Up.divide(Ip),-1===e.search("X")&&(Up.x=1),-1===e.search("Y")&&(Up.y=1),-1===e.search("Z")&&(Up.z=1);r.scale.copy(this._scaleStart).multiply(Up),this.scaleSnap&&(-1!==e.search("X")&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==e.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==e.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===i){this._offset.copy(this.pointEnd).sub(this.pointStart);const t=20/this.worldPosition.distanceTo(Ip.setFromMatrixPosition(this.camera.matrixWorld));"E"===e?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):"XYZE"===e?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Ip.copy(this.rotationAxis).cross(this.eye))*t):"X"!==e&&"Y"!==e&&"Z"!==e||(this.rotationAxis.copy(kp[e]),Ip.copy(kp[e]),"local"===n&&Ip.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(Ip.cross(this.eye).normalize())*t),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===n&&"E"!==e&&"XYZE"!==e?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(Bp.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(Bp.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(jp),this.dispatchEvent(Gp)}}pointerUp(t){0===t.button&&(this.dragging&&null!==this.axis&&(zp.mode=this.mode,this.dispatchEvent(zp)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))}attach(t){return this.object=t,this.visible=!0,this}detach(){const t=this.object;return t&&t.isHtmlPlane&&t.children[1]&&(t.children[1].visible=!0),this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(jp),this.dispatchEvent(Gp),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Dp}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}setEnable(t){this.enabled=t,t?(this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)):(this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointerup",this._onPointerUp))}}function Xp(t){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:t.button};{const e=this.domElement.getBoundingClientRect();return{x:(t.clientX-e.left)/e.width*2-1,y:-(t.clientY-e.top)/e.height*2+1,button:t.button}}}function Wp(t){if(this.enabled)switch(t.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(t))}}function Yp(t){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(t)),this.pointerDown(this._getPointer(t)))}function Qp(t){this.enabled&&this.pointerMove(this._getPointer(t))}function Jp(t){this.enabled&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(t)))}function Zp(t,e,i){const r=e.intersectObject(t,!0);for(let t=0;t<r.length;t++)if(r[t].object.visible||i)return r[t];return!1}Hp.prototype.isTransformControls=!0;const qp=new xp,Kp=new Np(0,1,0),$p=new Np(0,0,0),tm=new Sp,em=new Lp,im=new Lp,rm=new Sp,nm=new Np,sm=new Np(1,0,0),om=new Np(0,1,0),am=new Np(0,0,1),lm=new Np,hm=new Np,cm=new Np;class dm extends Pp{constructor(){super(),this.type="TransformControlsGizmo";const t=new Ep({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new Ap({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=t.clone();i.opacity=.15;const r=e.clone();r.opacity=.5;const n=t.clone();n.color.setHex(16711680);const s=t.clone();s.color.setHex(65280);const o=t.clone();o.color.setHex(255);const a=t.clone();a.color.setHex(16711680),a.opacity=.5;const l=t.clone();l.color.setHex(65280),l.opacity=.5;const h=t.clone();h.color.setHex(255),h.opacity=.5;const c=t.clone();c.opacity=.25;const d=t.clone();d.color.setHex(16776960),d.opacity=.25;t.clone().color.setHex(16776960);const u=t.clone();u.color.setHex(7895160);const p=new yp(0,.04,.1,12);p.translate(0,.05,0);const m=new gp(.08,.08,.08);m.translate(0,.04,0);const f=new vp;f.setAttribute("position",new bp([0,0,0,1,0,0],3));const g=new yp(.0075,.0075,.5,3);function v(t,e){const i=new Fp(t,.0075,3,64,e*Math.PI*2);return i.rotateY(Math.PI/2),i.rotateX(Math.PI/2),i}g.translate(0,.25,0);const y={X:[[new Tp(p,n),[.5,0,0],[0,0,-Math.PI/2]],[new Tp(p,n),[-.5,0,0],[0,0,Math.PI/2]],[new Tp(g,n),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new Tp(p,s),[0,.5,0]],[new Tp(p,s),[0,-.5,0],[Math.PI,0,0]],[new Tp(g,s)]],Z:[[new Tp(p,o),[0,0,.5],[Math.PI/2,0,0]],[new Tp(p,o),[0,0,-.5],[-Math.PI/2,0,0]],[new Tp(g,o),null,[Math.PI/2,0,0]]],XYZ:[[new Tp(new Mp(.1,0),c.clone()),[0,0,0]]],XY:[[new Tp(new gp(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new Tp(new gp(.15,.15,.01),a.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Tp(new gp(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new Tp(new yp(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new Tp(new yp(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Tp(new yp(.2,0,.6,4),i),[0,.3,0]],[new Tp(new yp(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Tp(new yp(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new Tp(new yp(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new Tp(new Mp(.2,0),i)]],XY:[[new Tp(new gp(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new Tp(new gp(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Tp(new gp(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new Tp(new Mp(.01,2),r),null,null,null,"helper"]],END:[[new Tp(new Mp(.01,2),r),null,null,null,"helper"]],DELTA:[[new _p(function(){const t=new vp;return t.setAttribute("position",new bp([0,0,0,1,1,1],3)),t}(),r),null,null,null,"helper"]],X:[[new _p(f,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new _p(f,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new _p(f,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},b={XYZE:[[new Tp(v(.5,1),u),null,[0,Math.PI/2,0]]],X:[[new Tp(v(.5,.5),n)]],Y:[[new Tp(v(.5,.5),s),null,[0,0,-Math.PI/2]]],Z:[[new Tp(v(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new Tp(v(.75,1),d),null,[0,Math.PI/2,0]]]},_={AXIS:[[new _p(f,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},A={XYZE:[[new Tp(new Op(.25,10,8),i)]],X:[[new Tp(new Fp(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Tp(new Fp(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Tp(new Fp(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Tp(new Fp(.75,.1,2,24),i)]]},S={X:[[new Tp(m,n),[.5,0,0],[0,0,-Math.PI/2]],[new Tp(g,n),[0,0,0],[0,0,-Math.PI/2]],[new Tp(m,n),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new Tp(m,s),[0,.5,0]],[new Tp(g,s)],[new Tp(m,s),[0,-.5,0],[0,0,Math.PI]]],Z:[[new Tp(m,o),[0,0,.5],[Math.PI/2,0,0]],[new Tp(g,o),[0,0,0],[Math.PI/2,0,0]],[new Tp(m,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new Tp(new gp(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new Tp(new gp(.15,.15,.01),a),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Tp(new gp(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Tp(new gp(.1,.1,.1),c.clone())]]},T={X:[[new Tp(new yp(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new Tp(new yp(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Tp(new yp(.2,0,.6,4),i),[0,.3,0]],[new Tp(new yp(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Tp(new yp(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new Tp(new yp(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new Tp(new gp(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new Tp(new gp(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Tp(new gp(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Tp(new gp(.2,.2,.2),i),[0,0,0]]]},E={X:[[new _p(f,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new _p(f,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new _p(f,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function P(t){const e=new Pp;for(const i in t)for(let r=t[i].length;r--;){const n=t[i][r][0].clone(),s=t[i][r][1],o=t[i][r][2],a=t[i][r][3],l=t[i][r][4];n.name=i,n.tag=l,s&&n.position.set(s[0],s[1],s[2]),o&&n.rotation.set(o[0],o[1],o[2]),a&&n.scale.set(a[0],a[1],a[2]),n.updateMatrix();const h=n.geometry.clone();h.applyMatrix4(n.matrix),n.geometry=h,n.renderOrder=1/0,n.position.set(0,0,0),n.rotation.set(0,0,0),n.scale.set(1,1,1),e.add(n)}return e}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=P(y)),this.add(this.gizmo.rotate=P(b)),this.add(this.gizmo.scale=P(S)),this.add(this.picker.translate=P(w)),this.add(this.picker.rotate=P(A)),this.add(this.picker.scale=P(T)),this.add(this.helper.translate=P(x)),this.add(this.helper.rotate=P(_)),this.add(this.helper.scale=P(E)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const e="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:im;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let t=0;t<i.length;t++){const r=i[t];let n;if(r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition),n=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(n*this.size/4),"helper"!==r.tag){if(r.quaternion.copy(e),"translate"===this.mode||"scale"===this.mode){const t=.99,i=.2;"X"===r.name&&Math.abs(Kp.copy(sm).applyQuaternion(e).dot(this.eye))>t&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Y"===r.name&&Math.abs(Kp.copy(om).applyQuaternion(e).dot(this.eye))>t&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Z"===r.name&&Math.abs(Kp.copy(am).applyQuaternion(e).dot(this.eye))>t&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XY"===r.name&&Math.abs(Kp.copy(am).applyQuaternion(e).dot(this.eye))<i&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"YZ"===r.name&&Math.abs(Kp.copy(sm).applyQuaternion(e).dot(this.eye))<i&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XZ"===r.name&&Math.abs(Kp.copy(om).applyQuaternion(e).dot(this.eye))<i&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else"rotate"===this.mode&&(em.copy(e),Kp.copy(this.eye).applyQuaternion(Bp.copy(e).invert()),-1!==r.name.search("E")&&r.quaternion.setFromRotationMatrix(tm.lookAt(this.eye,$p,om)),"X"===r.name&&(Bp.setFromAxisAngle(sm,Math.atan2(-Kp.y,Kp.z)),Bp.multiplyQuaternions(em,Bp),r.quaternion.copy(Bp)),"Y"===r.name&&(Bp.setFromAxisAngle(om,Math.atan2(Kp.x,Kp.z)),Bp.multiplyQuaternions(em,Bp),r.quaternion.copy(Bp)),"Z"===r.name&&(Bp.setFromAxisAngle(am,Math.atan2(Kp.y,Kp.x)),Bp.multiplyQuaternions(em,Bp),r.quaternion.copy(Bp)));r.visible=r.visible&&(-1===r.name.indexOf("X")||this.showX),r.visible=r.visible&&(-1===r.name.indexOf("Y")||this.showY),r.visible=r.visible&&(-1===r.name.indexOf("Z")||this.showZ),r.visible=r.visible&&(-1===r.name.indexOf("E")||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some((function(t){return r.name===t})))&&(r.material.color.setHex(16776960),r.material.opacity=1)}else r.visible=!1,"AXIS"===r.name?(r.position.copy(this.worldPositionStart),r.visible=!!this.axis,"X"===this.axis&&(Bp.setFromEuler(qp.set(0,0,0)),r.quaternion.copy(e).multiply(Bp),Math.abs(Kp.copy(sm).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),"Y"===this.axis&&(Bp.setFromEuler(qp.set(0,0,Math.PI/2)),r.quaternion.copy(e).multiply(Bp),Math.abs(Kp.copy(om).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),"Z"===this.axis&&(Bp.setFromEuler(qp.set(0,Math.PI/2,0)),r.quaternion.copy(e).multiply(Bp),Math.abs(Kp.copy(am).applyQuaternion(e).dot(this.eye))>.9&&(r.visible=!1)),"XYZE"===this.axis&&(Bp.setFromEuler(qp.set(0,Math.PI/2,0)),Kp.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(tm.lookAt($p,Kp,om)),r.quaternion.multiply(Bp),r.visible=this.dragging),"E"===this.axis&&(r.visible=!1)):"START"===r.name?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):"END"===r.name?(r.position.copy(this.worldPosition),r.visible=this.dragging):"DELTA"===r.name?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Ip.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Ip.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Ip),r.visible=this.dragging):(r.quaternion.copy(e),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=-1!==this.axis.search(r.name)))}super.updateMatrixWorld(t)}}dm.prototype.isTransformControlsGizmo=!0;class um extends Tp{constructor(){super(new Cp(1e5,1e5,2,2),new Ep({visible:!1,wireframe:!0,side:wp,transparent:!0,opacity:.1,toneMapped:!1})),this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(e="local"),lm.copy(sm).applyQuaternion("local"===e?this.worldQuaternion:im),hm.copy(om).applyQuaternion("local"===e?this.worldQuaternion:im),cm.copy(am).applyQuaternion("local"===e?this.worldQuaternion:im),Kp.copy(hm),this.mode){case"translate":case"scale":switch(this.axis){case"X":Kp.copy(this.eye).cross(lm),nm.copy(lm).cross(Kp);break;case"Y":Kp.copy(this.eye).cross(hm),nm.copy(hm).cross(Kp);break;case"Z":Kp.copy(this.eye).cross(cm),nm.copy(cm).cross(Kp);break;case"XY":nm.copy(cm);break;case"YZ":nm.copy(lm);break;case"XZ":Kp.copy(cm),nm.copy(hm);break;case"XYZ":case"E":nm.set(0,0,0)}break;default:nm.set(0,0,0)}0===nm.length()?this.quaternion.copy(this.cameraQuaternion):(rm.lookAt(Ip.set(0,0,0),nm,Kp),this.quaternion.setFromRotationMatrix(rm)),super.updateMatrixWorld(t)}}um.prototype.isTransformControlsPlane=!0;class pm extends be.Group{constructor(){super(),this.isTransformControlsGroup=!0,this.matrixWorldNeedsUpdate=!0,this.tempMatrix=new be.Matrix4,this.userData.selected=[],this.userData.prevParent=[],this.control=null,this._copy=new be.Group}reset(){this.userData.selected=[],this.userData.prevParent=[],this.position.set(0,0,0),this.scale.set(1,1,1),this.rotation.set(0,0,0),this.matrix=this._copy.matrix.clone(),this.matrixWorld=this._copy.matrixWorld.clone(),this.tempMatrix=new be.Matrix4,this.quaternion.set(0,0,0,1),this.matrixWorldNeedsUpdate=!0}setSelected(t){!t||t.length<1||(t.forEach((t=>{this.userData.selected.includes(t)||(t.userData.preChildrenIndex=t.getInParentIndex())})),t.sort(((t,e)=>t.userData.preChildrenIndex-e.userData.preChildrenIndex)),t.forEach((t=>{this.userData.selected.includes(t)||(t.matrixWorldNeedsUpdate=!0,this.tempMatrix.copy(this.matrixWorld).invert(),t.matrixWorld.premultiply(this.tempMatrix).decompose(t.position,t.quaternion,t.scale),this.userData.selected.push(t),this.userData.prevParent.push(t.parent),this.add(t))})))}getCenter(){var t=(new be.Box3).setFromObject(this);const e=new be.Vector3;return t.getCenter(e),e}removeSelected(){const t=this.userData.selected,e=this.userData.prevParent;for(var i,r=0;r<t.length;r++){(i=t[r]).matrixWorldNeedsUpdate=!0,e[r].matrixWorldNeedsUpdate=!0,this.tempMatrix.copy(e[r].matrixWorld).invert(),i.matrixWorld.premultiply(this.tempMatrix).decompose(i.position,i.quaternion,i.scale),i.insertTo(e[r],i.userData.preChildrenIndex)}this.userData.selected=[],this.userData.prevParent=[],this.reset()}}class mm extends ui{constructor(t,e){super(),this.option=mt({onTop:!0,lineColor:"#FF9900",pointColor:"#FF3300",fillColor:"#FF9900",textFillColor:"#FFFFFF",textStrokeColor:"rgba(0,0,0,.6)",textStrokeWidth:2,textSize:16},e||{}),this.editor=t,this.viewer=t.viewer,this.enable=!1,this.drawing=!1,this._pickable=!0,this.points=[],this.helperRoot=new THING.Group,this.helperRoot.name="DrawControlHelperGroup",this.scene.tempRoot.add(this.helperRoot),this.adsorptionOnObject=!1,this.adsorptionOnGrid=!1,this.grid=null,ht(["_onPointerDown","_onPointerMove","_onPointerUp","_objectChangedEvent","_objectSelectedEvent"],this),this._drawLine=ut(this.__drawLine,300,this),this._drawPolygon=ut(this.__drawPolygon,300,this),this._initHelper(),this._initEvent()}_initEvent(){this.addEventListener("drawEnd",(({drawObject:t})=>{t.locked=!1,delete t._thing_tag,this.drawing=!1})),this.editor.signals.controlPointsChanged.add((t=>{const e=t.userData.controlPointType;"main"==e&&this._updatePointsByControlPoints(t),"middle"==e&&this._middelToMain(t)}))}hasControlPoints(){return this.points.length>0}_isPointType(t){return["Billboard","Box","Model","Sphere","Circle","Plane","ImageLabel","ImagePlane","ReflectorPlane","Capsule","Cone","Cylinder","Dodecahedron","Doughnut","Icosahedron","Lathe","Ring","Tetrahedron","Torus","TorusKnot"].includes(t)}_isLineType(t){return["Line","RouteLine","TubeLine","Line2","ExtrudeLine"].includes(t)}_isStartEndLineType(t){return["CurveLine","CurveTubeLine"].includes(t)}_isPolygonType(t){return["Polygon","Water","Heatmap","ExtrudePolygon"].includes(t)}_initHelper(){this.lineHelper=new THING.Line({points:[],style:{color:"#FF9900",dotSize:0}}),this.helperRoot.add(this.lineHelper),this.areaHelper=new Gc({points:[],style:{text:"",polygon:{color:this.option.fillColor,opacity:.2,side:2},line:{color:this.option.lineColor}}}),this.helperRoot.add(this.areaHelper),this.controlPointHelper=new THING.Group,this.helperRoot.add(this.controlPointHelper)}_addControlPoint(t,e,i,r){const n=new Co({position:t,center:[.5,.5],material:{depthTest:!1,depthWrite:!1,map:{text:"",icon:"",iconWidth:12,iconHeight:12,fontColor:this.option.textFillColor,strokeWidth:this.option.textStrokeWidth,color:this.option.pointColor,strokeColor:this.option.textStrokeColor,...e||{}}}});return n.userData.object=this._drawObject,n.userData.isControlPoint=!0,n.userData.controlPointType=i||"main",this._drawObject.isPolygon&&(n.position.y=this._drawObject.position.y),n.addEventListener("removed",(()=>{})),void 0!==r?n.insertTo(this.controlPointHelper,r):this.controlPointHelper.add(n),n}setControlPointPosition(t,e){"main"==t.userData.controlPointType&&(t.position.copy(ti(e)),this._updatePointsByControlPoints(t))}setLastControlPointPosition(t){const e=this.controlPointHelper.children,i=e[e.length-1];this.setControlPointPosition(i,t)}setLastControlPointWithScalar(t){if(!t||0==ti(t).lengthSq())return;const e=this.controlPointHelper.children,i=e[e.length-1].position.clone();i.add(ti(t)),this.setLastControlPointPosition(i)}setLastControlPointWithDegree(t){const e=this.controlPointHelper.children,i=e[e.length-1],r=e[e.length-3].position.clone(),n=i.position.clone();n.sub(r);const s=function(t,e,i){let r=(new be.Vector3).copy(t).dot(e);return t.addScalar(Math.cos(i)).add(e.addScalar(r*(1-Math.cos(i)))).add((new be.Vector3).crossVectors(e,t).addScalar(Math.sin(i)))}(new be.Vector3(0,1,0),n,be.MathUtils.DEG2RAD*t);this.setLastControlPointPosition(s)}addControlPoint(t){this._draw(t)}addControlPointWithScalar(t){if(!t||0==ti(t).lengthSq())return;const e=this.controlPointHelper.children,i=e[e.length-1];if(!i)return;const r=i.position.clone();r.add(ti(t)),this.addControlPoint(r)}_updateControlPoints(){this.controlPointHelper.clear();let t=new be.Vector3;t.copy(ti(this.points[0])),this.points.forEach(((e,i)=>{this._addControlPoint(e,{icon:"thing-point",center:[.5,.5]});let r=this.points[i+1];if(r){t.add(ti(r)).multiplyScalar(.5),this._addControlPoint(t,{icon:"thing-point",center:[.5,.5]},"middle").scale.setScalar(.6),t.copy(ti(r))}}))}_updateMiddleControlPointsByControlPoint(t){if("main"!==t.userData.controlPointType)return;const e=this.controlPointHelper.children;let i=-1;for(let r=0;r<e.length;r++)if(e[r]==t){i=r;break}if(i<0)return;let r=e[i-1],n=e[i-2],s=e[i+1],o=e[i+2];r&&n&&r.position.copy(n.position).add(t.position).multiplyScalar(.5),s&&o&&s.position.copy(t.position).add(o.position).multiplyScalar(.5)}_deleteControlPoint(t){if("main"!=t.userData.controlPointType)return;const e=this.controlPointHelper.children;let i=-1;for(let r=0;r<e.length;r++)if(e[r]==t){i=r;break}if(i<0)return;let r=e[i-1],n=e[i-2],s=e[i+1],o=e[i+2];if(r&&n&&r.removeFromParent(),s&&o&&s.removeFromParent(),t.removeFromParent(),n&&o){let t=new be.Vector3;t.copy(n.position).add(o.position).multiplyScalar(.5),this._addControlPoint(t,{icon:"thing-point",center:[.5,.5]},"middle",i-1).scale.setScalar(.6)}this._updatePointsByControlPoints(t)}_middelToMain(t){if(!t||"middle"!=t.userData.controlPointType)return;const e=this.controlPointHelper.children;let i=-1;for(let r=0;r<e.length;r++)if(e[r]==t){i=r;break}if(i<0)return;t.userData.controlPointType="main",t.scale.divideScalar(.6);let r=e[i-1],n=e[i+1],s=new be.Vector3;s.copy(r.position).add(t.position).multiplyScalar(.5),this._addControlPoint(s,{icon:"thing-point",center:[.5,.5]},"middle",i).scale.setScalar(.6),i+=1,s.copy(t.position).add(n.position).multiplyScalar(.5),this._addControlPoint(s,{icon:"thing-point",center:[.5,.5]},"middle",i+1).scale.setScalar(.6),this._updatePointsByControlPoints(t)}_updatePointsByControlPoints(t){if(!this._drawObject||!this._drawObject.needPoints)return;const e=this._drawObject.position.y;let i=this.controlPointHelper.children.filter((t=>"middle"!=t.userData.controlPointType)).map((t=>t.position.toArray()));i.forEach((t=>{t[1]-=e})),this.points=i,this._drawObject.updatePoints(this.points),this._drawObject.isPolygon&&(this._drawObject.position.y=t.position.y,this.controlPointHelper.children.forEach((e=>{e.position.y=t.position.y}))),this._updateMiddleControlPointsByControlPoint(t),this.editor.signals.sceneGraphChanged.dispatch()}_updateControlPointsByObject(t){if(!this._drawObject||!this._drawObject.needPoints)return;let e=this._drawObject.getPoints().map((t=>this._drawObject.localToWorld(ti(t)).toArray()));this._drawObject.position.y,this.points=e,0==e.length?this.controlPointHelper.clear():(this._updateControlPoints(),this.editor.signals.sceneGraphChanged.dispatch())}update(){this._drawObject&&this._drawObject.needPoints}_updateLine(){}_clearHelper(){this.lineHelper.setPoints([])}get camera(){return this.viewer.camera}get container(){return this.viewer.container}get scene(){return this.viewer.sceneManager.getScene()}_isComplete(){if(!this._drawObject)return!0;const t=this._drawObject,e=t.type;let i=t.vertices||t.points||t._points;return!i||(this._isLineType(e)?i.length>=2:this._isPolygonType(e)?i.length>=3:!this._isStartEndLineType(e)||2==i.length)}_drawPoint(t,e){if(!t||!e)return;const{type:i}=e;return this._drawObject=new THING[i]({position:t,...e}),this.editor.execute("AddObject",this._drawObject),this.endDraw(),this._drawObject}_addPoint(t){if(this.points.length>0){if(ti(this.points[this.points.length-1]).distanceTo(ti(t))<.001)return!1}return this.points.push(t),!0}__drawLine(t,e){if(!this.enable||!this.drawing)return;if(!this._addPoint(t))return;const{type:i,style:r,properties:n,src:s,rotation:o,avoid:a,name:l}=e;if(this._drawObject){const t=this._drawObject.getPoints();this.editor.execute(new np(this.editor,this._drawObject,this.points,t))}else this._drawObject=new THING[i]({points:this.points,properties:n,name:l}),this._drawObject.locked=!0,this._drawObject._thing_tag="helper",this._drawObject.updateBy(e),this.editor.execute("AddObject",this._drawObject);this._updateControlPoints()}__drawPolygon(t,e){if(!this.enable||!this.drawing)return;if(!this._addPoint(t))return;const{type:i,style:r,properties:n,src:s,rotation:o,avoid:a,name:l,material:h,polygon:c,line:d}=e;if(this._drawObject){const t=this._drawObject.getPoints();this.editor.execute(new np(this.editor,this._drawObject,this.points,t))}else this._drawObject=new THING[i]({...e,points:this.points.map((t=>ti(t)))}),this._drawObject.position.y=this.points[0][1],h&&h.depth&&(this._drawObject.position.y+=h.depth/2),this._drawObject.locked=!0,this._drawObject._thing_tag="helper",this._drawObject.updateBy(e),this.editor.execute("AddObject",this._drawObject);this._updateControlPoints()}_drawModel(){}draw(t){this._resetDraw(),this.viewer.setCursor("crosshair"),this._drawObjectConfig=t,this._drawObject=null,this.drawing=!0}setEditObject(t){this._resetDraw(),this._drawObject=t,this.points=t.getPoints(),this._updateControlPoints();const{editor:e}=this.viewer;e.signals.objectChanged.add(this._objectChangedEvent),e.signals.objectSelected.add(this._objectSelectedEvent)}endEdit(){this._resetDraw();const{editor:t}=this.viewer;t.signals.objectChanged.remove(this._objectChangedEvent),t.signals.objectSelected.remove(this._objectSelectedEvent)}endDraw(){this._drawObject&&this.dispatchEvent({type:"drawEnd",drawObject:this._drawObject}),this.drawing=!1,this._resetDraw()}setEditable(t){this._resetDraw(),this.editing=t}_resetDraw(){this.drawing=!1,this.points=[],this.controlPointHelper.clear(),this._drawObjectConfig=null,this._drawObject=null,this.viewer.setCursor(null)}_draw(t){if(!this.enable||!this._drawObjectConfig)return;const{type:e}=this._drawObjectConfig;this._isPointType(e)&&this._drawPoint(t,this._drawObjectConfig),this._isPolygonType(e)&&this._drawPolygon(t,this._drawObjectConfig),this._isLineType(e)&&this._drawLine(t,this._drawObjectConfig),this._isStartEndLineType(e)}addPoint(t){this._draw(t)}deleteLastPoint(){if(!this._drawObjectConfig)return;const{type:t}=this._drawObjectConfig;if(this._isPolygonType(t)||this._isLineType(t)){const t=this._drawObject.getPoints();this.editor.execute(new np(this.editor,this._drawObject,this.points,t)),this._updateControlPoints()}}activate(){this.enable=!0;const{container:t,editor:e}=this.viewer;t.addEventListener("pointermove",this._onPointerMove),t.addEventListener("pointerdown",this._onPointerDown),t.addEventListener("pointerup",this._onPointerUp),e.signals.objectChanged.add(this._objectChangedEvent),e.signals.objectSelected.add(this._objectSelectedEvent)}deactivate(){this.endDraw(),this.enable=!1;const{container:t,editor:e}=this.viewer;t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerdown",this._onPointerDown),t.removeEventListener("pointerup",this._onPointerUp),e.signals.objectChanged.remove(this._objectChangedEvent),e.signals.objectSelected.remove(this._objectSelectedEvent)}_objectSelectedEvent(t){t&&!this.drawing&&this._drawObject==t&&this._updateControlPointsByObject(),this.viewer.rm.enableRender()}_objectChangedEvent(t){const{editor:e,rendererManager:i}=this.viewer;if(this.hasControlPoints()&&e.selected&&!e.selected.userData.isControlPoint&&this._updateControlPointsByObject(e.selected),t.userData.isControlPoint){var r=this.controlPointHelper.children.filter((t=>"main"==t.userData.controlPointType)).map((t=>t.position.toArray()));e.execute(new np(e,t.userData.object,r))}i.enableRender()}_onPointerMove(t){this.enable}_getPosition(t){let e=null,i=this.viewer.picker.pick(t.clientX,t.clientY);return i.raycasterPicked&&(i.raycasterPicked[0]&&i.raycasterPicked[0].point&&(e=i.raycasterPicked[0].point.toArray()),e||(e=this.viewer.coordScreenToWorld(t.clientX,t.clientY))),{picked:i,position:e}}_onPointerDown(t){if(!this.enable||!this.drawing||!this.pickable)return;if(!V(t))return;let{position:e}=this._getPosition(t);this._draw(e)}_onPointerUp(){this.enable&&this.drawing}clear(){this._resetDraw(),this.root.clear()}destroy(){this.endDraw(),this.deactivate(),this.viewer.editor.signals.controlPointsChanged.removeAll()}get pickable(){return this._pickable}set pickable(t){this._pickable=t,this.viewer.setCursor(t?"crosshair":"default")}}class fm extends ui{constructor(t){super();var e=mp.Signal;this.signals={editScript:new e,startPlayer:new e,stopPlayer:new e,toggleVR:new e,exitedVR:new e,editorCleared:new e,controlPointsChanged:new e,savingStarted:new e,savingFinished:new e,transformModeChanged:new e,snapChanged:new e,spaceChanged:new e,rendererCreated:new e,rendererUpdated:new e,sceneBackgroundChanged:new e,sceneEnvironmentChanged:new e,sceneFogChanged:new e,sceneFogSettingsChanged:new e,sceneGraphChanged:new e,sceneRendered:new e,cameraChanged:new e,cameraResetted:new e,cameraViewType:new e,cameraType:new e,geometryChanged:new e,objectSelected:new e,objectFocused:new e,objectAdded:new e,objectChanged:new e,objectRemoved:new e,cameraAdded:new e,cameraRemoved:new e,helperAdded:new e,helperRemoved:new e,materialAdded:new e,materialChanged:new e,materialRemoved:new e,scriptAdded:new e,scriptChanged:new e,scriptRemoved:new e,windowResize:new e,showGridChanged:new e,showHelpersChanged:new e,refreshSidebarObject3D:new e,historyChanged:new e,viewportCameraChanged:new e,measureChanged:new e},this.viewer=t,this.scene=t.sceneManager.getScene(),this.sceneHelpers=t.sceneManager.sceneHelpers,this.config=new fp,this.history=new cp(this),this.drawer=new mm(this),this.object={},this.geometries={},this.materials={},this.textures={},this.scripts={},this.materialsRefCounter=new Map,this.mixer=new THREE.AnimationMixer(this.scene),this.selected=null,this.helpers={},this.cameras={},this.enable=!1;const i=new THREE.Box3Helper(new THREE.Box3);i.name="EditorSelectionBox",i.visible=!1,this.selectionBox=i,this.sceneHelpers.add(i),this.transformControlsGroup=new pm,ht(["_keyDown","_keyUp"],this),this._initTransformControls(),this._initSignals(),this._initEvent()}pickFilter(t){return!0}__clickEvent({object:t,sceneHelpersObject:e}){if(this.enable&&!this.drawer.drawing&&!1!==this.pickable&&(!this.pickFilter||this.pickFilter(t)))if(t){if(t.userData.isLocked||t.locked)return void this.deselect(null);if(t.needPoints){if(t.userData.isMeasure)return void this.select(t);this.status="editPoints",this.drawer.setEditObject(t),this.select(t)}else t.userData.isControlPoint||(this.status="editPoint"),this.select(t)}else if(e){if(e!=this.selectionBox)try{e.isControlPoint?this.select(e):e.userData.object&&this.select(e.userData.object)}catch(t){this.deselect(null)}}else this.deselect()}_initEvent(){this.pickable=!0,this.clickEvent=ut(this.__clickEvent,200,this),this.viewer.on("click",this.clickEvent)}_keyDown(t){if(!this.enable)return;let e=t.code;e=e.indexOf("hift")>0?"shift":e,this._keypressedHandle(e)}_keyUp(t){if(!this.enable)return;let e=t.code;e=e.indexOf("hift")>0?"shift":e,this._keypressedHandle(e)}_keypressedHandle(t){if("Delete"===t)this.deleteSelected()}eachSelected(t){const e=this.selected;e&&(Array.isArray(e)?e:[e]).forEach((e=>{t&&t(e)}))}deleteSelected(){this.eachSelected((t=>{t.removeFromParent&&t.userData.drawPolylineHelperControl,t.userData.isControlPoint?this.drawer._deleteControlPoint(t):this.remove(t)})),this.deselect()}_initSignals(){const{selectionBox:t,transformControls:e,viewer:i}=this,r=this.signals;r.objectSelected.add((r=>{if(!this.enable||!this.pickable)return;t.visible=!1,e.detach();let n=this._preSelected;if(n&&n.userData.isMeasure,r&&!r.needPoints&&r!==this.scene&&r!==i.camera&&(t.box.setFromObject(r,!0),!1===t.box.isEmpty()&&(t.visible=!0),e.attach(r),r.isGroup)){r.matrixWorldNeedsUpdate=!0,t.getCenter();const e=new THREE.Vector3;t.box.getSize(e);const i=(t.box.max.x-t.box.min.x)/2,n=(t.box.max.y-t.box.min.y)/2,s=(t.box.max.z-t.box.min.z)/2;new THREE.Vector3(i,n,s)}i.rendererManager.enableRender()})),r.transformModeChanged.add((t=>{e.setMode(t)})),r.snapChanged.add((t=>{e.setTranslationSnap(t)})),r.spaceChanged.add((t=>{e.setSpace(t)})),r.objectChanged.add((e=>{this.enable&&e&&(this.selected===e&&t.box.setFromObject(e,!0),e.isPerspectiveCamera&&e.updateProjectionMatrix(),void 0!==this.helpers[e.id]&&this.helpers[e.id].update(),i.rendererManager.enableRender())})),r.objectRemoved.add((t=>{this.enable&&(i.cameraControl.enabled=!0,t===e.object&&e.detach(),i.rendererManager.enableRender())})),r.cameraViewType.add((t=>{const e=this.viewer.cameraControl;switch(e.enableRotate(),e.setInteract({mouseButtonRight:"rotate"}),t){case"top":e.toTopView();break;case"bottom":e.toBottomView();break;case"left":e.toLeftView();break;case"right":e.toRightView();break;case"back":e.toBackView();break;case"front":e.toFrontView()}t?(r.cameraType.dispatch("ortho"),["left","right","front","back"].includes(t)&&(e.disableRotate(),e.setInteract({mouseButtonRight:null})),["top","bottom"].includes(t)&&e.disableRotate({disableAzimuthAngle:!1,disablePolarAngle:!0})):r.cameraType.dispatch("perspective"),this.transformControls.camera=this.viewer.camera,i.rendererManager.enableRender()})),r.cameraType.add((t=>{this.viewer.cameraControl.setOrtho("ortho"==t),i.rendererManager.enableRender()})),r.materialChanged.add((()=>{i.rendererManager.enableRender()})),r.historyChanged.add((()=>{i.rendererManager.enableRender()}))}setEnable(t){this.deselect(),this.enable=t,this.transformControls.setEnable(t),t?(window.addEventListener("keydown",this._keyDown),window.addEventListener("keyup",this._keyUp)):(window.removeEventListener("keydown",this._keyDown),window.removeEventListener("keyup",this._keyUp))}draw(t){this.drawer.activate(),this.drawer.draw(t)}endDraw(){this.drawer.endDraw(),this.drawer.deactivate(),this.deselect()}setScene(t){for(this.scene.uuid=t.uuid,this.scene.name=t.name,this.scene.background=t.background,this.scene.environment=t.environment,this.scene.fog=t.fog,this.scene.userData=JSON.parse(JSON.stringify(t.userData)),this.signals.sceneGraphChanged.active=!1;t.children.length>0;)this.addObject(t.children[0]);this.signals.sceneGraphChanged.active=!0,this.signals.sceneGraphChanged.dispatch()}objectByUuid(t){return this.scene.getObjectByProperty("uuid",t,!0)}addObject(t,e,i){var r=this;t.traverse((function(t){void 0!==t.geometry&&r.addGeometry(t.geometry),void 0!==t.material&&r.addMaterial(t.material),r.addCamera(t),r.addHelper(t)})),void 0===e?this.scene.add(t):(e.children.splice(i,0,t),t.parent=e),this.signals.objectAdded.dispatch(t),this.signals.sceneGraphChanged.dispatch()}moveObject(t,e,i){if(void 0===e&&(e=this.scene),e.add(t),void 0!==i){var r=e.children.indexOf(i);e.children.splice(r,0,t),e.children.pop()}this.signals.sceneGraphChanged.dispatch()}nameObject(t,e){t.name=e,this.signals.sceneGraphChanged.dispatch()}removeObject(t){if(null!==t){var e=this;t.traverse((function(t){e.removeCamera(t),e.removeHelper(t),void 0!==t.material&&e.removeMaterial(t.material)})),t.removeFromParent(),this.signals.objectRemoved.dispatch(t),this.signals.sceneGraphChanged.dispatch()}}addGeometry(t){this.geometries[t.uuid]=t}setGeometryName(t,e){t.name=e,this.signals.sceneGraphChanged.dispatch()}addMaterial(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;e++)this.addMaterialToRefCounter(t[e]);else this.addMaterialToRefCounter(t);this.signals.materialAdded.dispatch()}addMaterialToRefCounter(t){var e=this.materialsRefCounter,i=e.get(t);void 0===i?(e.set(t,1),this.materials[t.uuid]=t):(i++,e.set(t,i))}removeMaterial(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;e++)this.removeMaterialFromRefCounter(t[e]);else this.removeMaterialFromRefCounter(t);this.signals.materialRemoved.dispatch()}removeMaterialFromRefCounter(t){var e=this.materialsRefCounter,i=e.get(t);0===--i?(e.delete(t),delete this.materials[t.uuid]):e.set(t,i)}getMaterialById(t){for(var e,i=Object.values(this.materials),r=0;r<i.length;r++)if(i[r].id===t){e=i[r];break}return e}getObjectMaterial(t,e){var i=t.material;return Array.isArray(i)&&void 0!==e&&(i=i[e]),i}setObjectMaterial(t,e,i){Array.isArray(t.material)&&void 0!==e?t.material[e]=i:t.material=i}setMaterialName(t,e){t.name=e,this.signals.sceneGraphChanged.dispatch()}addTexture(t){this.textures[t.uuid]=t}addCamera(t){t.isCamera&&(this.cameras[t.uuid]=t,this.signals.cameraAdded.dispatch(t))}removeCamera(t){void 0!==this.cameras[t.uuid]&&(delete this.cameras[t.uuid],this.signals.cameraRemoved.dispatch(t))}queryObject(){}select(t){this.selected&&this.selected==t||(this._preSelected=this.selected,this.selected=t,this.signals.objectSelected.dispatch(t),this.dispatchEvent({type:"selected"}))}deselect(){this.select(null),this._preSelected=null,this.drawer._resetDraw()}removeTransformControls(){this.transformControlsGroup&&this.transformControlsGroup.removeSelected();const t=this.transformControls;t&&(t.detach(),t.dispose(),this.sceneHelpers.remove(t)),this.transformControls=null}_initTransformControls(){let t=null,e=null,i=null;const r=this.viewer,n=this.transformControls=new Hp(this.viewer.camera,this.viewer.container);n.enabled=this.enable,n.layers.set(pe.SCENE_GIZMO),this.transformControlsMode&&(n.mode=this.transformControlsMode),this.transformControlsSpace&&(n.space=this.transformControlsSpace),n.enabled=!0;const s=this;n.addEventListener("objectChange",(()=>{if(!this.enable)return;const t=n.object;if(t.userData.isControlPoint&&this.signals.controlPointsChanged.dispatch(t),t.userData.isRefPoint){const e=t.parent.getBox3(),i=t.position;e.containsPoint(i)||["x","y","z"].forEach((t=>{i[t]<e.min[t]&&(i[t]=e.min[t]),i[t]>e.max[t]&&(i[t]=e.max[t])}))}this.dispatchEvent({type:"objectChange",object:t})})),n.addEventListener("change",(()=>{if(!this.enable)return;const t=n.object;if(void 0!==t){t.isHtmlPlane&&t.children[1]&&(t.children[1].visible=!1),this.selectionBox.box.setFromObject(t,!0);const e=this.helpers[t.id];void 0!==e&&!0!==e.isSkeletonHelper&&e.update(),this.signals.refreshSidebarObject3D.dispatch(t)}r.rendererManager.enableRender()})),n.addEventListener("mouseDown",(s=>{if(!this.enable)return;r.cameraControl.enabled=!1,this.pickable=!1;const o=n.object;t=o.position.clone(),e=o.rotation.clone(),i=o.scale.clone(),o.userData.isControlPoint&&o.userData.object.getPoints()})),n.addEventListener("mouseUp",(o=>{if(!this.enable)return;let a=n.object;if(void 0!==a)switch(n.getMode()){case"translate":t.equals(a.position)||a.userData.isControlPoint||(a.light&&a.type.indexOf("Helper"),this.execute(new Zu(this,a,a.position,t)));break;case"rotate":e.equals(a.rotation)||this.execute(new Ku(this,a,a.rotation,e));break;case"scale":i.equals(a.scale)||this.execute(new tp(this,a,a.scale,i))}r.cameraControl.enabled=!0,setTimeout((()=>{s.pickable=!0}),100)})),n.addEventListener("hoverAxis",(t=>{n.pickable=!1})),this.sceneHelpers.add(n)}setObjectMaterial(t,e,i){Array.isArray(t.material)&&void 0!==e?t.material[e]=i:t.material=i}updateObject(t,e){if(!t||!e||tt(e))return this;const{uuid:i,name:r,visible:n,renderOrder:s,position:o,rotation:a,scale:l,center:h,frustumCulled:c,layers:d,properties:u,interact:p,receiveShadow:m,castShadow:f,recursive:g,box:v,edge:y,geometry:w,style:x,userData:b,locked:_,dimensionHelper:A}=e;if(Lt(c)&&this.execute(new rp(this,t,"frustumCulled",c)),Lt(i)&&this.execute(new rp(this,t,"uuid",i)),Lt(r)&&this.execute(new rp(this,t,"name",r)),Lt(m)&&this.execute(new rp(this,t,"receiveShadow",m)),Lt(f)&&this.execute(new rp(this,t,"castShadow",f)),Lt(n)&&(this.execute(new rp(this,t,"visible",n)),n||t!=this.selected||this.deselect()),Lt(s)&&this.execute(new rp(this,t,"renderOrder",s)),q(u)&&this.execute(new rp(this,t,"properties",u)),q(p)&&this.execute(new rp(this,t,"interact",p)),o&&this.execute(new Zu(this,t,ti(o))),a){const e=ti(a),i=(new THREE.Euler).setFromVector3(new THREE.Vector3(e.x,e.y,e.z));this.execute(new Ku(this,t,i))}if(Lt(l)){let e=new THREE.Vector3;J(l)?e.setScalar(l):e.copy(ti(l)),this.execute(new tp(this,t,e))}if(Lt(e.points)&&t.updatePoints&&this.execute(new np(this,t,e.points)),Lt(w)&&t.updateGeometry&&(this.execute(new sp(this,t,w)),t.dispatchEvent({type:"geometry.change"})),Lt(e.arrow)&&t.updateArrow&&this.execute(new op(this,t,e.arrow)),Lt(e.line)&&t.updateLine&&this.execute(new ap(this,t,e.line)),Lt(e.polygon)&&t.updatePolygon&&this.execute(new lp(this,t,e.polygon)),Lt(d)&&this.execute("SetLayers",t,d),Lt(e.material)&&!tt(e.material)&&this.execute(new Yu(this,t,e.material)),Lt(h)&&this.execute(new rp(this,t,"center",h)),Lt(_)&&this.execute(new rp(this,t,"locked",_)),Lt(A)&&(t.userData.dimensionHelper&&t.userData.dimensionHelper.removeFromParent(),A)){const e=new THING.DimensionHelper(t);e.addEventListener("removed",(()=>{delete t.userData.dimensionHelper})),t.userData.dimensionHelper=e,this.add(e),this.signals.sceneGraphChanged.dispatch()}Lt(e.shader)&&t.updateShader&&t.updateShader(e.shader),e.video&&t.updateVideo&&t.updateVideo(e.video),e.style&&t.updateStyle&&t.updateStyle(e.style),q(v)&&t.setBoxHelper(v),q(y)&&t.setEdge(y),q(b)&&t.updateBy({userData:b}),this.signals.objectChanged.dispatch(t),this.viewer.rendererManager.enableRender()}move(t,e,i){this.execute(new Gh(this,t,e,i))}execute(t,e){if(Q(t)){if(t.indexOf("Command")<0&&(t+="Command"),!hp[t])return;if(e&&e.isSync){const i=[...arguments].slice(2);e.loaded?this.history.execute(new hp[t](this,e,...i)):e.addEventListener("loaded",(()=>{this.history.execute(new hp[t](this,e,...i))}))}else{const e=[...arguments].slice(1);this.history.execute(new hp[t](this,...e))}}else this.history.execute(t)}add(t,e){this.execute("AddObject",t),e&&this.moveObject(t,e)}remove(t){this.execute("RemoveObject",t)}clear(){this.root.children.forEach((t=>{this.remove(t)}))}undo(){this.history.undo()}redo(){this.history.redo()}toJSON(){}fromJSON(){}removeHelper(t){if(void 0!==this.helpers[t.id]){var e=this.helpers[t.id];e.parent.remove(e),delete this.helpers[t.id],this.signals.helperRemoved.dispatch(e)}}getRootTree({keyword:t,type:e}={}){return function i(r,n){for(var s=0,o=r.length;s<o;s++){var a=r[s];if(a.isThing||a.isNode||a.isLight||a.isGroup&&a.userData.isLinkGroup||a.isMesh&&!a.parent.isThing){var l=a.toJSON?a.toJSON():{};let r={children:[],id:a.uuid,name:a.name,config:l.config,userData:a.userData,type:l.type,locked:a.locked},s=!0;e&&(s=r.type==e),s&&(t?(!a.name||a.name.toLowerCase().indexOf(t.toLowerCase())>=0&&!r.userData.hideInTree)&&n.push(r):r.userData.hideInTree||n.push(r)),a.children.length>0&&(a.isNode,i(a.children,r.children))}}return n}(this.root.children,[])}clone(t){if(!t)return;const e=t.clone();e.name=t.name+"Copy",this.add(e)}get root(){return this.viewer.sceneManager.getScene().root}lockAll(){this.root.children.forEach((t=>{t.isLocked=!0})),this.removeTransformControls()}}var gm,vm;fm.prototype.addHelper=(gm=new THREE.SphereGeometry(2,4,2),vm=new THREE.MeshBasicMaterial({color:16711680,visible:!1}),function(t,e){if(void 0===e){if(t.isCamera)e=new THREE.CameraHelper(t);else if(t.isPointLight)e=new THREE.PointLightHelper(t,1);else if(t.isDirectionalLight)e=new THREE.DirectionalLightHelper(t,1);else if(t.isSpotLight)e=new THREE.SpotLightHelper(t);else if(t.isHemisphereLight)e=new THREE.HemisphereLightHelper(t,1);else if(t.isSkinnedMesh)e=new THREE.SkeletonHelper(t.skeleton.bones[0]);else{if(!0!==t.isBone||!0===t.parent?.isBone)return;e=new THREE.SkeletonHelper(t)}const i=new THREE.Mesh(gm,vm);i.name="picker",i.userData.object=t,e.add(i)}this.sceneHelpers.add(e),this.helpers[t.id]=e,this.signals.helperAdded.dispatch(e)});new be.Vector3;let ym=null;class wm extends be.EventDispatcher{constructor(t,e){super(),this.option=mt({unit:"m",pickPointColor:"#FF9900",onTop:!0},e||{}),this.viewer=t,this.root=new Ya,this.root.name="MeasureControlRoot",this.root.userData.hideInTree=!0,this.scene.tempRoot.add(this.root),this.measures=[],this.pickPoint=new Co({center:[.5,.5],material:{depthWrite:!1,depthTest:!1,map:{icon:"thing-point",color:this.option.pickPointColor,iconWidth:8,iconHeight:8}}}),this.pickPoint.visible=!1,this.pickPoint.traverse((t=>{t.userData.isMeasure=!0,t.userData.hideInTree=!0})),this.root.add(this.pickPoint),ht(["_onPointerDown","_onPointerMove","_onPointerMove","_onPointerUp","_dblClick","_objectSelectedEvent"],this),this.mode="MultipleDistance",this.measuring=!1}get scene(){return this.viewer.sceneManager.scene}get editor(){return this.viewer.editor}getMeasure(t){return this.measures.filter((e=>e.id==t))[0]}addMeasure(t){if(!t.isMeasure)return;this.root.add(t.root),this.current=t;this.getMeasure(t.id)||this.measures.push(t)}removeMeasure(t){const e=this.getMeasure(t.id);e&&e.remove(),st(this.measures,"id",t.id)}resetMeasureValues(){this.angle=0,this.distanceX=0,this.distanceY=0,this.distanceZ=0,this.distanceXYZ=0,this.result=null}activate(t,e){if(!Hu[t])return void console.log("Undefined Measure Type");this.deactivate(),ym=this.editor.enable,this.editor.setEnable(!1),D(this.viewer.container,"THING-measure"),this.mode=t,this.measuring=!0;const i=new Hu[t]({...this.option,...e||{}});this._excuteCreateMeasure(i);const{container:r,editor:n}=this.viewer;this.viewer.on("dblclick",this._dblClick),r.addEventListener("pointerdown",this._onPointerDown),r.addEventListener("pointermove",this._onPointerMove),r.addEventListener("pointerup",this._onPointerUp),n.signals.objectSelected.add(this._objectSelectedEvent),this.dispatchEvent({type:"measure.start"})}deactivate(){this.mode&&this.current&&this.current.clearHelper(),I(this.viewer.container,"THING-measure"),this.measuring=!1,this.mode="",this.pickPoint.visible=!1,this.resetMeasureValues(),this.viewer.off("dblclick",this._dblClick);const{container:t,editor:e}=this.viewer;t.removeEventListener("pointerdown",this._onPointerDown),t.removeEventListener("pointermove",this._onPointerMove),t.removeEventListener("pointerup",this._onPointerUp),e.signals.objectSelected.remove(this._objectSelectedEvent)}_objectSelectedEvent(t){t&&t.userData.isMeasure&&(t.updateMaterial({color:ue}),this.viewer.rendererManager.enableRender())}_excuteCreateMeasure(t){t.addEventListener("removed",(t=>{st(this.measures,"id",t.id),this.current==t&&(this.current=null)})),this.editor.execute("AddMeasure",t)}_dblClick(){if(this.current&&this.current.isComplete())return this.deactivate(),void this.dispatchEvent({type:"measure.end"})}_getPosition(t){let e=null,i=this.viewer.picker.pick(t.clientX,t.clientY);return i.raycasterPicked&&(i.raycasterPicked=i.raycasterPicked.filter((t=>t.object?!t.object.userData.isMeasure:t.point)),i.raycasterPicked[0]&&i.raycasterPicked[0].point&&(e=i.raycasterPicked[0].point.toArray(),this.pickPoint.updateMaterial({color:ue})),e||(e=this.viewer.coordScreenToWorld(t.clientX,t.clientY),this.pickPoint.updateMaterial({color:this.option.pickPointColor}))),{picked:i,position:e}}_onPointerMove(t){if(!this.measuring)return;let{position:e}=this._getPosition(t);e&&(this.pickPoint.visible||(this.pickPoint.visible=!0),this.pickPoint.position.set(e[0],e[1],e[2]),this.current&&(this.current.updateHelper(e),this.viewer.rendererManager.enableRender()))}_onPointerDown(t){if(!this.measuring||!this.current||0!=t.button)return;t.preventDefault(),t.stopPropagation();let{position:e,picked:i}=this._getPosition(t);e[1]+=.001,this.current.addPoint(e,i),this.viewer.rendererManager.enableRender()}_onPointerUp(){if(this.measuring)switch(this.mode){case"HeightMeasure":case"DistanceMeasure":case"SimpleDistanceMeasure":case"RectilinearDistanceMeasure":case"AngleMeasure":if(this.current&&this.current.isComplete())return this.viewer.rendererManager.enableRender(),setTimeout((()=>{this.editor.setEnable(ym),ym=null}),100),this.deactivate(),void this.dispatchEvent({type:"measure.end"})}}setVisible(t){this.root.visible=!!t}get visible(){return!1!==this.root.visible}set visible(t){this.setVisible(t)}clear(){this.measures.map((t=>({id:t.id}))).forEach((t=>{this.editor.execute("RemoveMeasure",this.getMeasure(t.id))}))}toJSON(){let t={type:"Measures",measures:[]};return this.measures.forEach((e=>{t.measures.push(e.toJSON())})),t}fromJSON(t){this.clear(),t.measures&&0!=t.measures.length&&t.measures.forEach((t=>{const e=new Hu[t.type](this.option);e.fromJSON(t),this._excuteCreateMeasure(e),e._updateDistancePoints()}))}}wm.RENDER_ORDER=99999;let xm=1;class bm extends ui{constructor(t){super(),this.id=xm,xm++;const e=this.option=pt(et(Nh),t);this.container=null,this._containerOldInfo={},this._loadingContainer=null,this._controlContainer=null,this._controls=[],this._controlPositions={},this._attributionControl=null,this.clock=new be.Clock,this.elapsedTime=0,this.deltaTime=0,this.currentFrame=0,this._fullscreen=!1,!1===e.backwardEnabled&&this.setBackwardEnabled(),ht(["_update","_updatePopups"],this),this.popups=new qa,this.popupsCollision=new Ja({padding:this.option.popupsAvoidPadding}),dt(this.updatePopupsAvoid,this,2e3),this._initContainer(),this.cameraControl=new Wa(this,{...this.option.interact}),this.sceneManager=this.sm=new sl(this),this.sceneManager.loadScene("default",this.option.scene),this.rendererManager=this.rm=new Sh(this,this.option.renderer),this._initRendererContainer(),mo.setViewer(this),this.resourceManager=this.rsm=mo,this.picker=new Ch(this),this.selector=new Ql(this),this.debugger=new Zl(this),this.debugger.show(this.option.debugger),this.eventManager=new Th(this),this.webviewManager=null,this.forceRender=this.option.forceRender,this.editor=new fm(this),this.measureControl=new wm(this),wo.addViewer(this),this.setView(this.option.view),this.rendererManager.start()}_initContainer(){const{container:t,attributions:e,showLogo:i}=this.option;let r=Q(t)?document.querySelector(t)||document.getElementById(t):t;F(r)||(r=document.body);if(r.getAttribute("data-viewerid"))throw new Error("Initialization failed because the target container is in use");if(r&&!this.container){r.setAttribute("data-viewerid",this.id),this.rendererContainer=U("div","THING-container",r),this.container=r,D(r,"THING-wrapper"),this._containerOldInfo={id:r.id,overflow:r.style.overflow,position:r.style.position},r.style.position||(r.style.position="relative"),r.id||r.setAttribute("id","THING-wrapper"),r.style.overflow="hidden";const t=this._controlContainer=U("div","THING-control-container",r);if(["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{this._controlPositions[e]=U("div",`THING-ctrl-${e}`,t)})),i&&this.addControl(new Ko,null),e){const t=this._attributionControl=new $o({customAttribution:e});this.addControl(t,null)}r.addEventListener("mousedown",G),r.addEventListener("mousewheel",G),navigator.userAgent.indexOf("Firefox")>0&&r.addEventListener("DOMMouseScroll",G);const n=new Je,{width:s,height:o}=this.getSize();n.setSize(s,o),n.domElement.style.position="absolute",n.domElement.style.left="0px",n.domElement.style.zIndex=0,n.domElement.style.display="none",this.rendererContainer.appendChild(n.domElement),this._cssRenderer=n}}_getEventTarget(t){const e=this.picker.pick(t.clientX,t.clientY);return e.raycasterPicked&&0==e.raycasterPicked.length?null:e}_initLoadingContainer(){const t=this.container;if(!t)return;(this._loadingContainer=U("div","THING-loading",t)).innerHTML='<div class="loading-circle"><div class="loader"></div></div><div>Loading...</div>'}_hideLoading(){const t=this._loadingContainer;t&&(t.style.opacity=0,setTimeout((()=>{t.style.display="none"}),300))}_initRendererContainer(){const t=this.rendererContainer;if(!t)return;const{view:e}=this.option;e.aspect;const{width:i,height:r}=this.getSize();var n=this.renderer;n.domElement.setAttribute("tabindex","-1"),t.appendChild(n.domElement),this._captureDivElement=document.createElement("div"),this._captureRenderer=this._createRenderer(!0),this._captureRenderer.outputEncoding=be.sRGBEncoding,this._captureDivElement.appendChild(this._captureRenderer.domElement),this._resizeCaputureDivElement(i,r)}resize(){const{cameraControl:t,picker:e}=this,{width:i,height:r}=this.getSize();this.rendererManager?.setSize(i,r),this.webviewManager?.setSize(i,r),t.setSize(i,r),e.setSize(i,r),this._updatePopups(),this._resizeCaputureDivElement(i,r),this.rendererManager.enableRender(),this.fire({type:"resize",size:{width:i,height:r}})}addControl(t,e){if(!t)return;if(!e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),e||(e="top-right"),!t||!t.onAdd)return void console.log("Add control error.");const i=t.onAdd(this,e);this._controls.push(t);const r=this._controlPositions[e];return-1!==e.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),t}removeControl(t){return t&&t.onRemove&&(this._constrols=this._constrols.filter((e=>e!==t)),t.onRemove()),this}_updateControls(){this._controls.forEach((t=>{t._update&&t._update()}))}setFullscreen(t){return this._fullscreen=!!t,this._fullscreen&&Fh.isEnabled?(this.fire("fullscreen"),Fh.request(this.container)):(this.fire("exitFullscreen"),Fh.exit())}setView(t,e=!1){return this.selector&&this.selector.update(),t.position&&this.cameraControl.setPosition(t.position,e),t.center&&this.cameraControl.setCenter(t.center,e),t.near&&this.cameraControl.setNear(t.near),t.far&&this.cameraControl.setFar(t.far),t.aspect&&this.cameraControl.setAspect(t.aspect),t.isOrtho&&(this.cameraControl.setOrtho(t.isOrtho),this.cameraControl.zoom=t.zoom||1,this.camera.left=t.left||-1e3,this.camera.right=t.right||1e3,this.camera.top=t.top||-1e3,this.camera.bottom=t.bottom||1e3,t.rotation&&4==t.rotation.length&&(t.rotation[0]||(t.rotation[0]=0),t.rotation[1]||(t.rotation[1]=0),t.rotation[2]||(t.rotation[2]=0),t.rotation[3]||(t.rotation[3]="XYZ"),this.camera.rotation.fromArray(t.rotation)),this.camera.updateProjectionMatrix()),this.cameraControl.cameraUpdateEvent(),this}getView(t){const e=this.cameraControl.camera,i=e instanceof be.OrthographicCamera;return{position:e.position.clone().toArray(),center:this.cameraControl.center.toArray(),far:e.far,near:e.near,aspect:t?this.getAspect():null,fov:e instanceof be.PerspectiveCamera?e.fov:null,isOrtho:i,left:e.left,right:e.right,top:e.top,bottom:e.bottom,zoom:e.zoom,rotation:e.rotation.toArray()}}getAspect(){const t=this.container;return t.clientWidth/(t.clientHeight||window.innerHeight)}pick(t){let e=null,i=this.picker.pick(t.clientX,t.clientY);return i.raycasterPicked&&(i.raycasterPicked[0]&&i.raycasterPicked[0].point&&(e=i.raycasterPicked[0].point.toArray()),e||(e=this.coordScreenToWorld(t.clientX,t.clientY))),{picked:i,position:e}}coordScreenToWorldWithPick(t,e,i,r){const n=this.picker.pick(t,e,r);return n.raycasterPicked&&(0==n.raycasterPicked.length||r&&0==r(n))?this.coordScreenToWorld(t,e,i):xt(n.raycasterPicked[0].point,5)}coordScreenToWorld(t,e,i){const r=this.camera,n=this.container.getBoundingClientRect();t=(t-n.left)/n.width*2-1,e=-(e-n.top)/n.height*2+1;let s=new be.Vector3;const o=new be.Vector3;r.updateProjectionMatrix(),r&&r.isPerspectiveCamera?(o.setFromMatrixPosition(r.matrixWorld),s.set(t,e,0).unproject(r).sub(o).normalize()):r&&r.isOrthographicCamera&&(o.set(t,e,(r.near+r.far)/(r.near-r.far)).unproject(r),s.set(0,0,-1).transformDirection(r.matrixWorld));const a=new be.Vector3(0,1,0).dot(s),l=this.cameraControl.center;if(!(Math.abs(a)<1e-4)){var h=(-o.y+(i||0)+l.y)/s.y,c=(new be.Vector3).copy(o).add((new be.Vector3).copy(s).multiplyScalar(h));return Lt(i)&&(c.y=i),xt(c,3)}}coordWorldToScreen(t,e,i){let r=(t&&t.isVector3?(new be.Vector3).copy(t):new be.Vector3(t,e,i)).project(this.camera);const{width:n,height:s}=this.getSize();let o=n/2,a=s/2;return{x:Math.round(r.x*o+o),y:Math.round(-r.y*a+a)}}getPixelLength(t,e){let i=this.coordWorldToScreen(ti(t)),r=this.coordWorldToScreen(ti(e));return i=new be.Vector2(i.x,i.y),r=new be.Vector2(r.x,r.y),Math.ceil(r.distanceTo(i))}getSize(){const t=this.container;if(!t)return{width:0,height:0};return{width:t.clientWidth||window.innerWidth,height:t.clientHeight||window.innerHeight}}trigger(t,e){this.eventManager.trigger(t,e)}setBackwardEnabled(){history.pushState(null,null,document.URL),window.addEventListener("popstate",(function(){history.pushState(null,null,document.URL)}))}captureScreenshot(t){const e=this.getSize(),i=pt({filename:"screenshot.jpg",mime:"image/jpeg",quality:.8,saveAsFile:!1,width:e.width,height:e.height},t),r=this;let n=this.renderer;this._captureRenderer&&(n=this._captureRenderer);const{width:s,height:o,quality:a,saveAsFile:l,filename:h,mime:c}=i;if(this._resizeCaputureDivElement(s,o),this.cameraControl.setSize(s,o),n.render(this.scene,this.camera),!l){let t=n.domElement.toDataURL(c,a);return this.cameraControl.setSize(e.width,e.height),this._resizeCaputureDivElement(e.width,e.height),t}n.domElement.toBlob((t=>{r.cameraControl.setSize(e.width,e.height),r._resizeCaputureDivElement(e.width,e.height),kh(t,h),r.dispatchEvent({type:"screenshot",data:t})}),c,a)}_createRenderer(){const{devicePixelRatio:t}=this.option;var e=new be.WebGLRenderer({preserveDrawingBuffer:!1,antialias:!0,logarithmicDepthBuffer:!0});e.info.autoReset=!1,e.setPixelRatio(t);var i=this.getSize();return e.setSize(i.width,i.height),e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=be.PCFSoftShadowMap,e.outputEncoding=be.sRGBEncoding,e.autoClear=!1,e.autoClearColor=!0,e.autoClearDepth=!0,e.autoClearStencil=!0,e.physicallyCorrectLights=!0,e}_collectRenderStates(){if(!this.debugger.enable)return;var t=this.renderer.info.memory,e=this.renderer.info.render;const i=this.scene.getVerticesCount();this.debugger.renderStates=this.renderStates={geometries:t.geometries,textures:t.textures,frame:e.frame,calls:e.calls,triangles:e.triangles,points:e.points,lines:e.lines,vertices:i}}_resizeCaputureDivElement(t,e){const{_captureDivElement:i,_captureRenderer:r}=this;if(i&&r){var n=i.style;n.width=t+"px",n.height=e+"px",n.display="none",r.setSize(t,e)}}_updatePopups(){this.popups.each((function(t){t.update()})),this.updatePopupsAvoid()}clearPopups(){this.popups._items.forEach((function(t){t&&t.remove()})),this.popups.clear()}updatePopupsAvoid(){this.popupsCollision.clear(),this.option.popupsAvoid&&0!=this.popups.length&&this.popups.each((t=>{if(!t||!t.avoid)return;t.updateBox();let e=this.popupsCollision.push(t.box2d);t.visible=!e}))}clearAvoidPopups(){this.boxCollision.clear(),this.clearPopups()}destroy(){cancelAnimationFrame(this._tick),this._tick=null,mo.clear(),this.selector.deactive(),this.selector=null,this.clearPopups(),this.cameraControl.setEnabled(!1),this.cameraControl.destroy(),this.cameraControl=null,this.rendererManager.destroy(),this.renderStates=null,this.debugger.remove(),this.debugger=null,this.sceneManager.destroy(),this._listeners=[],this.container.removeAttribute("data-viewerid"),I(this.container,"THING-wrapper");for(const t in this._containerOldInfo)this.container.style[t]=this._containerOldInfo[t];this.container.innerHTML="",this.container=null,this.fire("destory")}setCursor(t){this.container.style.cursor=t}initExplodeModel(t){if(!t)return;function e(t,e){return(new be.Vector3).addVectors(t.max,t.min).multiplyScalar(e)}const i=new be.Box3;i.setFromObject(t);const r=e(i,.5),n=new be.Box3;t.traverse((function(t){if(!(t.isMark||t.isMarkChild||t.isLine||t.isSprite)&&t.isMesh){n.setFromObject(t);const i=e(n,.5);t.userData.worldDir=(new be.Vector3).subVectors(i,r).normalize(),t.userData.worldDistance=(new be.Vector3).subVectors(i,r),t.userData.originPosition=t.getWorldPosition(new be.Vector3),t.userData.meshCenter=i.clone(),t.userData.explodeCenter=r.clone()}}))}explodeModel(t,e){t&&(e=e||1,t.traverse((function(t){if(!t.isMesh||!t.userData.originPosition)return;const i=t.userData.worldDir.clone().multiplyScalar(t.userData.worldDistance.length()*e),r=(new be.Vector3).subVectors(t.userData.meshCenter,t.userData.originPosition),n=t.userData.explodeCenter,s=(new be.Vector3).copy(n).add(i).sub(r),o=t.parent?.worldToLocal(s.clone());o&&t.position.copy(o)})))}get fullscreen(){return this._fullscreen}set fullscreen(t){this.setFullscreen(t)}get spriteComputeParameter(){const t=this.camera,e=this.container,{top:i,bottom:r,zoom:n}=t,s=e.clientHeight;let o=1;return o=t.isOrthographicCamera?ct(1/(Math.abs(i-r)/(n*s)),3):ct(s*n/(2*Math.tan(t.fov*be.Math.DEG2RAD/2)),3),o}get scene(){return this.sceneManager.getScene()}get sceneHelpers(){return this.sceneManager.sceneHelpers}get camera(){return this.cameraControl.camera}get renderer(){return this.rendererManager.renderer}get effectRenderer(){return this.rendererManager.effectRenderer}get isMobileDevice(){return p}get size(){return this.getSize()}get viewBox(){const{width:t,height:e}=this.getSize();return new be.Box2(new be.Vector2(0,0),new be.Vector2(t,e))}}const{browserIsEdge:_m,browserIsIE:Am,browserIsIE10:Sm,browserIsIEorTrident:Tm,browserIsMac:Em,browserIsFirefox:Pm,isAndroid:Mm,isApple:Cm,isIOS:Lm,isIpad:Rm,isIphone:Om,isMiniProgram:Fm,isMobile:Nm,isQQ:Dm,isTouchable:Im,isWeiBo:Um,isWeiXin:Bm,isWeiXinWork:km,isWindowPlatform:jm,browserIsChrome:Vm}=O,zm={browserIsChrome:Vm,browserIsEdge:_m,browserIsIE:Am,browserIsIE10:Sm,browserIsIEorTrident:Tm,browserIsMac:Em,browserIsFirefox:Pm,isAndroid:Mm,isApple:Cm,isIOS:Lm,isIpad:Rm,isIphone:Om,isMiniProgram:Fm,isMobile:Nm,isQQ:Dm,isTouchable:Im,isWeiBo:Um,isWeiXin:Bm,isWeiXinWork:km,isWindowPlatform:jm};var Gm=Object.freeze({__proto__:null,Common:Rt,Env:zm,makeWorker:t=>{let e={},i=URL.createObjectURL(new Blob([`(${t.toString()})()`]));window.navigator&&window.navigator.msSaveOrOpenBlob&&(i=window.navigator.msSaveOrOpenBlob(i));const r=new Worker(i);return r.onmessage=({data:{result:t,jobId:i}})=>{e[i](t),delete e[i]},(...t)=>new Promise((i=>{const n=qo++;e[n]=i,r.postMessage({jobId:n,message:t})}))},isUncaffectedObject:qe,getObjectInteractable:function(t,e){return!(!t||!Q(e)||!t instanceof be.Object3D||!t.interact)&&t.interact[e]},getIntersects:function(t,e,i){const{x:r,y:n}=z(t,e)||{};if(void 0===r||void 0===n)return[];const s=new be.Raycaster,o=new be.Vector3;o.set(r,n,.5);const{camera:a,scene:l}=this;return s.setFromCamera(o,a),s.intersectObject(l,!0)},isInCameraVisibleRange:function(t,e){if(!t||!e)return!1;let i=t.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix);return!(Math.abs(i.x)>1||Math.abs(i.y)>1||Math.abs(i.z)>1)},loadObjModel:Ke,getVerticesCount:function(t){var e=0;return t&&t.traverse((function(t){t.isMesh&&(e+=t.verticesCount())})),e},parseVector2:$e,parseVector3:ti,parseEuler:ei,parseQuaternion:ii,parseAngles:ri,parseColor:ni,parseSize:function(t){var e=t.width||1,i=t.height||1,r=t.size;return r?J(r)&&(r=[r,r]):r=[e,i],r},parseLength:function(t){if(Q(t)){const e=t.indexOf("px");return e>=0&&(t=t.substring(0,e)),Math.toInteger(t)}return t},parseLoopType:function(t){return J(t)?t:isBoolean(t)?t?be.LoopRepeat:be.Once:"pingpong"==t?be.LoopPingPong:"repeat"==t?be.LoopRepeat:be.LoopOnce},randomVector3:function(){if(1==arguments.length){var t=be.Math.randFloat(-range,range),e=be.Math.randFloat(-range,range),i=be.Math.randFloat(-range,range);return new be.Vector3(t,e,i)}if(3==arguments.length){var r=arguments[0],n=arguments[1],s=arguments[2];t=be.Math.randFloat(-r,r),e=be.Math.randFloat(-n,n),i=be.Math.randFloat(-s,s);return new be.Vector3(t,e,i)}},directionFromAlphaBeta:function(t,e,i){var r=t/180*Math.PI+Math.PI/2,n=-e/180*Math.PI+Math.PI/2,s=i||new be.Vector3,o=Math.sin(r);return s.x=o*Math.cos(n),s.y=-Math.cos(r),s.z=o*Math.sin(n),s},setDirectionalLight:function(t,e,i){if(t&&e&&t.castShadow){const e=t.shadow.camera;let r=i.radius||1e3;e.top=e.right=r,e.bottom=e.left=-r,e.near=.5,e.far=5*r}},getConsumeTime:function(t,e,i,r,n,s){if(n){const t=ti([e.x,e.y,e.z]),r=ti([i.x,i.y,i.z]);return t.distanceTo(r)/n*1e3}return void 0!==r?t?r/t.length:r:s},getMixerPlane:si,emptyObject:function(t,e){for(;t.children.length;)t.removeChild(t.lastChild)},isNeedCloneMaterials:function(t){let e=(t=t||{}).opacity,i=t.color,r=t.alwaysOnTop,n=t.wireframe,s=t.transparent;return!K(e)&&1!==e||(!K(s)||(!K(i)||(!!r||!!n)))},canPutInRenderList:oi,getRoot:ai,getIndexPath:li,getTargetStyle:function(t,e,i,r){const n={};if(!e||!t)return n;let s=i?Object.keys(i):null;for(const o in t){const a=t[o];if(o===e)n[o]=a;else if(o.substring(0,e.length)===e)if(s&&s.includes(o))n[i[o]]=a;else{const t=o.substring(e.length);if(t){n[yt(t)]=a}}else r&&(n[o]=a)}return n},equalTwoValue:function(t,e){if(!t||!e)return t===e;if(Q(t)&&Q(e))return t===e;if(J(t)&&J(e))return t===e;if(q(t)&&q(e)){for(const i in t)if(t[i]!==e[i])return!1;return!0}return t.isColor||e.isColor?ni(t).toHexString()===ni(e).toHexString():W(t)&&W(e)?Et(t,e):t.isVector2||e.isVector2?$e(t).equals($e(e)):t.isVector3||e.isVector3?ti(t).equals(ti(e)):void 0},getMaterialDefaultOption:function(t){if(!t)return{};const e=t.isMaterial?t:be[t]&&new be[t];if(!e||!e.isMaterial)return{};const i={},r=Object.getOwnPropertyNames(e).filter((t=>!["id","uuid","userData","name","type"].includes(t)));for(let t=0;t<r.length;t++){const n=r[t];let s=e[n];s&&(s.isColor&&(s=s.toHexString()),s.isVector2&&(s=s.toArray()),q(s)&&(s=et(s))),i[n]=s}return i},assignUVs:hi,createMultiMaterialObject:function(t,e){for(var i=new be.Group,r=0,n=e.length;r<n;r++)i.add(new be.Mesh(t,e[r]));return i},getCurveByStartAndEndPoint:function(t,e,i){let r=270*t.angleTo(e)/Math.PI/10,n=50*r,s=r*r*120,o=new be.Vector3(0,0,0),a=new be.Ray(o,function(t,e){return t.add(e).divideScalar(2)}(t.clone(),e.clone())),l=a.at(s/a.at(1).distanceTo(o)),h=ci(t.clone(),l,n),c=ci(e.clone(),l,n),d=new be.CubicBezierCurve3(t,h,c,e);return{points:d.getPoints(i||50),curve:d}},signObjectUserData:function(t,e){t.traverse((t=>{for(const i in e)t.userData[i]=e[i]}))},geometryToBufferGeometry:di,roundUpPowerOf2:bo,isPowerOf2:function(t){return t>0&&0==(t&t-1)},isPositiveZero:function(t){return 0===t&&1/t>0},isNegativeZero:function(t){return 0===t&&1/t<0},areaPolygon:_o,caculateAreaOfTriangle:Ao,caculateVolumeOfTriangle:So,caculateGeometrySurfaceAreaAndVolume:function(t){let e=0,i=0,r=t.attributes.position.array;for(let t=0;t<r.length;t+=9){let n=new be.Vector3(r[t],r[t+1],r[t+2]),s=new be.Vector3(r[t+3],r[t+4],r[t+5]),o=new be.Vector3(r[t+6],r[t+7],r[t+8]);i+=So(o,s,n),e+=Ao(o,s,n)}return{surfaceArea:+e.toFixed(2),loadedObjectVolume:+i.toFixed(2)}},polygonExpand:Eo,rotatePointOnAxis:function(t,e,i){var r=t.x,n=t.y,s=t.z,o=r*r,a=n*n,l=s*s,h=r*n,c=r*s,d=n*s,u=Math.sin(i),p=Math.cos(i),m=e.x,f=e.y,g=e.z;return e.x=(o+(1-o)*p)*m+(h*(1-p)-s*u)*f+(c*(1-p)+n*u)*g,e.y=(h*(1-p)+s*u)*m+(a+(1-a)*p)*f+(d*(1-p)-r*u)*g,e.z=(c*(1-p)-n*u)*m+(d*(1-p)+r*u)*f+(l+(1-l)*p)*g,e},MaterialFace:class{constructor(t){this.option=pt({width:320,height:240,geometryType:"sphere",backgroundColor:"#333333"},t||{}),this._initContainer(),this.setGeometryType(this.option.geometryType)}destroy(){this.viewer.destroy(),this.viewer=null,this.material=null,this.geometry=null}_initContainer(){const t=document.createElement("div");t.style.width=this.option.width+"px",t.style.height=this.option.height+"px",this.viewer=new bm({container:t,forceRender:!1,scene:{background:this.option.backgroundColor}}),this.viewer.cameraControl.enabled=!1,this.viewer.cameraControl.keypress=!1}setGeometryType(t){let e=null,i=null;if(this.geometry&&(i=this.geometry.mesh.material),"box"===t)e=new THING.Box({position:[0,.5,0]});else e=new THING.Sphere({position:[0,.5,0]});e&&(i&&(e.mesh.material=i),this.viewer.scene.root.clear(),this.viewer.scene.add(e),this.viewer.cameraControl.fitTo(e,{enableTransition:!1,paddingLeft:"box"==t?.2:.1,paddingRight:"box"==t?.2:.1,paddingBottom:"box"==t?.5:.1,paddingTop:"box"==t?.2:.1,azimuthAngle:-30,polarAngle:60}),this.geometry=e,this.viewer.rendererManager.enableRender())}setMaterial(t){this.geometry&&(this.geometry.mesh.material=t)}getThumbnail(){const{width:t,height:e}=this.option;return new Promise(((i,r)=>{setTimeout((()=>{const r=this.viewer.captureScreenshot({width:t,height:e});i(r)}),100)}))}}});class Hm extends THREE.AmbientLight{constructor(t){const e=pt({color:"#ffffff",intensity:1},t);super(ni(e.color),e.intensity),this.isThing=!0,this.name="AmbientLight",Mo.prototype._initOption.call(this,e)}setupStyle(){}toJSON(t){const e=super.toJSON(t),i=Mo.prototype.toJSON.call(this);return i.config={...e.object,...i.config},i.config.color=this.color.toHexString(),i.config.intensity=this.intensity,delete i.config.matrix,i}}class Xm extends THREE.DirectionalLight{constructor(t){const e=pt({color:"#ffffff",intensity:1,helper:!1,shadow:{bias:1e-5,mapSize:{width:512,height:512},camera:{near:.1,far:500}}},t);super(ni(e.color),e.intensity),this.isThing=!0,this.name="DirectionLight",Mo.prototype._initOption.call(this,e),this.updateShadow(this.option.shadow),this.helper=new THREE.DirectionalLightHelper(this,1),this.helper.visible=this.option.helper,this.setupCommonEvent()}setupStyle(){}setupCommonEvent(){Mo.prototype.setupCommonEvent.call(this),this.addEventListener("added",(()=>{this.scene&&this.scene.add(this.helper)}))}updateShadow(t){pt(this.option.shadow,t);const{mapSize:e,camera:i,bias:r}=this.option.shadow;this.shadow.mapSize.width=e.width,this.shadow.mapSize.height=e.height;for(const t in i)void 0!==this.shadow.camera[t]&&(this.shadow.camera[t]=i[t]);this.shadow.bias=r}toJSON(t){const e=super.toJSON(t),i=Mo.prototype.toJSON.call(this);return i.config={...e.object,...i.config},i.config.color=this.color.toHexString(),i.config.intensity=this.intensity,i.config.helper=this.helper.visible,i.config.shadow=this.option.shadow,delete i.config.matrix,i}}class Wm extends THREE.HemisphereLight{constructor(t){const e=pt({color:"#ffffff",groundColor:"#888888",intensity:1,helper:!1},t);super(ni(e.color),ni(e.groundColor),e.intensity),this.isThing=!0,this.name="HemisphereLight",Mo.prototype._initOption.call(this,e),this.helper=new THREE.HemisphereLightHelper(this,1),this.helper.visible=this.option.helper,this.setupCommonEvent()}setupStyle(){}setupCommonEvent(){Mo.prototype.setupCommonEvent.call(this),this.addEventListener("added",(()=>{this.scene&&this.scene.add(this.helper)}))}toJSON(t){const e=super.toJSON(t),i=Mo.prototype.toJSON.call(this);return i.config={...e.object,...i.config},i.config.color=this.color.toHexString(),i.config.groundColor=this.groundColor.toHexString(),i.config.intensity=this.intensity,i.config.helper=this.helper.visible,delete i.config.matrix,i}}class Ym extends THREE.SpotLight{constructor(t){const e=pt({color:"#ffffff",intensity:1,distance:0,decay:1,castShadow:!1,angle:Math.PI/3,penumbra:.2,helper:!1,shadow:{focus:1,mapSize:{width:1024,height:1024},camera:{near:.1,far:1e3,fov:30}}},t);super(ni(e.color),e.intensity,e.distance,e.angle,e.penumbra,e.decay),this.isThing=!0,this.name="SpotLight",Mo.prototype._initOption.call(this,e),this.updateShadow(this.option.shadow),this.helper=new THREE.SpotLightHelper(this,1),this.helper.visible=this.option.helper,this.setupCommonEvent()}setupStyle(){}setupCommonEvent(){Mo.prototype.setupCommonEvent.call(this),this.addEventListener("added",(()=>{this.scene&&this.scene.add(this.helper)}))}updateShadow(t){pt(this.option.shadow,t);const{mapSize:e,camera:i,focus:r}=this.option.shadow;this.shadow.mapSize.width=e.width,this.shadow.mapSize.height=e.height;for(const t in i)void 0!==this.shadow.camera[t]&&(this.shadow.camera[t]=i[t]);this.shadow.focus=r}toJSON(t){const e=super.toJSON(t),i=Mo.prototype.toJSON.call(this);return i.config={...e.object,...i.config},i.config.color=this.color.toHexString(),i.config.intensity=this.intensity,i.config.distance=this.distance,i.config.decay=this.decay,i.config.angle=this.angle,i.config.penumbra=this.penumbra,i.config.helper=this.helper.visible,i.config.shadow=this.option.shadow,delete i.config.matrix,i}}class Qm extends THREE.PointLight{constructor(t){const e=pt({color:"#ffffff",intensity:1,distance:0,decay:2,helper:!1,castShadow:!1,shadow:{mapSize:{width:512,height:512},camera:{near:.5,far:500}}},t);super(ni(e.color),e.intensity,e.distance,e.decay),this.isThing=!0,this.name="PointLight",Mo.prototype._initOption.call(this,e),this.updateShadow(this.option.shadow),this.helper=new THREE.PointLightHelper(this,1),this.helper.visible=this.option.helper,this.setupCommonEvent()}setupStyle(){}setupCommonEvent(){Mo.prototype.setupCommonEvent.call(this),this.addEventListener("added",(()=>{this.scene&&this.scene.add(this.helper)}))}updateShadow(t){pt(this.option.shadow,t);const{mapSize:e,camera:i,bias:r}=this.option.shadow;this.shadow.mapSize.width=e.width,this.shadow.mapSize.height=e.height;for(const t in i)void 0!==this.shadow.camera[t]&&(this.shadow.camera[t]=i[t]);this.shadow.bias=r}toJSON(t){const e=super.toJSON(t),i=Mo.prototype.toJSON.call(this);return i.config={...e.object,...i.config},i.config.color=this.color.toHexString(),i.config.intensity=this.intensity,i.config.distance=this.distance,i.config.decay=this.decay,i.config.helper=this.helper.visible,i.config.shadow=this.option.shadow,delete i.config.matrix,i}}const{Vector3:Jm,Matrix4:Zm}=be,qm=new Zm;class Km{constructor(t){t=t||{},this.vertices={near:[new Jm,new Jm,new Jm,new Jm],far:[new Jm,new Jm,new Jm,new Jm]},void 0!==t.projectionMatrix&&this.setFromProjectionMatrix(t.projectionMatrix,t.maxFar||1e4)}setFromProjectionMatrix(t,e){const i=0===t.elements[11];return qm.copy(t).invert(),this.vertices.near[0].set(1,1,-1),this.vertices.near[1].set(1,-1,-1),this.vertices.near[2].set(-1,-1,-1),this.vertices.near[3].set(-1,1,-1),this.vertices.near.forEach((function(t){t.applyMatrix4(qm)})),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach((function(t){t.applyMatrix4(qm);const r=Math.abs(t.z);i?t.z*=Math.min(e/r,1):t.multiplyScalar(Math.min(e/r,1))})),this.vertices}split(t,e){for(;t.length>e.length;)e.push(new Km);e.length=t.length;for(let i=0;i<t.length;i++){const r=e[i];if(0===i)for(let t=0;t<4;t++)r.vertices.near[t].copy(this.vertices.near[t]);else for(let e=0;e<4;e++)r.vertices.near[e].lerpVectors(this.vertices.near[e],this.vertices.far[e],t[i-1]);if(i===t.length-1)for(let t=0;t<4;t++)r.vertices.far[t].copy(this.vertices.far[t]);else for(let e=0;e<4;e++)r.vertices.far[e].lerpVectors(this.vertices.near[e],this.vertices.far[e],t[i])}}toSpace(t,e){for(let i=0;i<4;i++)e.vertices.near[i].copy(this.vertices.near[i]).applyMatrix4(t),e.vertices.far[i].copy(this.vertices.far[i]).applyMatrix4(t)}}const $m={lights_fragment_begin:"\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\tfloat linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )\n\tvec2 cascade;\n\tfloat cascadeCenter;\n\tfloat closestEdge;\n\tfloat margin;\n\tfloat csmx;\n\tfloat csmy;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\t\t// NOTE: Depth gets larger away from the camera.\n\t\t\t// cascade.x is closer, cascade.y is further\n\t\t\tcascade = CSM_cascades[ i ];\n\t\t\tcascadeCenter = ( cascade.x + cascade.y ) / 2.0;\n\t\t\tclosestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;\n\t\t\tmargin = 0.25 * pow( closestEdge, 2.0 );\n\t\t\tcsmx = cascade.x - margin / 2.0;\n\t\t\tcsmy = cascade.y + margin / 2.0;\n\t\t\tif( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {\n\n\t\t\t\tfloat dist = min( linearDepth - csmx, csmy - linearDepth );\n\t\t\t\tfloat ratio = clamp( dist / margin, 0.0, 1.0 );\n\n\t\t\t\tvec3 prevColor = directLight.color;\n\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\tbool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;\n\t\t\t\tdirectLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );\n\n\t\t\t\tReflectedLight prevLight = reflectedLight;\n\t\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t\tbool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;\n\t\t\t\tfloat blendRatio = shouldBlend ? ratio : 1.0;\n\n\t\t\t\treflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );\n\t\t\t\treflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );\n\t\t\t\treflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );\n\t\t\t\treflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );\n\n\t\t\t}\n\t\t\t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\t#else\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\n\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t#endif\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)\n\t\t// compute the lights not casting shadows (if any)\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_pars_begin:"\n#if defined( USE_CSM ) && defined( CSM_CASCADES )\nuniform vec2 CSM_cascades[CSM_CASCADES];\nuniform float cameraNear;\nuniform float shadowFar;\n#endif\n\t"+be.ShaderChunk.lights_pars_begin},{Vector2:tf,Vector3:ef,DirectionalLight:rf,MathUtils:nf,ShaderChunk:sf,Matrix4:of,Box3:af}=be,lf=new of,hf=new Km,cf=new ef,df=new af,uf=[],pf=[];class mf{constructor(t){t=t||{},this.camera=t.camera,this.parent=t.parent,this.cascades=t.cascades||3,this.maxFar=t.maxFar||1e5,this.mode=t.mode||"practical",this.shadowMapSize=t.shadowMapSize||2048,this.shadowBias=t.shadowBias||1e-6,this.lightDirection=t.lightDirection?ti(t.lightDirection):new ef(1,-1,1).normalize(),this.lightIntensity=t.lightIntensity||1,this.lightColor=t.lightColor||"#FFFFFF",this.lightNear=t.lightNear||1,this.lightFar=t.lightFar||2e3,this.lightMargin=t.lightMargin||200,this.customSplitsCallback=t.customSplitsCallback,this.fade=!1,this.mainFrustum=new Km,this.frustums=[],this.breaks=[],this.lights=[],this.shaders=new Map,this.enable=!0,this.createLights(),this.updateFrustums(),this.injectInclude()}createLights(){for(let t=0;t<this.cascades;t++){const t=new rf(this.lightColor,this.lightIntensity);t.castShadow=!0,t.shadow.mapSize.width=this.shadowMapSize,t.shadow.mapSize.height=this.shadowMapSize,t.shadow.camera.near=this.lightNear,t.shadow.camera.far=this.lightFar,t.shadow.bias=this.shadowBias,this.parent.add(t),this.parent.add(t.target),this.lights.push(t)}}updateLights(){for(let t=0;t<this.lights.length;t++){const e=this.lights[t];e.intensity=this.lightIntensity,e.color.copy(new be.Color(this.lightColor)),e.shadow.mapSize.width=this.shadowMapSize,e.shadow.mapSize.height=this.shadowMapSize,e.shadow.camera.near=this.lightNear,e.shadow.camera.far=this.lightFar,e.shadow.bias=this.shadowBias}}updateWithParams(){this.updateLights(),this.updateFrustums(),this.update()}initCascades(){const t=this.camera;t.updateProjectionMatrix(),this.mainFrustum.setFromProjectionMatrix(t.projectionMatrix,this.maxFar),this.mainFrustum.split(this.breaks,this.frustums)}updateShadowBounds(){if(!this.enable||!this.lights.length)return;const t=this.frustums;for(let e=0;e<t.length;e++){const t=this.lights[e].shadow.camera,i=this.frustums[e],r=i.vertices.near,n=i.vertices.far,s=n[0];let o;o=s.distanceTo(n[2])>s.distanceTo(r[2])?n[2]:r[2];let a=s.distanceTo(o);if(this.fade){const t=this.camera,e=Math.max(t.far,this.maxFar),r=i.vertices.far[0].z/(e-t.near);a+=.25*Math.pow(r,2)*(e-t.near)}t.left=-a/2,t.right=a/2,t.top=a/2,t.bottom=-a/2,t.updateProjectionMatrix()}}getBreaks(){const t=this.camera,e=Math.min(t.far,this.maxFar);switch(this.breaks.length=0,this.mode){case"uniform":i(this.cascades,t.near,e,this.breaks);break;case"logarithmic":r(this.cascades,t.near,e,this.breaks);break;case"practical":!function(t,e,n,s,o){uf.length=0,pf.length=0,r(t,e,n,pf),i(t,e,n,uf);for(let e=1;e<t;e++)o.push(nf.lerp(uf[e-1],pf[e-1],s));o.push(1)}(this.cascades,t.near,e,.5,this.breaks);break;case"custom":void 0===this.customSplitsCallback&&console.error("CSM: Custom split scheme callback not defined."),this.customSplitsCallback(this.cascades,t.near,e,this.breaks)}function i(t,e,i,r){for(let n=1;n<t;n++)r.push((e+(i-e)*n/t)/i);r.push(1)}function r(t,e,i,r){for(let n=1;n<t;n++)r.push(e*(i/e)**(n/t)/i);r.push(1)}}setEnable(t){this.enable!=t&&(this.enable=t,t?(this.createLights(),this.updateWithParams()):this.remove())}update(){if(!this.enable||!this.lights.length)return;const t=this.camera,e=this.frustums;for(let i=0;i<e.length;i++){const r=this.lights[i],n=r.shadow.camera,s=(n.right-n.left)/this.shadowMapSize,o=(n.top-n.bottom)/this.shadowMapSize;r.shadow.camera.updateMatrixWorld(!0),lf.multiplyMatrices(r.shadow.camera.matrixWorldInverse,t.matrixWorld),e[i].toSpace(lf,hf);const a=hf.vertices.near,l=hf.vertices.far;df.makeEmpty();for(let t=0;t<4;t++)df.expandByPoint(a[t]),df.expandByPoint(l[t]);df.getCenter(cf),cf.z=df.max.z+this.lightMargin,cf.x=Math.floor(cf.x/s)*s,cf.y=Math.floor(cf.y/o)*o,cf.applyMatrix4(r.shadow.camera.matrixWorld),r.position.copy(cf),r.target.position.copy(cf),r.target.position.x+=this.lightDirection.x,r.target.position.y+=this.lightDirection.y,r.target.position.z+=this.lightDirection.z}}injectInclude(){sf.lights_fragment_begin=$m.lights_fragment_begin,sf.lights_pars_begin=$m.lights_pars_begin}setupMaterial(t){t.defines=t.defines||{},t.defines.USE_CSM=1,t.defines.CSM_CASCADES=this.cascades,this.fade&&(t.defines.CSM_FADE="");const e=[],i=this,r=this.shaders;t.onBeforeCompile=function(n){const s=Math.min(i.camera.far,i.maxFar);i.getExtendedBreaks(e),n.uniforms.CSM_cascades={value:e},n.uniforms.cameraNear={value:i.camera.near},n.uniforms.shadowFar={value:s},r.set(t,n)},r.set(t,null)}updateUniforms(){const t=Math.min(this.camera.far,this.maxFar);this.shaders.forEach((function(e,i){if(null!==e){const i=e.uniforms;this.getExtendedBreaks(i.CSM_cascades.value),i.cameraNear.value=this.camera.near,i.shadowFar.value=t}!this.fade&&"CSM_FADE"in i.defines?(delete i.defines.CSM_FADE,i.needsUpdate=!0):this.fade&&!("CSM_FADE"in i.defines)&&(i.defines.CSM_FADE="",i.needsUpdate=!0)}),this)}getExtendedBreaks(t){for(;t.length<this.breaks.length;)t.push(new tf);t.length=this.breaks.length;for(let e=0;e<this.cascades;e++){const i=this.breaks[e],r=this.breaks[e-1]||0;t[e].x=r,t[e].y=i}}updateFrustums(){this.enable&&this.lights.length&&(this.getBreaks(),this.initCascades(),this.updateShadowBounds(),this.updateUniforms())}remove(){for(let t=0;t<this.lights.length;t++)this.lights[t].removeFromParent();this.lights=[]}dispose(){const t=this.shaders;t.forEach((function(t,e){delete e.onBeforeCompile,delete e.defines.USE_CSM,delete e.defines.CSM_CASCADES,delete e.defines.CSM_FADE,null!==t&&(delete t.uniforms.CSM_cascades,delete t.uniforms.cameraNear,delete t.uniforms.shadowFar),e.needsUpdate=!0})),t.clear()}fromJSON(t){for(const e in t)void 0!==this[e]&&("lightDirection"==e?this.lightDirection.copy(ti(t[e])):this[e]=t[e]);this.updateWithParams()}toJSON(){return{lightColor:this.lightColor,lightIntensity:this.lightIntensity,lightMargin:this.lightMargin,lightFar:this.lightFar,lightNear:this.lightNear,lightDirection:this.lightDirection.toArray(),shadowBias:this.shadowBias}}}const{Group:ff,Mesh:gf,LineSegments:vf,BufferGeometry:yf,LineBasicMaterial:wf,Box3Helper:xf,Box3:bf,PlaneGeometry:_f,MeshBasicMaterial:Af,BufferAttribute:Sf,DoubleSide:Tf}=be;class Ef extends ff{constructor(t){super(),this.csm=t,this.displayFrustum=!0,this.displayPlanes=!0,this.displayShadowBounds=!0;const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new yf;r.setIndex(new Sf(e,1)),r.setAttribute("position",new Sf(i,3,!1));const n=new vf(r,new wf);this.add(n),this.frustumLines=n,this.cascadeLines=[],this.cascadePlanes=[],this.shadowLines=[]}updateVisibility(){const t=this.displayFrustum,e=this.displayPlanes,i=this.displayShadowBounds,r=this.frustumLines,n=this.cascadeLines,s=this.cascadePlanes,o=this.shadowLines;for(let r=0,a=n.length;r<a;r++){const a=n[r],l=s[r],h=o[r];a.visible=t,l.visible=t&&e,h.visible=i}r.visible=t}update(){const t=this.csm,e=t.camera,i=t.cascades,r=t.mainFrustum,n=t.frustums,s=t.lights,o=this.frustumLines.geometry.getAttribute("position"),a=this.cascadeLines,l=this.cascadePlanes,h=this.shadowLines;for(this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.updateMatrixWorld(!0);a.length>i;)this.remove(a.pop()),this.remove(l.pop()),this.remove(h.pop());for(;a.length<i;){const t=new xf(new bf,16777215),e=new Af({transparent:!0,opacity:.1,depthWrite:!1,side:Tf}),i=new gf(new _f,e),r=new ff,n=new xf(new bf,16776960);r.add(n),this.add(t),this.add(i),this.add(r),a.push(t),l.push(i),h.push(r)}for(let t=0;t<i;t++){const e=n[t],i=s[t].shadow.camera,r=e.vertices.far,o=a[t],c=l[t],d=h[t],u=d.children[0];o.box.min.copy(r[2]),o.box.max.copy(r[0]),o.box.max.z+=1e-4,c.position.addVectors(r[0],r[2]),c.position.multiplyScalar(.5),c.scale.subVectors(r[0],r[2]),c.scale.z=1e-4,this.remove(d),d.position.copy(i.position),d.quaternion.copy(i.quaternion),d.scale.copy(i.scale),d.updateMatrixWorld(!0),this.attach(d),u.box.min.set(i.bottom,i.left,-i.far),u.box.max.set(i.top,i.right,-i.near)}const c=r.vertices.near,d=r.vertices.far;o.setXYZ(0,d[0].x,d[0].y,d[0].z),o.setXYZ(1,d[3].x,d[3].y,d[3].z),o.setXYZ(2,d[2].x,d[2].y,d[2].z),o.setXYZ(3,d[1].x,d[1].y,d[1].z),o.setXYZ(4,c[0].x,c[0].y,c[0].z),o.setXYZ(5,c[3].x,c[3].y,c[3].z),o.setXYZ(6,c[2].x,c[2].y,c[2].z),o.setXYZ(7,c[1].x,c[1].y,c[1].z),o.needsUpdate=!0}}const Pf={Group:Ya,Model:Fo,Billboard:Co,ImagePlane:ou,Polygon:Gc,Water:zc,ReflectorPlane:nu,...Zo,...Object.freeze({__proto__:null,AmbientLight:Hm,DirectionalLight:Xm,HemisphereLight:Wm,SpotLight:Ym,PointLight:Qm,RectAreaLight:Uu,CSM:mf,CSMHelper:Ef}),...jc};function Mf(t,e,i,r){if(K(t)||!Q(t)||!Pf[t])return null;const n=new(0,Pf[t])(i);return n.name=e||i.name,n.userData=i.userData||{},n.visible=!1!==i.visible,n.properties||(n.properties=i.properties||{}),n.properties.uuid||(n.properties.uuid=n.uuid),r&&r.forEach((t=>{const e=Mf(t.type,t.name,t.config,t.children);n.add(e)})),n}class Cf{static addOutlines(t,e){if(!t)return[];const i=pt({visibleOnly:!0,meshOnly:!0,replaceOriginalObject:!1,color:"#000000",opacity:1,thresholdAngle:5},e),r=this.OUTLINE_MATERIAL.clone();if(r.color.copy(new THREE.Color(i.color||"#000000")),r.opacity=i.opacity,0===t.children.length&&(i.visibleOnly&&!t.visible||i.meshOnly&&!(t instanceof THREE.Mesh)))return[];const n=t,s=n.children.length;if(s>0)for(let t=s-1;t>=0;--t){const e=n.children[t];this.addOutlines(e,i).forEach((t=>t.applyMatrix4(n.matrixWorld)))}if(!n.geometry)return[];const o=(t,e)=>{const n=new THREE.EdgesGeometry(t,i.thresholdAngle);n.applyMatrix4(e);const s=new THREE.LineSegments(n,r);return s.name="line-edge",s.userData.hideInTree=!0,s.userData.isLocked=!0,s.userData.isOutline=!0,s.userData.skipStyle=!0,s.locked=!0,s.matrixAutoUpdate=!1,s.updateMatrix(),s},a=[];if(n instanceof THREE.InstancedMesh)for(let t=0;t<n.count;++t){const e=new THREE.Matrix4;n.getMatrixAt(t,e);const r=o(n.geometry,e);if(i.replaceOriginalObject&&n.parent){n.parent.children.push(r)}else n.children.push(r);a.push(r)}else{const t=o(n.geometry,n.matrix);if(i.replaceOriginalObject&&n.parent){n.removeFromParent(),n.geometry.dispose();n.parent.children.push(t)}else n.children.push(t);a.push(t)}return a}static updateOutlines(t,e){if(t&&Array.isArray(t.children)&&e)for(let i=t.children.length-1;i>=0;--i){const r=t.children[i];r.children.length>0&&this.updateOutlines(r,e),r.userData.isOutline&&(e.color&&r.material.color.copy(new THREE.Color(e.color)),void 0!==e.opacity&&(r.material.opacity=e.opacity))}}static removeOutlines(t){if(t&&Array.isArray(t.children))for(let e=t.children.length-1;e>=0;--e){const i=t.children[e];i.children.length>0&&this.removeOutlines(i),i.userData.isOutline&&t.remove(i)}}static hasOutline(t){let e=!1;for(let i=0;i<t.children.length;++i){const r=t.children[i];if(r.userData.isOutline){e=!0;break}if(r.children.length>0&&(e=this.hasOutline(r),e))break}return e}}Cf.OUTLINE_MATERIAL=new THREE.LineBasicMaterial({name:"outline",color:0,transparent:!0,opacity:.2}),be.Object3D.prototype.getInParentIndex=function(){var t=this.parent.children,e=-1;for(let i=0,r=t.length;i<r;i++)if(t[i]==this){e=i;break}return e},be.Object3D.prototype.getNodeParent=function(){let t=this.parent;if(!t)return null;if(t.isThing)return t;for(;t.parent&&!t.parent.isThing;)t=t.parent;return t.isThing?t:null},be.Object3D.prototype.getRefPositions=function(t){return[{x:.5,y:.5,z:.5},{x:0,y:0,z:0},{x:0,y:1,z:0},{x:1,y:1,z:0},{x:1,y:0,z:0},{x:0,y:0,z:1},{x:0,y:1,z:1},{x:1,y:1,z:1},{x:1,y:0,z:1},{x:0,y:.5,z:0},{x:.5,y:0,z:0},{x:1,y:.5,z:0},{x:.5,y:1,z:0},{x:0,y:0,z:.5},{x:0,y:1,z:.5},{x:1,y:0,z:.5},{x:1,y:1,z:.5},{x:0,y:.5,z:1},{x:.5,y:0,z:1},{x:1,y:.5,z:1},{x:.5,y:1,z:1},{x:.5,y:.5,z:0},{x:0,y:.5,z:.5},{x:.5,y:.5,z:1},{x:1,y:.5,z:.5},{x:.5,y:0,z:.5},{x:.5,y:1,z:.5}].map((e=>this.getRefPosition(e.x,e.y,e.z,t)))},be.Object3D.prototype.add=function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}if(1==arguments.length&&Array.isArray(arguments[0])){for(let t=0;t<arguments[0].length;t++)this.add(arguments[0][t]);return this}if(t===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this;if(t&&t.isObject3D){if(null!==t.parent&&t.parent.remove(t),t.setInteract(),t.setProperties(),t.properties.uuid||(t.properties.uuid=t.uuid),t.parent=this,this.children.push(t),mo.addObject(t),!t.scene){const e=ai(t);e.isScene&&(t.scene=e,t.traverse((t=>{t.scene=e})))}t.dispatchEvent({type:"added"}),t.removeEventListener("removed",this._extendRemoved),t.addEventListener("removed",this._extendRemoved)}else{if(q(t)&&!K(t.type)){const{type:e,config:i,children:r,name:n}=t,s=Mf(e,n,i,r);return this.add(s)}console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t)}return this},be.Object3D.prototype._extendRemoved=function(t){var e=t.target;e&&e.resource&&(e.resource.removeObject(e),e.resource=null)},be.Object3D.prototype.removeProperty=function(t){this.properties&&(delete this.properties[t],this.dispatchEvent({type:ie,data:{key:t}}))},be.Object3D.prototype.setProperties=function(t,e){if(this.properties||(this.properties={},this.properties.uuid=this.uuid),t)if(1==arguments.length&&q(t))for(const e in t)this.properties[e]!==t[e]&&(this.properties[e]=t[e]);else{if(this.properties[t]===e)return;this.properties[t]=e}},be.Object3D.prototype.query=function(t){const e=t||{};let i,r,n,s,o;if(q(e)){const{properties:t,type:a,property:l,userData:h,name:c}=e;W(t)&&(n=new Me(t)),W(l)&&(i=new Me(l)),W(h)&&(s=new Me(h)),W(a)&&(r=new Me(a)),W(c)&&(o=new Me(c))}W(e)&&(propsFilter=new Me(e));let a=[];return this.traverse((t=>{let e=!1;e=(!r||r.validate({type:t.type}))&&(!o||o.validate({name:t.name}))&&(!i||i.validate(t))&&(!s||s.validate(t.userData))&&(!n||n.validate(t.properties)),e&&a.push(t)})),a},be.Object3D.prototype.traverseFilter=function(t,e){return this.query(e).forEach((function(e){t&&t(e)})),this},be.Object3D.prototype.traverseMaterial=function(t){return this.traverse((function(e){e.material&&(e.isMesh||e.isLine)&&(Array.isArray(e.material)?e.material.forEach(t):t(e.material))})),this},be.Object3D.prototype.traverseChild=function(t){for(var e=this.children,i=0,r=e.length;i<r;i++)e[i].traverse(t);return this},be.Object3D.prototype.insertTo=function(t,e){if(void 0===e)return t.add(this);null!==this.parent&&this.parent.remove(this),this.parent=null,t.children.splice(e,0,this),this.parent=t,this.dispatchEvent({type:"added"})},be.Object3D.prototype.removeBySelf=function(){this.parent&&this.parent.remove(this)},be.Object3D.prototype.getMeshByName=function(t){var e=null;return this.traverseBreakable((function(i){if(i.isMesh&&i.name==t)return e=i,!0})),e},be.Object3D.prototype.hasMesh=function(){var t=!1;return this.traverseBreakable((function(e){if(e.isMesh)return t=!0})),t},be.Object3D.prototype.hasChild=function(t){for(var e=0;e<this.children.length;e++){if(this.children[e]==t)return!0}return!1},be.Object3D.prototype.getMeshNames=function(){var t=[];return this.traverse((function(e){e.isMesh&&t.push(e.name)})),t},be.Object3D.prototype.getSkinnedMesh=function(){var t=[];return this.traverse((function(e){e.isSkinnedMesh&&t.push(e)})),t},be.Object3D.prototype.hasSkinnedMesh=function(){var t=!1;return this.traverseBreakable((function(e){if(e.isSkinnedMesh)return t=!0})),t},be.Object3D.prototype.getBones=function(t,e){for(var i=[],r=0;r<e.bones.length;r++){for(var n=li(e.bones[r],t),s=this,o=n.length-1;o>=0;o--){var a=n[o];s=s.children[a]}i.push(s)}return i},be.Object3D.prototype.hasSprite=function(){var t=!1;return this.traverseBreakable((function(e){if(e.isSprite)return t=!0})),t},be.Object3D.prototype.hasTexture=function(t){var e=!1;return this.traverseBreakable((function(i){var r=i.material;for(var n in r){var s=r[n];if(s&&s.isTexture&&s==t)return e=!0}})),e},be.Object3D.prototype.hasMaterial=function(t){var e=!1;return this.traverseBreakable((function(i){if(i.material==t)return e=!0})),e},be.Object3D.prototype.identity=function(){this.matrix.identity(),this.matrix.decompose(this.position,this.quaternion,this.scale),this.updateMatrixWorld(!0)},be.Object3D.prototype.replace=function(t,e,i){if(e&&e.isObject3D)for(var r=0;r<this.children.length;r++){var n=this.children[r];if(n==t){i&&i(n),n=void 0,e.parent=this,e.dispatchEvent({type:"added"}),this.children[r]=e;break}}},be.Object3D.prototype.insert=function(t,e){t>this.children.length||e&&(this.children.splice(t,0,e),e.parent=this,e.dispatchEvent({type:"added"}))},be.Object3D.prototype.getFacesNumber=function(){var t=0;return this.traverse((function(e){if(e.isMesh){var i=e.geometry;i.isBufferGeometry?t+=i.index.count/3:i.isGeometry&&(t+=i.faces.length)}})),t},be.Object3D.prototype.getVerticesNumber=function(){var t=0;return this.traverse((function(e){if(e.isMesh){var i=e.geometry;i.isBufferGeometry?t+=i.index.count:i.isGeometry&&(t+=i.vertices.length)}})),t},be.Object3D.prototype.getNodes=function(){var t=[];return this.traverse((function(e){t.push(e)})),t},be.Object3D.prototype.getNode=function(t){var e;return this.traverseBreakable((function(i){if(i.id==t)return e=i,!0})),e},be.Object3D.prototype.setTransform=function(t){var e=new be.Vector3,i=new be.Vector3,r=new be.Quaternion;t.decompose(e,r,i),this.quaternion.copy(r),this.position.copy(e),this.scale.copy(i)},be.Object3D.prototype.keepSize=function(t,e,i){if(this.parent){var r=new be.Vector3;this.getWorldPosition(r);var n=t.sub(r).length();if(e.isVector2){var s=[i/e.x,i/e.y];this.scale.set(n/s[0],n/s[1],1)}}},be.Object3D.prototype._setWorldPosition=function(t,e){var i=t;this.parent&&(e&&this.parent.updateMatrixWorld(),i=this.parent.worldToLocal(t)),this.position.set(i.x,i.y,i.z)},be.Object3D.prototype._setWorldAngles=function(t){for(var e=this.parent;e;e=e.parent){var i=ii(e.rotation);i.invert(),t.premultiply(i)}var r=ei(t);this.rotation.copy(r)},be.Object3D.prototype._setWorldScale=function(t){for(var e=this.parent;e;e=e.parent){var i=new be.Vector3,r=new be.Quaternion,n=new be.Vector3;e.matrix.decompose(i,r,n),t.divide(n)}this.scale.copy(t)},be.Object3D.prototype.createMergeGeometries=function(){this.updateMatrixWorld();var t=new be.Geometry;return this.traverse((function(e){if(e.isMesh){var i=e.geometry;i.isBufferGeometry&&(i=(new be.Geometry).fromBufferGeometry(i)),t.merge(i,e.matrixWorld)}})),t},be.Object3D.prototype.getRefPosition=function(t,e,i){if(2==arguments.length)return this.getDefaultRefPositions(arguments[1])[arguments[0]];t=void 0!==t?t:.5,e=void 0!==e?e:1,i=void 0!==i?i:.5;var r=this.getBox3(),n=new be.Vector3;r.getSize(n);var s=new be.Vector3;r.getCenter(s),console.log(s);var o=new be.Vector3;return o.x=s.x+n.x*(t-.5),o.y=s.y+n.y*(e-.5),o.z=s.z+n.z*(i-.5),o},be.Object3D.prototype.updateBox=function(){if(this.boxHelper){this.remove(this.boxHelper);const e=this.getBox3();var t=new be.Matrix4;t.copy(this.matrixWorld).invert(),e.applyMatrix4(t),this.boxHelper.box=e,this.attach(this.boxHelper)}},be.Object3D.prototype.getBox3=function(t){return(new be.Box3).setFromObject(this)},be.Object3D.prototype.getCenter=function(){var t=this.getBox3(),e=new be.Vector3;return t.getCenter(e),e},be.Object3D.prototype.getSize=function(){var t=this.getBox3(),e=new be.Vector3;return t.getSize(e),e},be.Object3D.prototype.getAngles=function(){return ri(this.rotation)},be.Object3D.prototype.distanceTo=function(t){return t?(t instanceof be.Object3D&&t.position&&(t=t.position),t.distanceTo(this.position)):0},be.Object3D.prototype.indexOfParent=function(){return this.parent?this.parent.children.indexOf(this):-1},be.Object3D.prototype.indexOf=function(t){return t?this.children.indexOf(t):-1},be.Object3D.prototype.isBrotherOf=function(t){if(!t)return!1;let e=this.parent;return!!e&&-1!==e.children.indexOf(t)},be.Object3D.prototype.getChildNodesNumber=function(t){var e=0;return this.traverse((function(){e++})),e},be.Object3D.prototype.detach=function(t){return this.parent&&this.parent.updateMatrixWorld(),t.attach(this),this},be.Object3D.prototype.getChildrenNames=function(){var t=[];return this.traverse((function(e){e.name&&t.push(e.name)})),t},be.Object3D.prototype.getVisibleChildrenNumber=function(){var t=0;return this.traverse((function(e){e.visible&&t++})),t},be.Object3D.prototype.getInvisibleChildrenNumber=function(){var t=0;return this.traverse((function(e){e.visible||t++})),t},be.Object3D.prototype.getMeshes=function(){var t=[];return this.traverse((function(e){e.isMesh&&t.push(e)})),t},be.Object3D.prototype.getMaterials=function(){var t={};return this.traverse((function(e){e.material&&(Array.isArray(e.material)?e.material.forEach((function(e){t[e.uuid]=e})):t[e.material.uuid]=e.material)})),Object.keys(t).map((e=>t[e]))},be.Object3D.prototype.traverseBreakable=function(t){if(t(this))return this;for(var e=this.children,i=0,r=e.length;i<r;i++){var n=e[i].traverseBreakable(t);if(n)return n}return null},be.Object3D.prototype.getChildIndex=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e]==t)return e;return-1},be.Object3D.prototype.isChildOf=function(t){if(!t)return!1;let e=this.parent;for(;e;){if(e==t)return!0;e=e.parent}return!1},be.Object3D.prototype.setInteract=function(t){this.interact||(this.interact={selectable:!0}),t&&pt(this.interact,t)},be.Object3D.prototype.resetMaterial=function(){return this.material?wo.resetMaterial(this):this.traverse((function(t){wo.resetMaterial(t)})),this},be.Object3D.prototype.setBoxHelper=function(t){if(this.boxHelper&&(this.boxHelper.removeFromParent(),this.boxHelper=null),t){this.updateMatrix();const e=this.boxHelper=new be.BoxHelper(this,ni(t.color||ce));e.userData.skipStyle=!0,e.isHelper=!0,e.locked=!0,this.attach(e)}return this},be.Object3D.prototype.setEdge=function(t){t?this.getObjectByName("line-edge")?Cf.updateOutlines(this,t):Cf.addOutlines(this,t):Cf.removeOutlines(this)},be.Object3D.prototype.getBy=function(t){if(!t)return;const e=t.split(".");let i=this,r=0,n=new Array(e.length);for(;Lt(i[e[r]]);){n[r]=!0,i=i[e[r++]]}return n.filter((t=>Lt(t))).length<e.length?void 0:function t(e){if(!Z(e))return!e||Q(e)||Y(e)||J(e)?e:e.isColor?e.toHexString():e.toArray?e.toArray():e instanceof Image?e.src:e.value?t(e.value):e}(i)},be.Object3D.prototype.updateBy=function(t,e){if(!t||tt(t))return this;const{uuid:i,name:r,layers:n,position:s,rotation:o,scale:a,visible:l,renderOrder:h,frustumCulled:c,receiveShadow:d,castShadow:u,center:p,locked:m,material:f,materialArraySize:g,properties:v,interact:y,video:w,userData:x,style:b,geometry:_,arrow:A,line:S,polygon:T,points:E,shader:P,light:M,images:C,shadow:L,particle:R,box:O,edge:F}=t;function N(t){if(Lt(c)&&(t.frustumCulled=c),q(v)&&t.setProperties(v),q(y)&&t.setInteract(y),Lt(i)&&(t.uuid=i),Lt(r)&&(t.name=r),Lt(l)&&(t.visible=l),Lt(h)&&(t.renderOrder=h),Lt(p)&&(t.center=p),Lt(m)&&(t.locked=m),q(O)&&t.setBoxHelper(O),q(x))for(const e in x)t.userData[e]=x[e];if(q(F)&&t.setEdge(F),s&&t.position.copy(ti(s)),o){const e=ti(o);t.rotation.set(e.x,e.y,e.z)}Lt(a)&&(J(a)?t.scale.setScalar(a):t.scale.copy(ti(a))),Lt(_)&&t.updateGeometry&&t.updateGeometry(_),Lt(M)&&t.updateLight&&t.updateLight(M),Lt(L)&&t.shadow&&t.updateShadow(L),Lt(R)&&t.particle&&t.updateParticle(R),Lt(C)&&t.updateImages&&t.updateImages(C),Lt(A)&&t.updateArrow&&t.updateArrow(A),Lt(S)&&t.updateLine&&t.updateLine(S),Lt(T)&&t.updatePolygon&&t.updatePolygon(T),Lt(E)&&t.updatePoints&&t.updatePoints(E),Lt(P)&&t.updateShader&&t.updateShader(P),w&&t.updateVideo&&t.updateVideo(w),f&&t.updateMaterial&&t.updateMaterial(f,g),b&&t.updateStyle&&t.updateStyle(b),(Lt(d)||Lt(u)||Lt(n))&&t.traverse((function(t){Lt(d)&&(t.receiveShadow=!!d),Lt(u)&&(t.castShadow=!!u),Lt(n)&&t.layers.set(n)}))}e?this.query(e).forEach((function(t){N(t)})):N(this);return this},be.Object3D.prototype.toJSON2=function(t){return{isObject:!0,name:this.name,type:this.type,config:{name:this.name,visible:this.visible,position:this.position.toArray(),scale:this.scale.toArray(),rotation:this.rotation.toArray(),layers:this.layers.mask,userData:this.userData,style:this._styleCache,interact:this.interact,properties:this.properties}}},be.Object3D.prototype.updateMaterial=function(t){if(!t)return this;let e=this.isThing?this:this.parent&&this.parent.isThing?this.parent:null;e&&e.option.material&&pt(e.option.material,t),this.material?wo.updateMaterial(this,t):this.traverse((function(e){wo.updateMaterial(e,t)}))},be.Object3D.prototype.cloneByJSON=function(){const t=this.toJSON();return new this.constructor(t.config)},be.Object3D.prototype.dispose=function(){this.traverse((function(t){const{geometry:e,material:i}=t;e&&e.dispose(),i&&(W(i)?i.forEach((t=>t.dispose())):i.dispose())}))},Object.defineProperty(be.Object3D.prototype,"locked",{get(){return this.layers.getChannel()==pe.IGNORE_RAYCAST},set(t){this.traverse((e=>{e.layers.set(t?pe.IGNORE_RAYCAST:0)}))}});var Lf=Object.freeze({__proto__:null,LabelTexture:Po}),Rf=Object.freeze({__proto__:null,MTLLoader:je,OBJLoader:ke,ThingLoader:$a,GLTFLoader:mi,FBXLoader:Us});function Of(t,e){return Math.sqrt(t*t+e*e)}const Ff=1e-8,Nf=1e-6;var Df=Object.freeze({__proto__:null,CoordinateTransformer:class{constructor(t){t=t||{};var e=this.originLocal1=t.originLocal1||{x:0,y:0},i=this.originLocal2=t.originLocal2||{x:0,y:0},r=this.originXY1=t.originXY1||{x:0,y:0},n=this.originXY2=t.originXY2||{x:0,y:0},s=e,o={x:Math.abs(e.x-i.x),y:Math.abs(e.y-i.y)},a=[{x:r.x,y:r.y},{x:n.x,y:r.y},{x:n.x,y:n.y},{x:r.x,y:n.y}];this._locOrigion=s,this._locRange=o,this._mapOrigion=a[0];var l=this._mapAxisX={x:a[1].x-a[0].x,y:a[1].y-a[0].y},h=this._mapAxisY={x:a[3].x-a[0].x,y:a[3].y-a[0].y},c=this._mapRange={x:this.getVectorLen(l),y:this.getVectorLen(h)};l.x/=c.x,l.y/=c.x,h.x/=c.y,h.y/=c.y}getVectorLen(t){return Math.sqrt(t.x*t.x+t.y*t.y)}transform(t){var e=this._locOrigion,i=this._locRange,r=this._mapRange,n=this._mapOrigion,s=this._mapAxisX,o=this._mapAxisY,a=(t.x-e.x)/i.x,l=(t.y-e.y)/i.y,h=a*r.x,c=l*r.y;return{x:n.x+s.x*h+o.x*c,y:n.y+s.y*h+o.y*c}}toXY(t,e){return this.transform({x:t,y:e})}},GeoCoordinateTransformer:class{constructor(t){t=t||{},this.unit=t.unit||1,this.originLngLat1=t.originLngLat1||{x:0,y:0},this.originLngLat2=t.originLngLat2||{x:0,y:0},this.originXY1=t.originXY1||{x:0,y:0},this.originXY2=t.originXY2||{x:0,y:0},this.translate={x:0,y:0},this.originXY1.x<0&&(this.originXY2.x<0?this.translate.x=Math.abs(this.originXY1.x-this.originXY2.x):this.translate.x=Math.abs(this.originXY1.x)),this.originXY1.y<0&&(this.originXY2.y<0?this.translate.y=Math.abs(this.originXY1.y-this.originXY2.y):this.translate.y=Math.abs(this.originXY1.y))}_getParam(){let t=this.originLngLat1.x,e=this.originLngLat1.y,i=this.originLngLat2.x,r=this.originLngLat2.y,n=this.originXY1.x,s=this.originXY1.y,o=this.originXY2.x,a=this.originXY2.y,l=this.translate.x,h=this.translate.y;return{lon1:t,lat1:e,lon2:i,lat2:r,x1:n+l,y1:s+h,x2:o+l,y2:a+h}}toLngLat(t,e){const{lon1:i,lat1:r,lon2:n,lat2:s,x1:o,y1:a,x2:l,y2:h}=this._getParam();let c=Math.cos(s*Math.PI/180),d=(n-i)*c||Ff,u=s-r||Ff,p=l-o||Nf,m=h-a||Nf,f=t-o||Nf,g=e-a||Nf,v=(f*f+g*g)*(d*d+u*u)/(p*p+m*m||Nf),y=(p*f+g*m)*Of(d,u)*Math.sqrt(v)/(Of(p,m)*Of(f,g)||Nf),w=Math.sqrt(y*y*u*u-(d*d+u*u)*(y*y-v*d*d)),x=(y*u+w)/(d*d+u*u||Ff),b=(y*u-w)/(d*d+u*u||Ff),_=(y-x*u)/(d||Ff)/c+i,A=x+r,S=0,T=0;return((t-o)*(h-a)-(e-a)*(l-o))*((_-i)*(s-r)-(A-r)*(n-i))<0?(S=_,T=A):(S=(y-b*u)/(d||Ff)/c+i,T=b+r),isNaN(S)||isNaN(T)?null:{x:S,y:T}}toXY(t,e){let{lon1:i,lat1:r,lon2:n,lat2:s,x1:o,y1:a,x2:l,y2:h}=this._getParam(),c=Math.cos(s*Math.PI/180),d=(n-i)*c,u=s-r||Ff,p=(t-i)*c||Ff,m=e-r||Ff,f=l-o||Nf,g=h-a||Nf,v=(p*p+m*m)*(f*f+g*g)/(d*d+u*u||Ff),y=(d*p+m*u)*Of(f,g)*Math.sqrt(v)/(Of(d,u)*Of(p,m)||Ff),w=Math.sqrt(Math.abs(y*y*g*g-(f*f+g*g)*(y*y-v*f*f))),x=(y*g+w)/(f*f+g*g||Ff),b=(y*g-w)/(f*f+g*g||Ff),_=(y-x*g)/(f||Ff)+o,A=x+a,S=0,T=0;if(((t-i)*(s-r)-(e-r)*(n-i))*((_-o)*(h-a)-(A-a)*(l-o))<0?(S=_,T=A):(S=(y-b*g)/(f||Ff)+o,T=b+a),isNaN(S)||isNaN(T))return null;let E=this.translate;return{x:S-E.x,y:T-E.y}}}});function If(t,e,i,r,n,s){t=t||24;let o=document.createElement("canvas");o.width=t,o.height=t;let a=o.getContext("2d");return a.fillStyle=e||"#ff0000",a.strokeStyle=s||"#ffffff",a.lineWidth=n||10,a.beginPath(),a.arc(t/2,t/2,t/2,0,2*Math.PI),a.closePath(),i&&a.fill(),r&&a.stroke(),o}const Uf=new Image;Uf.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxQURGRTMxOEE3QjgxMUU2QTFDQkE2OEJCNDMzQzU4RiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxQURGRTMxOUE3QjgxMUU2QTFDQkE2OEJCNDMzQzU4RiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFBREZFMzE2QTdCODExRTZBMUNCQTY4QkI0MzNDNThGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFBREZFMzE3QTdCODExRTZBMUNCQTY4QkI0MzNDNThGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+WpeE1wAABsNJREFUeNrcW2tsFUUUnr33FmsxjaVAYwRN/GE0iqKJSoImYvCHilJFjQ/wnSj8UuMLBaOYUHwQ/YGgCdGIiRofMdSA9W2QIrW+Qn8gSjQCWgtCW0OR9nZ3/Gb37O3c7W7vztydu7dO8nX37s7OOfPNmZkzZ6YW55zFTdZzUS9i3DN2An6fj+tM4CzgFKAROI7eHwYOAr8CXcCPjLMOXLsLJciqRt3Ljx8oXaccM5tqgMuAW4ALoWjTGHkbgOlE0DX0rAfYCmwAPgTySSuYMVj5ZmALsBFYADRplNFE326ksprHAwFnAJ8A76PFZ7nmmQxmuWV6ZZ9ZrQTcCUW3AHMTrHgQc10ZQlaVEbACWA9MYuZTA8laUW5ByQyCnK3F38Ws8mk5MBlYUhkCnJDpz2ItICCNyvtpMXTohw5LGTdNAB/1+w4If4SlnTh04GwnTZcVGwNOA9YZHOzUwNjLpJNBAooFvghMYNWTaoG1AR2NWcB8CLikalp/BHNc3QxbQBZ4KkGl84SkyhO65eJagM4gOA+YUaa5tgMfkJ+/j55Nc9cLjF0JzC6jbKHb5UCrKQLuLkO5nzFrPBih3O9EzNPAVZD1LK6nanukMQlQHQOaymgdscS9NKZirZS3S1PWxcBUE2PAbKBeo1/+RgPUHgVpe9xvvG9V5QkdLzBBwDmaA9MSCnaopoPut3oyzzNBwAwNRT4G2tx74UrbMeTYlNf7vo3KUJU708QYcLJGK75dWEc4ARLCwmd2IK9chlo6ycQsMEVRiX+BbZEtXCNVnFPAiweI8WaebVTWsQqyp5ggYKIiAf3A3siVZV5ypvP0zAp1Y/dSWSoE1JkgwFYkQFRpOPSNRW8PS5pYkT58PuboMdbiPZExYEAxfx1Fb8KdqmGqWp7uo91XEWWaaEJX1YBIT9zBhdLxzNsD6C4a6Di1py01gU9ANpDPS2dTWSqpx8Q0qOOUzCvcO1KnsENmAZveOUXToMAVWs6XAQK6NBS5AWgsTH92yEgvkyBbh0fCZCpDVW6XiTGgQ0MRUYHnI8NqpUJv4luvDNUI0XYTFvCtpku7CFiq8Z34ZqHGdwega6cJAnqBjzR985X4u5pCV3HCW6vdb/RkbQb6TEWEXi0jWnM/rfnFZun0EAnT6F27m1dfznozESEvfYrCv8L1Is21+rnAa9SVdrjmOuK6iimzscxoUxsG061xM+vuCzzpElFeEhWdYyA6vExlg0Q3LP4Zpqh3i1Zt1YE1+Pud6aiwbwn3AX2setIvwGMhS+lE/QA57QMRC6tkP8B2nSXG/lGthBoBQZPjbJMbvU2fgHuB70fpZ9gC/PQQhG1OrfKOe05gja7ySR2QWARFfkph0BPTXVlb80oEWE4EODuEdUwzMGAx/9iAcXQD17nrx+j1gMFZYLSgXbi/FuAVMP1BYAHwl9sAdjgq2QUKXhis4S6AGcZtkPV1EgqbOCb3CscSVhxANYRnIOOtpJRVc4XteL0ESSx6xFHY+QmTK3aUH+YKfTwNC/AGTM5uAnYkaPa7gBuT1tPkUdkjUPh6oC+Byg9anqc3MJ4I8GeGq8suhbObmTg9biApjQEZp0T8Ljx9CYdFhLZaNHV8CZP+e8y3hsg+VwkLCPPGYgiH4quANzVMv8MqdQjTKqFbop7gcDjGDHWPpHtY1D5h9Jxz+5gOGIXQI/UyFBIb1QVcYeSf8hBK6Z9SxFL1VuDzmCWLE6g7Q7sZWUjhnZX2ICiZoSVvaow2xS+g+DsxTH838r4QSTgvv++bmQWskYslDVpy5VCBlhi+/hPIO1xEysjCa1xNg2ELpx8obh9VeREpfkNnZVedBBTPBr5VrBxjmbscebjFK6NTRQngVoGIdsvbIAn2oE68a5Xz/q8I8CvGvV3gVcHBD8+WFd5XKOUqQHANQcgSxx+ybiUZ+waepZjmTqe8nU6GbYcZTJX8AP/EgH+OxKlmAkS71RHEcZZaqniWiPDPfmTcts6w/dzBlGizx13/Ics24Cp2i5ok345Lk6pNJBylRdERAk+bgCwp3UAVz0juiTyG8yLPgLMaOE2tIOBR/PoT95uY92+0wwFSc9K9JZXtEBG9zDsOY6dFgAh8nAgMMrXTXPWoxn7Q9TqufwAOqlYbMHNewuLqmbepKqxud1oE9FLLTSA40uqglHk2Ojm2Dtch9xRI6T7uW4HfrYScftIhtS7wNykwiVpEtOIxREYmwp3hUvcZJD1y0nMrpNK+2Q9R3z9K64tDuuaf5CAoFDhAsIgE3yJqJGQlWNJM4Q9wjBUfk7KlGSBPlR+iyifiKv0nwACk4hF6ksLcSAAAAABJRU5ErkJggg==",mo.set({id:"thing-poi",type:"image",data:Uf});(new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3NTIwNjM3MkIxOTIxMUVEQjFCREM4RURDMTY0QkZFQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3NTIwNjM3M0IxOTIxMUVEQjFCREM4RURDMTY0QkZFQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjc1MjA2MzcwQjE5MjExRURCMUJEQzhFREMxNjRCRkVCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjc1MjA2MzcxQjE5MjExRURCMUJEQzhFREMxNjRCRkVCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+TlHQ8gAAGNZJREFUeNrsXWuMZMV1/ur2+zE9r51970IA8yYYOwECxjGgSCFRIuH8iUikKJEtRZH4lfyK4j8hf538IEFRnARbNkgJMRhHjoUBY0wcdhcw3l0e+xpgPbsz+5jZefZrbt9bOXX73pnpnr5V5/buzN5upqC2e7r7vqrO+c53Tp2qElJKtJeHPgBemwWsBMJLcJhY8z74G4zjOh2LDucJO7cM+Y3uHKLDsbpz6c4vQo4NuyYM7RTlujLkXjTFdSB+cgfkb5ZaP09qjhF0IRn1QlslBkV2/KyjmlgRT7NVeqWINVWjulZo10v/QLGl+T2PApo+tBgn2ur+3scCGQ0BIlOMrRJTFBB+DRWBJANItoxAn2p/uAC0EgjpI4Vc59oIjVsnDO5imKvUykE6i2O7Gxfm3kVx+biurexwrGS6mDC4ibouEwZMXu8aijY2F0EAZMuh0geTVSGQITfere8sGQ9oEoawDhEhgiMNDSsM52vvMNnhep2eby2mhp1Hd88mARctbrxj8umSTChx6QTWusubbkhoJFRG0IowYJMRBS8MlQRTm8NQQmiQwRSYCutAEXIuyXLYVee7nI7lCkBwmeS6y5kiWNIAczrN5wqYbDNdYSgVdp/ScP9gwH4YfHPuxyQ4Jkq+XmjVfzaHykcRAMf7vVjDDMIkWDKFw6RlnTpHMIRNGLRQd8+C0Vk61BKa+2+/P52AywgK1Xot9W2D26lRBKApBBJpuoTbEea75amcBtYhjmAQSx3RkprOkh2CKbpYvDRwDNlBSXQmoJPAhCuF8Hlag2EmuhKABl0izYwfmKVWGDpIpy2CyaJNjQeGnRURTIhukCjsvrjei1nAle2vR+maZGSNlWRbBLIeMYTB7YsiEFID8dxIhIzAJUx2NKqXLRj3oBMmEwk1EepA+0UI/EfiAELb6A0fZhJ+jInvA0tGPEAaYL2T24UQaOUKoon06e4vzA00dZ5OeKTmOcM7V/1bi6rP0RGgeUvLdLmChwLCAJU6tt/teLdgaGknvxoGbZKMewjrYGkQKsFEDo6X0BktFCLbkY5nBoI6FdsjgkGEEAx3qhPDFgY30RTxEkyYRoTG55JawfQ8whBFGLwkk0lq/czytV9uBgLANwGKbBSwdryQmw0kNSROGiJyUbwJU+BFagiZ0JgZU4ROhEQAdWRXF23Ut4PwkXi5G2+rGw4QlDrdSI5eE544cDpAZ38FMwAkIxBAUwpWFM/EFNgCI9TLiXvogkmd78ei78voMoGnWwSAr/kKdkqeAHA0gusZCIMrBA25lIYQLyd2YBqo4UQZdaiku8ewduncJsLz+Tmu3xXmAEGpeWZAdAgRh7F3aAIkHOKkY9kC3Fi5mXyGaaLuXjlEU2jQiGvzV59d2f4KLiN973IQILgVBT/DWDt2yIVsoWHHHDtmgmNOGLWbkciwqJ5J8EzEUTCQZvW7IN5fu5wOvFwBCFBAhYhTMCWQ6aJyIkKn6WA0ikZyw80yArR2QgjTOAh3wAjrmP/cSiwmqjd0BUjg2sdYpLqdfu9o7TlHw0zzDDrZcsnwx6MM8AhD0IrrtupcUO6oYWevRPg+f/VytfdKIAB8O6TckPQ6UxAlWGOCWJMwcAQKzHNGiWvAgC4cwqgbal7vfirPayaS7d8gEri2zFPduRIdlIyH5Pj5XPsqI2ieiZRK8IeFo0bxOCggNCHh5id1+rcSqXc20AS0o0DWC0t2imULhnabcuJEBE03xRB0giE1nWeC+7D8ApNS8RROTdi7gCs0cedKIoD0SckebaNzsmc4kUUOcTKlZJl8dRjMgzCct5MgmYaIpTYKaNF3Narlrvy1DeQAQVnyvYIcmnmE6ztWMCGTkz7FSdCExmc3CYTQBJpMuYKmaKBJ4ztzCDUCO9uV9ovNEQAVEVQ3WGRpoin1CRpPgutVmGIDugYyXUNnWjgdyolArn6X8Fn/YtcRm00QAFUWPBQQhAJBZqow+MAmCOZM70aHaBo3lGxy4yTzM5MAcVLlZWj00IrM/DfRDWx/7Gn699qVBFKTxuhCvyatMwlRWDjalJUURRhMJkpn/nTzGVqDPmX6bL7rXtkEL6DVJZTkFUgyBaINBaSGfXPDs6bcfe5xUSJ+OiQwpa9xB4jCUUON+F3EBkzZv5JeQPsZlKsyGCm8yU9/CjcpnEQSTtAobLCJe9/duKToKJwJz+7Ly9D+TeYAawNDyl1Ri5I42tEzyWxQbiqZjpHLLjTUlNtoik1IRI9frH6uBOA8NmjBjo0UAHXDU/Qgw9ANFUdBBS57DyN2puFik43mBKUkQ5BMbuzqbxM+qZ677N7YZA4QlDkfvgbRnFPAI4ScySJhPj93TD3KAlWmXAFhQB4TaoS7iCrmP3VFtH8TxgLCzjRJdWTdsCVnejdnKjfHjTPZYm6WMRCeAq5j9mBE/9bfW8K3+5c2EKU31AQEZcaHsaGW6comeygYWqoTGNOMojAhEAbPJMqaCGGCyJlf0Jx3cfaK2f6rZAKC5phoQQFpYN06dgwG2w/LyzcRPE4alymPLyxtTZc5vP7ZlO2fpdfpK8rIrhICBCig4Gx4HQqY2Ds0TJ4zkqgTBlOyB2fdgCirgZg8gLXMX+DMFWX+l7FCyJUoKhj0S7qJbR2Wn+z65kOZuUS02TeSGZLlDuWapoeHeQPNz5Oe3ZdeHAX9ggDwA0MqQjjixQU4kTyTPw6m2RARNZCbz2+K/nHmAKx/r8jfaWzSQp2bwQHWPvrHVFtRgDMhhMPMOWsERF1HIGq8gTsVLpyzqP6Y9gM/uHoCcOVNQFDO08Mqt2asY1zApOUyQtxAhDB9fgSOP9so+gpeYZxBDfqMb0jLi6uPAAEXOEV1hx/lMrN/zqiczs5yp4x3I1g6QmgSoPWDYUlf8zdN+zebA6yiQHO4eOe6hYxMASABfioWNNE8k1cQxgW4qeKceESrYAh/osdJbPIi3VdDANQDnvRzB13WJErT6JkpNBsmCBxvgssduBM8O8c+1KSac/T3+Q1t9RhwgKBM+V5BEwU4cfmwoAuX9QtN9I8z+YPLG6KalyDsK3B8Q1tcxAcBgsc+RnXvuqgAZ4g1TLslI0LXzdJ2HNdRhxLhQ9/qr7SvEJNXoyM2mwSuLWc92AN2I1jahDP3nzs2IGDOO9BpKDcp1eTCmlPclf1/f8Ntf8xMQHCV9+nx92LtCqSC0XicdX8B/vxEEUHITEgUbTWzlD/gs/HaHzMTsIoC0kOBPQBvadNQ39u0yHI7u+fCu8kTMZmGcC0Ua7Tf3fCWjoQAm2MCgrjAUbq5fSuLTJhCrlEJYJSEExmhMzmCo883SNFnZ+i7iU1RtZgigCpqkGjKJ4Q2u5O7m1OvzznQzdwxjQlwhqDb/X7gCHdV737kAGuv9gtqjv3e/XTjDuqibWETRUyzfcD0NsK4iZ53KL//tF+varnaJmAVBZpweK3HBXSLO5g2iZARRS/KXgGcxS50i1e1/updxGBrvjggQMAF3qH6K8CaMQIGhLFIWjf5foB5+5uoGcCrtv+jOGh/nBCgiQLN1LHrvEUPubN3OUvB6IZluyV7uhXDw+MN6ls14vc2YrIxZ1wQILjqW1RvaEGBKKHVKNPOucydm2nMy0BSUb9xX9gRXwG4euUTDxoFCUGw+KFphA4Muxwl0idgXt07qv1vneXzVly0P44CoBrmIP37mZV8AVNHmFYk46RwSwOfMPnUutU/Vs+RofcqF+Kjq9KyojcEAD5Eqka6CVizBGrYuvymCB2gX5+Hu0gFwF8MW3Tw+5sp8W/GSfvjKgCqgQ5QvdGHTGlMvAwjYzAIA2esoJtlZtcLRIbeH6fX8bg1dpy8gLUlgMqbV1DAtGuoThu7XQ5W5zGA3UbBfh5vApsU9etxBAjiAj+jBr/JT5aQxs2VTAM3HM/BtE0NZ+3A9d9lqH5I9UQcGzquAqDKSY8PSNzixQU4mzBwt4OVhsCOCSU4Q9FrP5UkzFfb9sd4LECHAj+lJrwZ7ZtScFcFBUNrOUvRcPnF+vmEyvZ/EFftjzMHCMoJasATdB93oLlDSWe4N439m9xFDopw1gBudS2FP+b3Wixsv+g9BAhQ4DW6jzu8fAHZNqPItMwMJ1/PBPNRpnfJNtsvcSQ22h+DuYHdo4AiURJ3elvUcGP+nL0Iw9YCCDMBMASNVn8bvHs1bn5/r5mAoJlfoXonmptXS7ZvHxb7N+11GObySWYAqblI5rtxtv29YgKConLmVQLpXd5iyZ2jbZ1dQxOz5y4HG4Yg64Ul2ML1lVi1YA+FgsO64WX697NAyAZVOnvM3UCas7mzKUeguVz+z33fP14t2KMmICiqQd+jB/k8Om2VwknZhqbzOChiSjRp8n413e1HsbP9PeoFtHsEL1FtokAQF9AljnAgX0cETWsaryeIOfpMDfd+0CPI2jMmICjv+fXXqKGrkUfrTL/Rb9PWWYhamb9aEfUlxDDm3w8mIHiMH1K9a4ULdDMxU7eLKDoEmWAIAokV7T9Er0d7SaN6DQFUOYJmPv3dQJtHoGPupkxiDoEMJ4/qkwbVH8Td7+8HAVAN/N9UP9fiEXB3JI+6vxDPVGTp7wOeeRIxbbU+IIHtXEAFWu4LRQGey8abN6jP+BX+hpkvxtL2d4UA8eUAaz2CF6kz7kHYSGGnLeC4q4OYJn6sZ/4/84US/SEA8UeAAAV+Tvf4BcDbnSS80wHOZsz8HUhbc/2UMH6v12x/ryNA0KXP07/3AX7WEBf2w9CAsyxcq7AU6P0b9P4oerQk0dvliOd6AV9c2UwxyqaPYTt8hgV8Wo+x/HWPv9vF4rcxjwP0hgkI7vS7VO/3Vtto36ZOQD+PIMqYwPrvClRfp3q4lzWol01AUJQ3cIA65kt0v2Wtu2baqEmwj1Hz+9SKJv/Vq7Y/KBZ6v0i/I9SE0qT/TJa/7KqC6dW/gyrXfL72fVhtP5f0tP+AL3zoPwToHRMQFDW1/CDVh+iel9p4erStXc2TQpvaL/FcL/r9/YgAgcj+J5rb16datB1t2ou2z9p/hw7I0fp5oP3v9EPDJdE/RXWImn3zsLdrqW5nzzB+YEohbwqMMjX/0TE1Lc5F9L8AKDh+luoX0MwXcEOnfetWAdHvUaRy/VSi59s9R/1kf5uAoKhUrP/1XTQ9qRMdIL+9tpK/pG9ivt0Ptr9fBUB1zHd8F011WMKfW5jwd+JqvgbvgyraXrHmt6ufFwEv5v9uPzVYP8QB2ssvqL5BnffbnkdgWgVMlza+yguUojTo9du97vf3qxvYjgLfoo572H8+VztJpH30sBMpBAbo/Q/p/Tvos9JvJiAoiqS97nWcbIN00cEUiBCz0Px9ymf+3+w37e9nAVAd9bRH2oQfHVxL/ESIzy87RgCV7f8J1UP92FCWkQP0blUd9mMfvsM7WnTwDFa/T3qrlUlPmPqy9BcHoC5z0yvPoLKEnraW8VvEAhSMO5K+lwnfyWvnBM1jhHC8umL7ZRrfp+MOrlxC+RdODxLkmGwbt3GYnwKy4yew6zt/R+8zEE4D9tjeA2f/5K9/LLO535MCi8nFpcTgxMnMwCfvZXKz51LpymJS9bRdKDUqw7vsxWtvry/uv6m+XMw5ooEEnbNaOvTTp8f+59+km0pD2HVM/fHfoHbdjfR+CwHiJQCk3cnyPEqHX4ebLdAHhN0zF5C74a6nal985MHdb/xgdMc7LxcyU+Mp1GtwXLf5gPR/lgR9UAjsymRR33W9PX33I0vn7vldZ1mK50rf/NsDuTMnkCgUIaplXHz0ce9aAv0sAL1K+yzC9lyBzEAOlfIiGiQIe5/7+tDAkVeL2Y/fG2o4DuxkEoI62hL+ylOu5b8nb9F1kD79QWrvJx8Mj7z3hixnB480fnlcLiYzKCTSSOWEd42tQFBcbZxo7r5aq1bQsBsobdv+RyOl0j/ZHx0dtBNJWOkMLOrkeq2KRoVQYLlOguNC0HfJbA7pXA7JXBEuoUP22FuilEw/sXzdTYsXJieeqZSXMJBOelmgPcmPZL8jgOp/YaFep84ldC8ODj06MrbrG8vL1ZxIZ5EgLa8sLqA6OwO7VkOjOAAMjQApIvrlMhJzM0hNN5AuDaIwPOoJQr1hb0ul0t/Yvntf5fyZ0y9UKxW4Un4KEKAHOYA3N8u2sVyvIz0wdMPo2K4n6e+cJcgtkA7mps/DXpyDs/d6DD/y+7j+vnuxa89OJFIpXFooY/zDU5h8+RXUDvwI9tRpFLftRn6gSOd0cul09snRsZ1HZybGT7lELoXodwHoUQoQyMLwtu1P0OseQT0lhMSl8+fQqFeQ/I0/wP1/+lV86Y792JNykJJNf84lNJjdvhtv3/LreOkzD2Pxe/+I8sxxOnYP8oUSGo3Gnnxp+IlqvvgYAYCMuk3RFgfYND9XIpcv3J3NF7/sNMiPI8I3T56Aa1dh3fwo7n3kK7g/n4F7cgIfW0T6vO0biAC6AglXrUubQPKWW/Hi5F+h9uY/oDx7HGkijMlkSnkVXy4Nj95Nbw72EQD0kQlQhJ7IW2Fg8DHqoHSCiJ1NfMCuzkMO3YHSzgcxvDCHY0ds6viGR+ZdaTfjRRYRRJmg4y2krAz2ZTN4f+R3kK9PobwwixFCB7fhpLO5/GOZbO5g1d1yA+NnAkgASFML2XxBpYTBSpA3UFmClcrBTt8IZ2YS48cW1Rf0WwmnUUMiQSiRSBDZUyHAFJKJHEmFoE6n31VnkcjthVs+RTxg2UOBhJt8mARLJZuUt9zAGJZUOr2bOmqfS7BO6gy7sUwCMABRn8bSuRomyiVYyTR5CnWUBku4/bZbURoawNmJCXz44Qk41PmZdIq8hWkkymcJGSqQ1PF2vYYMmQLY2Eeyo/Y6PrlFAuNoBixrxLKsksJ3Im7eZwTsSNQ/hrRzaDgFKG6gEKJaLeLwpXFCA9vbwV6Sa7hcrQNZ6mi3glRjnsDAhjIlTsPxXEwilSU6eGTLDYypG0CcP2sp404wD9WxqtPgwHLn6bWCtKijtlxFmlw/e2EaVVsZc9fjAvl81vMKrAZBPSHIsmxuU2B5aQEu1HmFOrcQ2a1IYHwjgTUhElDVIttuiSBs6zQ7kzpaTSBMUEcLS7mIbjMcTB2boq523DqSdIwaJrCaAuX5/IonNBFAvaLWk+lyn4K0cHLn5CXqoAXLEiVF2qykRR1pISlTHstPLidRTJZgV+oYLY5gNDOkAAA2kcFztWks2BYyuRxqdgWWI4g/AA3yGJKpjEcqSWgWqCUv9T0CVJXCNHos95ludmm5MSldd4Js9W0pxdqJ8IEY/jBKSNgJZOw0BlJDBPkuUnNJjCQHkJdZzJF5qJOdH8oNk9u4jJqj+IINO1PHJTEHcv08NEhYiYmaFJMKUFynx3qa7teRTAH45+uB2f3oqZCnGqI9sbBc/lat9urQwNBtaoQvXxjA3MIl7KaOLlUG4CTIlpNg59JEBi0X5xszZPdTyMoctidHSQjqXi3KvBcnOJ08TUKUQC5XaCqGi1efutYt77+5GXfoNTf5s0WmANyZ7004GxkAnlxcfHZ0x54/d10nPVAcRLmyiJnsJeyv7Eaj3oCg32RLGRIYZfvzyLgp5EjjBbmANSeNhRlyBZ0sLg5OYzYxj+GBMS+iSMhCTkL92c+la7h9oN9JYI+WOpG0anXpkL1cfz6VzvyhInojw9txYWYSx4fGce/0rcjXMsiPkYRnpRcQShLLz8gMCUAC5ekqhshMTAxM48PCCfIICyiVhokckndgJZ5fXJw9VLadfmqy/hIAhXOu48i52Qtf27HrmgcIBfbk80WMuTtxYf483hg7jAdnb8NNp4cxWChAZCwP6gXxA7vs4Ey9hveHJvB28RhSuQy2j+7xvARCgLO1avlr5YU5aX0qEkJ6tGRzeTUWgMWFuVOFQunx0tDoM6S9uSJ9pryC6fkLeCF5CIer4/jV6m7srQ0TEKQwZ1VwKjWDw0NnMJ1ewlB+mJBjW+A/VaV0H5+5MHlKkaKEGhjaEoCYOgKOiyHquCUifhfPT76QTme+mi+Wnmo4jVIun8fe7DVYKi9gIruAkwNHiRa7zRXela9Pdr5I5HB/8VpkMjk4jor+YYG++oupqbMvVCoVjI7tQiqV3hKA2AqAVPF/G2M79uD81AQmz37yzK7d+88US8Nfd1z38yoYUiqNoDQwrEwFGm7D4wEqYJQkAVDBIzWiSKZDBX/ecZ3GX56bmnh9fu4StlHnuyQpamBoSwBiSwEklhaXlL+OodEduHjuLMZPHnt9ZNv2h4ZHxr6SSKb/zJX120Qzs8/3c9WEAUkewrI/lUC8Tz7ev1fLi/9KKLJQq1axbftu+lkCs5em+25uWF8JQKk0gAceuM+L9aeoptP3YubiOdj28kImm/n7oeHRfyFmf48rcR/ZdbU59U7/0HNCiBOWEP/nOI2DiwuzS0uL87hm306C/Z0ef6hWyli2be8a/VSElH0333GrRCjWVhN8usv/CzAAoRgqYLYT1kEAAAAASUVORK5CYII=",mo.set({id:"thing-camera",type:"image",data:Uf}),mo.set({id:"thing-point",type:"image",data:If(100,"#ffffff",!0)}),mo.set({id:"thing-double-point",type:"image",data:function(t,e,i,r){let n=document.createElement("canvas");n.width=e,n.height=e;let s=n.getContext("2d");const o=If(t,i||"#ffffff",!0),a=If(e,r||"rgba(255,255,255,.5)",!0),l=(e-t)/2;return s.drawImage(a,0,0),s.drawImage(o,l,l),n}(50,100)}),mo.set({id:"thing-point-outline",type:"image",data:If(100,"#ffffff",!1,!0,10)}),mo.set({id:"thing-star",type:"image",data:function(t,e){t=t||100;let i=document.createElement("canvas");i.width=t,i.height=t;let r=i.getContext("2d");r.lineWidth=5,r.beginPath();var n=4*Math.PI/5,s=50*Math.sin(0)+50,o=50*Math.cos(0)+50;r.moveTo(o,s);for(var a=0;a<5;a++){var l=n*a;s=50*Math.sin(l)+50,o=50*Math.cos(l)+50,r.lineTo(o,s)}return r.closePath(),r.fillStyle=e||"#FFFFFF",r.fill(),i}(100,"#ffffff")}),mo.set({id:"thing-rect",type:"image",data:function(t,e){t=t||24;let i=document.createElement("canvas");i.width=t,i.height=t;let r=i.getContext("2d");return r.shadowBlur=2,r.shadowColor="rgba(0,0,0,0.8)",r.fillStyle=e||"#ff0000",r.beginPath(),r.fillRect(0,0,t,t),r.closePath(),r.fill(),i}(100,"#ffffff")}),mo.set({id:"thing-triangle",type:"image",data:function(t,e){t=t||100;let i=document.createElement("canvas");i.width=t,i.height=t;let r=i.getContext("2d");r.beginPath();var n=t*Math.sin(Math.PI/3);return r.moveTo(t/2,0),r.lineTo(0,n),r.lineTo(t,n),r.fillStyle=e||"#ffffff",r.fill(),i}(100,"#ffffff")});let Bf="\n\t\tattribute vec3\tcustomColor;\n\t\tattribute float customOpacity;\n\t\tattribute float customSize;\n\t\tattribute float customAngle;\n\t\tattribute float customVisible;\n\t\tvarying vec4\tvColor;\n\t\tvarying float vAngle;\n\t\tvoid main(){\n\t\t\t\tif(customVisible>0.5) {\n\t\t\t\t\t\tvColor = vec4( customColor, customOpacity ); \n\t\t\t\t}else{\n\t\t\t\t\t\tvColor = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t\t\t}\n\t\t\t\tvAngle = customAngle;\n\t\t\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\tgl_PointSize = customSize * ( 300.0 / length( mvPosition.xyz ));\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\t\t}\n",kf="\n\t\tuniform sampler2D image;\n\t\tvarying vec4 vColor;\n\t\tvarying float vAngle;\n\n\t\tvoid main(){\n\t\t\t\tgl_FragColor = vColor;\n\t\t\t\tfloat c = cos(vAngle);\n\t\t\t\tfloat s = sin(vAngle);\n\t\t\t\tvec2 rotatedUV = vec2(c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5, c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5);\n\t\t\t\tvec4 rotatedTexture = texture2D( image,\trotatedUV );\n\t\t\t\tgl_FragColor = gl_FragColor * rotatedTexture;\n\t\t}\n";function jf(t,e){this.times=t||[],this.values=e||[]}function Vf(){this.position=new THREE.Vector3,this.velocity=new THREE.Vector3,this.acceleration=new THREE.Vector3,this.angle=0,this.angleVelocity=0,this.angleAcceleration=0,this.size=16,this.color=new THREE.Color,this.opacity=1,this.age=0,this.alive=0}jf.prototype.lerp=function(t){for(var e=0,i=this.times.length;e<i&&t>this.times[e];)e++;if(0==e)return this.values[0];if(e==i)return this.values[i-1];var r=(t-this.times[e-1])/(this.times[e]-this.times[e-1]);return this.values[0]instanceof THREE.Vector3?this.values[e-1].clone().lerp(this.values[e],r):this.values[e-1]+r*(this.values[e]-this.values[e-1])},Vf.prototype.update=function(t){if(this.position.add(this.velocity.clone().multiplyScalar(t)),this.velocity.add(this.acceleration.clone().multiplyScalar(t)),this.angle+=.01745329251*this.angleVelocity*t,this.angleVelocity+=.01745329251*this.angleAcceleration*t,this.age+=t,this.sizeTween.times.length>0&&(this.size=this.sizeTween.lerp(this.age)),this.colorTween.times.length>0){var e=this.colorTween.lerp(this.age);this.color=(new THREE.Color).setRGB(e.x,e.y,e.z)}this.opacityTween.times.length>0&&(this.opacity=this.opacityTween.lerp(this.age))};let zf=Object.freeze({CUBE:1,SPHERE:2});function Gf(t){this.parent=t,this.positionStyle=zf.CUBE,this.positionBase=new THREE.Vector3,this.positionSpread=new THREE.Vector3,this.positionRadius=0,this.velocityStyle=zf.CUBE,this.velocityBase=new THREE.Vector3,this.velocitySpread=new THREE.Vector3,this.speedBase=0,this.speedSpread=0,this.accelerationBase=new THREE.Vector3,this.accelerationSpread=new THREE.Vector3,this.angleBase=0,this.angleSpread=0,this.angleVelocityBase=0,this.angleVelocitySpread=0,this.angleAccelerationBase=0,this.angleAccelerationSpread=0,this.sizeBase=0,this.sizeSpread=0,this.sizeTween=new jf,this.colorBase=new THREE.Vector3(0,1,.5),this.colorSpread=new THREE.Vector3(0,0,0),this.colorTween=new jf,this.opacityBase=1,this.opacitySpread=0,this.opacityTween=new jf,this.blendStyle=THREE.NormalBlending,this.particleArray=[],this.particlesPerSecond=100,this.particleDeathAge=1,this.emitterAge=0,this.emitterAlive=!0,this.emitterDeathAge=60,this.particleCount=this.particlesPerSecond*Math.min(this.particleDeathAge,this.emitterDeathAge),this.particleGeometry=new THREE.BufferGeometry,this.particleTexture=null,this.particleMaterial=new THREE.ShaderMaterial({uniforms:{image:{type:"t",value:this.particleTexture}},vertexShader:Bf,fragmentShader:kf,blending:THREE.NormalBlending,side:THREE.DoubleSide,transparent:!0,opacity:1}),this.particleMesh=new THREE.Mesh}Gf.prototype.setValues=function(t){if(void 0!==t){for(var e in this.sizeTween=new jf,this.colorTween=new jf,this.opacityTween=new jf,t)this[e]=t[e];Vf.prototype.sizeTween=this.sizeTween,Vf.prototype.colorTween=this.colorTween,Vf.prototype.opacityTween=this.opacityTween,this.particleArray=[],this.emitterAge=0,this.emitterAlive=!0,this.particleCount=this.particlesPerSecond*Math.min(this.particleDeathAge,this.emitterDeathAge),this.particleGeometry=new ye,this.particleMaterial=new THREE.ShaderMaterial({uniforms:{image:{type:"t",value:this.particleTexture}},vertexShader:Bf,fragmentShader:kf,blending:THREE.NormalBlending,depthWrite:!0,depthTest:!1,side:THREE.DoubleSide,transparent:!0,opacity:1}),this.particleMesh=new THREE.Points}},Gf.prototype.randomValue=function(t,e){return t+e*(Math.random()-.5)},Gf.prototype.randomVector3=function(t,e){var i=new THREE.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return(new THREE.Vector3).addVectors(t,(new THREE.Vector3).multiplyVectors(e,i))},Gf.prototype.createParticle=function(){var t=new Vf;if(this.positionStyle==zf.CUBE&&(t.position=this.randomVector3(this.positionBase,this.positionSpread)),this.positionStyle==zf.SPHERE){var e=2*Math.random()-1,i=6.2832*Math.random(),r=Math.sqrt(1-e*e),n=new THREE.Vector3(r*Math.cos(i),r*Math.sin(i),e);t.position=(new THREE.Vector3).addVectors(this.positionBase,n.multiplyScalar(this.positionRadius))}if(this.velocityStyle==zf.CUBE&&(t.velocity=this.randomVector3(this.velocityBase,this.velocitySpread)),this.velocityStyle==zf.SPHERE){var s=(new THREE.Vector3).subVectors(t.position,this.positionBase),o=this.randomValue(this.speedBase,this.speedSpread);t.velocity=s.normalize().multiplyScalar(o)}t.acceleration=this.randomVector3(this.accelerationBase,this.accelerationSpread),t.angle=this.randomValue(this.angleBase,this.angleSpread),t.angleVelocity=this.randomValue(this.angleVelocityBase,this.angleVelocitySpread),t.angleAcceleration=this.randomValue(this.angleAccelerationBase,this.angleAccelerationSpread),t.size=this.randomValue(this.sizeBase,this.sizeSpread);var a=this.randomVector3(this.colorBase,this.colorSpread);return t.color=(new THREE.Color).setHSL(a.x,a.y,a.z),t.opacity=this.randomValue(this.opacityBase,this.opacitySpread),t.age=0,t.alive=0,t},Gf.prototype.initialize=function(){let t=[],e=[],i=[],r=[],n=[];for(var s=0;s<this.particleCount;s++)this.particleArray[s]=this.createParticle(),this.particleGeometry.vertices[s]=this.particleArray[s].position,t.push(this.particleArray[s].alive),e.push(this.particleArray[s].color),i.push(this.particleArray[s].opacity),r.push(this.particleArray[s].size),n.push(this.particleArray[s].angle);for(s=0;s<this.particleCount-2;s+=3){let t=new THREE.Face3(s,s+1,s+2);this.particleGeometry.faces.push(t)}this.bufferGeometry=new THREE.BufferGeometry,di(this.particleGeometry,this.bufferGeometry),this.bufferGeometry.setAttribute("customVisible",new THREE.BufferAttribute(new Float32Array(t),1)),this.bufferGeometry.setAttribute("customColor",new THREE.BufferAttribute(new Float32Array(3*e.length),3).copyColorsArray(e)),this.bufferGeometry.setAttribute("customOpacity",new THREE.BufferAttribute(new Float32Array(i),1)),this.bufferGeometry.setAttribute("customSize",new THREE.BufferAttribute(new Float32Array(r),1)),this.bufferGeometry.setAttribute("customAngle",new THREE.BufferAttribute(new Float32Array(n),1)),this.particleMaterial.blending=this.blendStyle,this.blendStyle!=THREE.NormalBlending&&(this.particleMaterial.depthTest=!1),this.particleMesh=new THREE.Points(this.bufferGeometry,this.particleMaterial),this.particleMesh.dynamic=!0,this.particleMesh.sortParticles=!0,this.parent.add(this.particleMesh),this.isShow=!0},Gf.prototype.update=function(t){var e=[];let i=[],r=[],n=[],s=[],o=[];for(var a=0;a<this.particleCount;a++)this.particleArray[a].alive&&(this.particleArray[a].update(t),this.particleGeometry.vertices[a]=this.particleArray[a].position,this.particleArray[a].age>this.particleDeathAge&&(this.particleArray[a].alive=0,e.push(a)),i.push(this.particleArray[a].alive),r.push(this.particleArray[a].color),n.push(this.particleArray[a].opacity),s.push(this.particleArray[a].size),o.push(this.particleArray[a].angle));if(di(this.particleGeometry,this.bufferGeometry),this.bufferGeometry.getAttribute("customVisible").copyArray(i),this.bufferGeometry.getAttribute("customColor").copyColorsArray(r),this.bufferGeometry.getAttribute("customOpacity").copyArray(n),this.bufferGeometry.getAttribute("customSize").copyArray(s),this.bufferGeometry.getAttribute("customAngle").copyArray(o),this.bufferGeometry.getAttribute("customVisible").needsUpdate=!0,this.bufferGeometry.getAttribute("customColor").needsUpdate=!0,this.bufferGeometry.getAttribute("customOpacity").needsUpdate=!0,this.bufferGeometry.getAttribute("customSize").needsUpdate=!0,this.bufferGeometry.getAttribute("customAngle").needsUpdate=!0,this.emitterAlive){if(this.emitterAge<this.particleDeathAge){var l=Math.round(this.particlesPerSecond*(this.emitterAge+0)),h=Math.round(this.particlesPerSecond*(this.emitterAge+t));h>this.particleCount&&(h=this.particleCount);for(a=l;a<h;a++)this.particleArray[a].alive=1}for(var c=0;c<e.length;c++){a=e[c];this.particleArray[a]=this.createParticle(),this.particleArray[a].alive=1,this.particleGeometry.vertices[a]=this.particleArray[a].position}this.emitterAge+=t,this.emitterAge>this.emitterDeathAge&&(this.emitterAlive=!1)}},Gf.prototype.destroy=function(){this.parent.remove(this.particleMesh),this.isShow=!1},Gf.prototype.show=function(){this.parent.add(this.particleMesh),this.isShow=!0},Gf.prototype.hide=function(){this.parent.remove(this.particleMesh),this.isShow=!1};const Hf=zf;const Xf=new be.Vector3,Wf=new be.Vector3,Yf=new be.Matrix3;class Qf extends be.LineSegments{constructor(t,e=1,i=16711680){const r=new be.BufferGeometry,n=t.geometry.attributes.normal.count,s=new be.Float32BufferAttribute(2*n*3,3);r.setAttribute("position",s),super(r,new be.LineBasicMaterial({color:i,toneMapped:!1})),this.isHelper=!0,this.object=t,this.size=e,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Yf.getNormalMatrix(this.object.matrixWorld);const t=this.object.matrixWorld,e=this.geometry.attributes.position,i=this.object.geometry;if(i&&i.isGeometry)console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use THREE.BufferGeometry instead.");else{if(i&&i.isBufferGeometry){const r=i.attributes.position,n=i.attributes.normal;let s=0;for(let i=0,o=r.count;i<o;i++)Xf.fromBufferAttribute(r,i).applyMatrix4(t),Wf.fromBufferAttribute(n,i),Wf.applyMatrix3(Yf).normalize().multiplyScalar(this.size).add(Xf),e.setXYZ(s,Xf.x,Xf.y,Xf.z),s+=1,e.setXYZ(s,Wf.x,Wf.y,Wf.z),s+=1}e.needsUpdate=!0}}}const Jf={Common:Rt,Env:zm,...Gm};let Zf=document.scripts;const qf=Zf[Zf.length-1].src.substring(0,Zf[Zf.length-1].src.lastIndexOf("/")+1),Kf=window.THREE;if(!Kf)throw new Error("Please load Three.js");try{mo.setDracoLoader({path:qf+"/libs/draco/"})}catch(t){}const $f={VertexNormalsHelper:Qf};t.AmbientLight=Hm,t.AttributionControl=$o,t.BaseEvent=ui,t.Billboard=Co,t.Box=Oo,t.CSM=mf,t.CSMHelper=Ef,t.CSS3DObject=Xe,t.CSS3DRenderer=Je,t.CSS3DSprite=We,t.CannedLiquid=class extends Yo{constructor(t){super(pt({name:"CannedLiquid",geometry:{radius:.5,height:1,segments:30,phiStart:0,phiLength:2*Math.PI,ratio:1,clip:!0,header:!0,body:!0,footer:!0},material:{side:2,transparent:!0,opacity:.95,color:"#29C4F5"}},t)),this.type="CannedLiquid",this.isCannedLiquid=!0,this.updateGeometry()}updateGeometry(t){pt(this.option.geometry,t),this.mesh&&this.mesh.removeFromParent();const{radius:e,height:i,ratio:r,clip:n,header:s}=this.option.geometry,o=this.createGeometry(this.option.geometry);this.remove(this.mesh),this.mesh=new be.Mesh(o,new be.MeshStandardMaterial),this.mesh.position.z=0,this.mesh.position.y=0,this.mesh.geometry.computeBoundingBox();const a=this.mesh.getBox3();this.mesh.position.y-=a.min.y,n?this.mesh.position.z-=a.max.z:this.mesh.position.z+=(a.max.z+a.min.z)/2,this.add(this.mesh),this.updateBy({material:this.option.material,geometry:null})}createGeometry(t){const e=super.createGeometry(t),i=this.option.geometry,{radius:r,height:n,ratio:s,clip:o,header:a,body:l}=i,h=this.a=new be.Mesh(e);h.updateMatrix();let c=2*r+n;const d=this.b=new be.Mesh(new be.BoxGeometry(c,c,c));a||(c=r+n),l||(c=r),d.position.y=c*s-c,a||(d.position.y-=r),l||(d.position.y-=n),d.updateMatrix(),d.material.color=new be.Color("#ff0000");let u=lu.fromMesh(h),p=lu.fromMesh(d),m=p.subtract(u),f=lu.toMesh(m,d.matrix,d.material);if(o&&0!==s){let t=2*r+n;const e=this.b=new be.Mesh(new be.BoxGeometry(t,t,t));e.position.y=t*s-t,e.position.z=.5*t,e.updateMatrix(),u=lu.fromMesh(f),p=lu.fromMesh(e),m=u.subtract(p),f=lu.toMesh(m,e.matrix,e.material)}return f.geometry}},t.CanvasPlane=iu,t.Capsule=Yo,t.Circle=No,t.CompassControl=class{constructor(t){this._viewer=void 0,this._container=void 0;const e={startDegree:0};pt(e,t),this._container=null,this._viewer=null,this._container=U("div","THING-ctrl"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._content=U("div","THING-ctrl-compass",this._container),this._start=e.startDegree}setStartDegree(t){this._start=t,this._update()}onAdd(t){return this._viewer=t,t.on("rotate",this._update.bind(this)),setTimeout((()=>{this._update()}),100),this._container}onRemove(){j(this._container)}_update(t){const e=this._viewer;if(!e)return;const i=e.camera,r=e.cameraControl.control.getTarget(),n=i.position.x-r.x,s=i.position.z-r.z,o=180*Math.atan2(n,s)/Math.PI+this._start;this._degree=o,this._content.style.transform=`rotateZ(${o}deg)`}correct(){const t=viewer.camera,e=viewer.cameraControl.control.getTarget(),i=t.position.x-e.x,r=t.position.z-e.z;return this._start=-1*Math.atan2(i,r)*180/Math.PI,this._update(),this._start}getDefaultPosition(){return"bottom-left"}},t.Cone=Do,t.ControlHelper=class extends Co{constructor(t,e){super(pt({material:{depthTest:!1,depthWrite:!1,map:{icon:"thing-point",iconWidth:16,iconHeight:16}}},e)),this.name="ControlHelper",this._object=t}update(){}},t.Coords=Df,t.CurveLine=Bc,t.Cylinder=Io,t.DimensionHelper=class extends Mo{constructor(t,e){super(),this.isDimensionHelper=!0,this.option=pt({color:"#ff0000",depthTest:!1,depthWrite:!1,offset:.25,fontSize:18,space:.01,width:!0,height:!0,depth:!0},e),this._object=t,this.name="DimensionHelper",this._initDimensions()}_initDimensions(){const t=this._object,e=t.getBox3(),i=t.getSize(),r=t.getCenter();let n=this.option.offset;const{width:s,depth:o,height:a}=this.option;s&&this._createDimension({size:i.x,width:i.x,position:[r.x,e.min.y,e.max.z+n],rotation:[-Math.PI/2,0,0]}),o&&this._createDimension({size:i.z,width:i.z,position:[e.max.x+n,e.min.y,r.z],rotation:[-Math.PI/2,0,Math.PI/2]}),a&&(this._createDimension({size:i.y,width:i.y,position:[e.max.x+n,r.y,e.max.z+n],rotation:[-Math.PI/2,Math.PI/2,0]}),this._createDimension({size:i.y,width:i.y,position:[e.min.x-n,r.y,e.min.z-n],rotation:[0,0,Math.PI/2]}))}_createDimension({size:t,width:e,position:i,rotation:r}){const n=document.createElement("canvas");if(n.width=120*e>2048?1024:120*e,n.height=40,n.width<n.height)return;!function(t,e,i,r,n,s,o,a,l){o=void 0!==(s=void 0!==s?s:30)?o:10,a=void 0!==a?a:1,l="color"!=typeof l?l:"#000";var h=180*Math.atan2(i-n,e-r)/Math.PI,c=(h+s)*Math.PI/180,d=(h-s)*Math.PI/180,u=o*Math.cos(c),p=o*Math.sin(c),m=o*Math.cos(d),f=o*Math.sin(d);t.save(),t.beginPath();var g=e-u,v=i-p;t.moveTo(g,v),t.lineTo(e,i),g=e-m,v=i-f,t.lineTo(g,v),t.moveTo(e,i),t.lineTo(r,n),g=r+u,v=n+p,t.moveTo(g,v),t.lineTo(r,n),g=r+m,v=n+f,t.lineTo(g,v),t.strokeStyle=l,t.lineWidth=a,t.moveTo(0+a,0),t.lineTo(0+a,s),t.moveTo(r-a,0),t.lineTo(r-a,s),t.stroke(),t.restore()}(n.getContext("2d"),0,30,n.width,30,40,10,1,this.option.color),function(t,e,i,r,n){const s=t.getContext("2d"),{width:o,height:a}=t;s.save(),s.clearRect((o-e)/2,0,e,a),s.fillStyle=r,s.font=(n||16)+"px Microsoft Yahei, SimHei",s.textAlign="center",s.textBaseline="bottom",s.fillText(i,o/2,a-10),s.restore()}(n,this.option.space,ct(t,2),this.option.color,this.option.fontSize);let s=new iu(n,{rotation:r||[-Math.PI/2,0,0],position:i,geometry:{width:e,height:n.height*e/n.width},material:{side:2,depthTest:this.option.depthTest,depthWrite:this.option.depthWrite}});s.userData.isDimensionHelper=!0,s.userData.skipStyle=!0,s.userData.hideInTree=!0,this.add(s)}updateOption(t){pt(this.option,t),this.clear(),this._initDimensions()}remove(){super.remove(),this._object=null}},t.DirectionalLight=Xm,t.Display=class extends Mo{constructor(t){super(pt({geometry:{width:0,height:0,inches:45,aspect:"16:9",depth:.01,border:.01},material:{color:"#000000",metalness:.5,roughness:.3},video:{src:""}},t)),this.type="Display",this.isDisplay=!0;let{depth:e}=this.option.geometry,i=new Oo({material:this.option.material});this.box=i;const r=new au({position:[0,0,e/2+.001],video:this.option.video});this.videoPlane=r,i.add(r),this.updateGeometry(this.option.geometry),this.add(i)}updateGeometry(t){pt(this.option.geometry,t);let{border:e,width:i,height:r,depth:n,aspect:s,inches:o}=this.option.geometry;if(o&&s){let t=s.split(":").map((t=>parseInt(t))),e=o/Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))*2.54/100;i=ct(t[0]*e,3),r=ct(t[1]*e,3)}this.box&&this.box.updateGeometry({width:i,depth:n,height:r}),this.videoPlane&&this.videoPlane.updateGeometry({width:i-2*e,height:r-2*e})}play(){this.videoPlane.video.play()}pause(){this.videoPlane.video.pause()}updateVideo(t){this.videoPlane&&this.videoPlane.updateVideo(t)}get video(){return this.videoPlane.video}},t.Dodecahedron=Uo,t.Doughnut=Qo,t.DrawControl=mm,t.ExtrudeLine=class extends Ro{constructor(t){super(pt({points:[],geometry:{height:.5,width:0,closed:!1,curveType:"catmullrom",tension:0},material:{side:1}},t)),this.isExtrudeLine=!0,this.type="ExtrudeLine",this.needPoints=!0,this.updatePoints(this.option.points)}get length(){if(this._points.length<2)return 0;let t=0,e=ti(this._points[0]);return this._points.slice(1).forEach((i=>{t+=e.distanceTo(ti(i)),e=i})),t}createGeometry(){if(!this._points||this._points.length<2)return new be.BufferGeometry;const t=this.option.geometry,e=[],{width:i,height:r,closed:n,curveType:s,tension:o}=t;e.push(new be.Vector2(0,i)),e.push(new be.Vector2(-r,i)),e.push(new be.Vector2(-r,0)),e.push(new be.Vector2(0,0));const a=new be.Shape(e),l={steps:100*this._points.length,bevelEnabled:!1,extrudePath:new be.CatmullRomCurve3(this._points,n,s,o)};return new be.ExtrudeGeometry(a,l)}updatePoints(t){if(!t||0===t.length)return;this._points=[];let e="none";for(let i=0;i<t.length;i++){let r=t[i]?ti(t[i]):null;r&&("none"==e?e=r.y:r.y=e,this._points.push(r))}this.updateGeometry(this.option.geometry)}getPoints(){return this.points}get points(){return this._points.map((t=>t.toArray()))}set points(t){this.updatePoints(t)}},t.ExtrudePolygon=class extends Oc{constructor(t){super(pt({points:[],geometry:{bevelEnabled:!1,bevelThickness:.1,bevelSize:.2,bevelOffset:.1,bevelSegments:1,depth:1},material:{side:2}},t)),this.type="ExtrudePolygon",this.isExtrudePolygon=!0,this.vertices=[],this._points=[],this.setPoints(this.option.points)}updatePoints(t){this.setPoints(t)}setPoints(t){t=t||[],this._points=[];let e=[];for(let i=0;i<t.length;i++){let r=t[i];r.isVector2||2===r.length?(r=$e(r),r=new be.Vector3(r.x,0,r.y)):(r=ti(r),r=new be.Vector3(r.x,0,r.z)),e.push(r)}this.addPoints(e||[])}updateGeometry(t){pt(this.option.geometry,t),this._updateByPoints()}_createGeometry(){var t=this._createPolygonVertices();this.vertices=t.vertices;let e=[],i=[],r=0;for(let t=0,i=this._points.length;t<i;t++){const i=this._points[t];0==r&&0!=i.y&&(r=i.y),e.push(new be.Vector2(i.x,i.z))}this.vertices.forEach((t=>t.y=r));i=Eo(this._points.slice(0).map((t=>[t.x,t.z])),-.5);var n=new be.Path;n.moveTo(i[0][0],i[0][1]),i.slice(1).forEach((t=>{n.lineTo(t[0],t[1])}));var s=new be.Shape(e);const o={...this.option.geometry};o.depth=-1*o.depth;const a=new be.ExtrudeGeometry(s,o);return a.uvsNeedUpdate=!0,a}_updateByPoints(){if(this._points.length<3)return;const t=this._createGeometry();if(this.mesh)this.mesh.geometry=t;else{const e=this.mesh=new be.Mesh(t,new be.MeshStandardMaterial);this.mesh.rotation.x=Math.PI/2,e.updateBy({material:this.option.material}),this.add(e)}}clear(){this._points=[],this.vertices=[],this._updateByPoints()}},t.ExtrudePolygon2=class extends Ro{constructor(t){super(pt({points:[],rotation:[.5*-Math.PI,0,0],geometry:{depth:1},material:{side:2}},t)),this.type="ExtrudePolygon2",this.isExtrudePolygon2=!0,this.updatePoints(this.option.points)}updatePoints(t){this._points=t,this._points.length>0&&(this.mesh.geometry.dispose(),this.mesh.geometry=this.createGeometry(),this.updateMaterial(this.option.material))}createGeometry(t){if(!this._points)return new be.BufferGeometry;t=t||this.option.geometry;const{indices:e,position:i,uv:r,normal:n}=Yd([this._points],{depth:t.depth}),s=new be.BufferGeometry;return s.setAttribute("position",new be.Float32BufferAttribute(i,3)),s.setAttribute("normal",new be.Float32BufferAttribute(n,3)),s.setIndex(new be.Uint16BufferAttribute(e,1)),s.center(),s}},t.Group=Ya,t.Heatmap=class extends Mo{constructor(t,e){super(pt({style:{radius:15,width:1024,blur:.85,maxOpacity:1,minOpacity:0,gradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"}},material:{}},e||{})),this.type="Heatmap",this.isHeatmap=!0,this.setData(t)}updateStyle(t){if(pt(this.option.style,t),this.heatmap&&t){this.heatmap.configure(t),this.heatmap._store._cfgRadius=this.option.style.radius;const e=this.heatmap.getData();e.data.forEach((t=>delete t.radius)),this.heatmap.setData(e),this.heatmap.repaint(),this._plane.mesh.material.map.needsUpdate=!0}}setData({data:t,min:e,max:i}){const{width:r}=this.option.style,n=t.map((t=>[t.x,0,t.y]));let s=n.length>0?1:0;const o=new Gc({points:n}),a=o.getBox3();a.expandByScalar(s);const l=(a.max.x-a.min.x)/(a.max.z-a.min.z),h=a.getSize(new THREE.Vector3);let c=Math.round(r/(a.max.x-a.min.x)),d=Math.round(r/l/(a.max.z-a.min.z)),u=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,m=t.map((t=>{const e=t.value;return u=Math.min(u,e),p=Math.max(p,e),{x:Math.round((t.x-a.min.x)*c),y:Math.round((t.y-a.min.z)*d),value:e}}));this.heatMapData=m,this._plane&&(this._plane.removeFromParent(),this._plane=null),this.heatmap?(this.heatmap._renderer.setDimensions(r,Math.round(r/l)),this.heatmap.removeData(),this.heatmap.setDataMax(void 0!==i?i:p),this.heatmap.setDataMin(void 0!==e?e:u),this.heatmap.setData({data:m})):this.heatmap=function(t){const e=pt({data:[],min:0,max:100},t||{}),i=new eu(e);return i._renderer.canvas.dynamic=!0,e.data&&e.data.length>0&&i.setData({data:e.data,min:e.min,max:e.max}),i}({height:Math.round(r/l),data:m,min:void 0!==e?e:u,max:void 0!==i?i:p,...this.option.style});const f=this.heatmap;if(this._plane){const t=this._plane;t.updateBy({geometry:{width:h.x,height:h.z}}),t.position.clone(o.center),t.mesh.material.map.needsUpdate=!0}else{const t=this._plane=new iu(f._renderer.canvas,{position:o.center,rotation:[-90*THREE.MathUtils.DEG2RAD,0,0],geometry:{width:h.x,height:h.z},material:this.option.material});t.mesh.material.depthWrite=!1,t.mesh.material.depthTest=!1,t.mesh.renderOrder=1,this.add(t)}}},t.Helper=$f,t.HemisphereLight=Wm,t.HtmlPlane=class extends Vo{constructor(t,e){super(pt({name:"HtmlPlane",rotation:[0,0,0],border:10,geometry:{width:0,height:0},material:{color:"#000000",side:2}},e)),this.type="HtmlPlane",this.isHtmlPlane=!0,this.createHtml(t)}createHtml(t){if(!t)return;const e=new Xe(t),i=+t.style.width.split("px")[0],r=+t.style.height.split("px")[0],n=this.option.geometry,s=2*this.option.border;e.scale.set(n.width/(i+s),n.height/(r+s),1),this.cssObject=e,this.add(e)}get element(){return this.cssObject.element}set element(t){this.cssObject.element=t}},t.Icosahedron=Bo,t.ImagePlane=ou,t.LAYERS=pe,t.Lathe=ko,t.LightBox=class extends Mo{constructor(t){super(pt({geometry:{width:0,height:0,depth:.01,border:.04},light:{color:"#ffffff",intensity:1},material:{metalness:.5,roughness:.7,side:2,color:"#111111"},style:{images:[],current:0,duration:1e3}},t),!0),this.type="LightBox",this.isLightBox=!0,this.playing=!1,this._timer=null,this._current=0;let{width:e,height:i,depth:r}=this.option.geometry;const n=this.backPlane=new Vo({geometry:{width:e,height:i},position:[0,0,-r/2],rotation:[0,0,0]});this.add(n);const s=this.light=new Uu({color:this.option.color,intensity:this.option.intensity,width:e,height:i});this.add(s);const o=this.imagePlane=new ou({position:[0,0,r/2-.01],rotation:[0,0,0],material:{transparent:!0,opacity:.85}});this.add(o),this.updateBy(this.option)}updateLight(t){if(pt(this.option.light,t),!this.light)return;const e=this.light;this.position;let{depth:i,width:r,height:n,border:s}=this.option.geometry;e.position.x=0,e.position.y=0,e.position.z=i/2+.01,e.width=r-2*s,e.height=n-2*s;const o=this.option.light;e.color=ni(o.color),e.intensity=o.intensity}_updateBoxMesh(){let{border:t,width:e,height:i,depth:r}=this.option.geometry,n=new Oo(this.option),s=new Oo({geometry:{width:e-2*t,height:i-2*t,depth:r}});s.updateMatrix(),n.updateMatrix();let o=lu.fromMesh(n.mesh),a=lu.fromMesh(s.mesh),l=o.subtract(a),h=lu.toMesh(l,n.matrix,new THREE.MeshStandardMaterial);wo.updateMaterial(h,this.option.material),this.mesh&&this.remove(this.mesh),this.add(h),this.mesh=h}updateGeometry(t){pt(this.option.geometry,t);let{border:e,width:i,height:r,depth:n}=this.option.geometry;this._updateBoxMesh(),this.backPlane.updateGeometry({width:i,height:r}),this.backPlane.position.z=-n/2,this.imagePlane.position.z=n/2-.01,this.imagePlane.updateBy({geometry:{width:i-2*e,height:r-2*e}}),this.updateLight()}updateStyle(t){pt(this.option.style,t);const e=this.option.style;this._current=e.current||0,e.images[this._current]||(this._current=0),this.imagePlane.updateBy({material:{map:{image:e.images[this._current]},color:"#ffffff"}})}updateMaterial(t,e){pt(this.option.material,t);let i=this.option.material;wo.updateMaterial(this.mesh,i),wo.updateMaterial(this.backPlane.mesh,{...i,side:2})}_play(){const t=this.option.style.images.length;this._current>t&&(this._current=0),this.playing=!0,this.updateStyle({current:this._current+1})}play(){this.pause(),this._timer=setInterval((()=>{this._play()}),this.option.style.duration)}pause(){clearInterval(this._timer),this._current=0,this.playing=!1}},t.Line=Hh,t.Line2=cc,t.Loader=Rf,t.LogoControl=Ko,t.MeasureControl=wm,t.MeasureMode={MultipleDistance:"MultipleDistance",Distance:"Distance",SimpleDistance:"SimpleDistance",Area:"Area",Angle:"Angle",Height:"Height"},t.MinimapControl=class{constructor(t){this.option=pt({className:"",width:256,scale:1,center:{x:0,y:0}},t),this._container=null,this._viewer=null,this._opacity=1,this._posIndex=3,this.angle=0,this._enable=!0,this.renderer=null,this.scene=new be.Scene,this.camera=null,this.sprite=null,this.ratio=2,this.mainAspect=1,this.renderTarget=null,this.inited=!1,ht(["resize","render","updateBasemap","cameraChange","cameraPositionToMinimapCoords","updateArrowStyle"],this)}_init3d(){const t=(new be.Box3).setFromObject(this._viewer.sm.scene.root);var e=t.max.x>t.max.z?t.max.x:t.max.z,i=Math.abs(t.min.x)>Math.abs(t.min.z)?Math.abs(t.min.x):Math.abs(t.min.z),r=e>i?e:i;r*=1/this.scale,this.camera=new be.OrthographicCamera(-r,r,r,-r,-1e4,1e4),this.camera.position.set(this.center.x,100,this.center.y),this.camera.up=new be.Vector3(0,0,-1).applyEuler(new be.Euler(0,this.angle*Math.PI/180,0,"XYZ")),this.camera.lookAt(new be.Vector3(this.center.x,-1,this.center.y));var n=this._viewer.getSize();this.mainAspect=n.width/n.height,this.ratio=n.width/r,r*this.mainAspect*8<256*this.mainAspect||this.mainAspect,this.renderer||(this.renderer=this._viewer.rm._createRenderer()),this.renderer.setSize(this.width,this.width),this.updateBasemap(),this.inited=!0}setMiniRect(){}onAdd(t,e){this._viewer=t;const i=this._container=U("div","THING-ctrl",null),r=this._minimapContainer=U("div","THING-ctrl-minimap "+this.option.className,i);r.style.pointerEvent="none",i.onmousewheel=i.onmousemove=i.onmousedown=G;const n=U("div","THING-ctrl-minimap-arrow",r);return this.arrowEle=n,this._init3d(),this._viewer.rm.on("render",this.render),this._viewer.on("resize",this.resize),this.resize(),i}_init(){const t=this.renderer=this._viewer.rm._createRenderer();this._minimapContainer.append(t.domElement),this.renderer.setScissorTest(!1);const e=this._viewer.cameraControl.camera.clone();this.camera=e;const i=this._viewer.sm.scene;this.box=(new be.Box3).setFromObject(i.root),this._viewer.rm.addEventListener("render",this.render)}updateBasemap(){const t=this._viewer.sm.scene;var e=t.background;t.background=null,this.renderer.render(t,this.camera);const i=this.renderer.domElement.toDataURL("image/png",.8);this._minimapContainer.style.backgroundImage="url("+i+")",this._minimapContainer.style.backgroundSize="100% 100%",t.background=e}render(){if(!this._viewer.sm)return;this._viewer.sm.scene;const t=this._viewer.rm.renderer,e=this._viewer.camera;var i=t.autoClear;t.autoClear=!1,t.setRenderTarget(null),t.render(this.scene,this.camera),t.autoClear=i;var r=e.position.clone();if(0!=this.angle){var n=new be.Vector3(this.center.x,r.y,this.center.y),s=r.sub(n);s.applyEuler(new be.Euler(0,-this.angle*Math.PI/180,0,"XYZ")),s.add(n),r.copy(s)}var o=this.cameraPositionToMinimapCoords(r),a=o.x,l=o.y;this.updateArrowStyle(a,l,e.position.y);var h,c=e.rotation,d="YXZ"==c.order?c.y:c.z,u=this.arrowEle;h=d>=0?d/Math.PI*180:180*(2-Math.abs(d)/Math.PI),u.style.transform="rotate("+(-h+this.angle)+"deg)"}cameraPositionToMinimapCoords(t){var e,i;i=e=this.width/2;var r,n,s=e/((this.camera.right-this.camera.left)/2);return void 0!==t.x?(r=t.x-this.center.x,n=t.z-this.center.y):(r=t[0]-this.center.x,n=t[2]-this.center.y),{x:r>=0?e-s*r:e+s*Math.abs(r),y:n>=0?i-s*n:i+s*Math.abs(n)}}updateArrowStyle(t,e,i){var r=1/(220/30)*(i>80?i-80:0)+15;r>30&&(r=30);var n=this.arrowEle,s=r;this.width,n.style.right=t-20+"px",n.style.bottom=e-s/2+"px"}__update(){const t=this._viewer.sm.scene,e=this._viewer.cameraControl.camera.position.clone();e.x=t.position.x,e.z=t.position.z,e.y=this.box.max.y+this.option.y,this.camera.position.copy(e),this.camera.lookAt(t.position.clone().setY(0)),this.camera.updateProjectionMatrix(),this.size,this.renderer.render(t,this.camera),this.cameraChange()}cameraChange(){const t=this.size,e=this._viewer.getSize(),i=t.width/e.width,r=t.height/e.height,n=this._viewer.cameraControl,s=this._viewer.cameraControl.camera.position.clone(),o=n.control.getDirection(),a=Math.atan2(o.x,-o.z),l=this.box;var h=new be.Vector3(this.center.x,l.max.y+this.option.y,this.center.y),c=s.sub(h);c.applyEuler(new be.Euler(0,-a*Math.PI/180,0,"XYZ")),c.add(h),s.copy(c);const d=s.multiplyScalar(.9);this.position=d;const u=this._viewer.coordWorldToScreen(d.x,d.y,d.z);this._position=u;const p=this.arrowEle;p.style.transformOrigin="50% 100%",p.style.transform=`\n\t\t\t\ttranslate(${u.x*i}px,${u.y*r}px) \n\t\t\t\t\t\trotate(${180*a/Math.PI}deg)\n\t\t\t\t`}onRemove(){j(this._container),this._viewer.remove("resize",this.resize),this._viewer.rm.removeEventListener("render",this._render),this._viewer.cameraControl.control.removeEventListener("control",this.cameraChange),this._viewer=null}getDefaultPosition(){return"bottom-left"}resize(){if(!this._container)return;const t=this._container.children;if(t.length){const e=this._viewer,i=t[0],r=e.getSize(),n=r.height/r.width;this.size={width:this.width,height:n*this.width},i.style.width=this.width+"px",i.style.height=this.width+"px"}this.renderer&&this.renderer.setSize(this.width,this.width)}destroy(){this.scene.clear(),this.camera=null}_update(){}_recreate(){this.setMiniRect(),this.destroy(),this._init3d()}get width(){return this.option.width}set width(t){this.option.width=t,this.resize(),this._recreate()}get scale(){return this.option.scale}set scale(t){this.option.scale=t,this._recreate()}get center(){return this.option.center}set center(t){this.option.center=t,this._recreate()}get opacity(){return this._opacity}set opacity(t){this._opacity=t,this.sprite.material.opacity=this._opacity}},t.Model=Fo,t.Octahedron=jo,t.POSITION=Yt,t.Plane=Vo,t.PointLight=Qm,t.Points=Jo,t.Polygon=Gc,t.Popup=class extends ui{constructor(t){super(),this.option=pt({offset:null,className:"",tip:!0,closeButton:!0,position:null,html:"",lineWidth:0,lineColor:"rgba(25,25,25, 1)",lineDash:[0,0],lineEndPosition:[.5,1],lineStartOffsetRatio:[1,1],linePointSize:0,linePointColor:"#00ffff",avoid:!1},t||{}),this.container=null,this.contentContainer=null,this.avoid=this.option.avoid,this.id=be.MathUtils.generateUUID(),this._initContainer(),this.setHTML(this.option.html),this.setPosition(this.option.position)}_initContainer(){if(this.container)return;const{className:t,closeButton:e,tip:i}=this.option,r=this.container=U("div","THING-popup-anchor-bottom THING-popup "+t);i&&U("div","THING-popup-tip",r),r.setAttribute("popup-id",this.id),r.style.transition="opacity 0.1s linear",this.contentContainer=U("div","THING-popup-content",r);const n=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");if(n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("popup-id",this.id),n.style.transition="opacity 0.1s linear",n.style.position="absolute",n.style.pointerEvents="none",n.style.zIndex=9,n.style.left=0,n.style.top=0,e){const t=U("div","THING-popup-close-button",r);t.style.zIndex=999,t.innerHTML="x";var s=this;t.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),s.hidden()}))}}show(){if(this.visible)return this;this.container.style.display="";return this.svgContainer.style.display="block",this.visible=!0,this}hidden(){if(!this.visible)return this;this.visible=!1;const t=this.container;t.style.display="none";return this.svgContainer.style.display="none",t&&this.dispatchEvent({type:"close"}),this}setPosition(t){return t?(this.position=ti(t),this.update()):this.position=(new be.Vector3).addScalar(-9999),this}setHTML(t){return this.contentContainer.innerHTML="",t&&(Q(t)?this.contentContainer.innerHTML=t||"":F&&this.contentContainer.appendChild(t)),this}get visible(){return 0!=+this.container.style.opacity&&0!=+this.svgContainer.style.opacity}set visible(t){this.container&&(this.container.style.opacity=t?1:0),this.svgContainer&&(this.svgContainer.style.opacity=t?1:0)}remove(){const t=this.container,e=this.svgContainer;return t.parentNode&&t.parentNode.removeChild(t),e.parentNode&&e.parentNode.removeChild(e),this.viewer,this.viewer=null,this.visible=!1,this.dispatchEvent({type:"close"}),this}addTo(t){return t?(this.remove(),this.viewer=t,t.popups.contains(this)||(t.popups.add(this),this.viewer.container.appendChild(this.container),this.viewer.container.appendChild(this.svgContainer),this.viewer._updatePopups(),setTimeout((()=>{this.update(),this.dispatchEvent({type:"open"})}),300)),this):this}updateBox(){if(!this.viewer)return;const{position:t,viewer:e,container:i,option:r}=this,n=e.coordWorldToScreen(t.x,t.y,t.z);if(n){const{x:t,y:e}=n,i=this.option.offset,r=this.container.clientWidth,s=this.container.clientHeight;this.box2d=new be.Box2(new be.Vector2(t-r/2,e-s+i[1]),new be.Vector2(t+r/2+i[0],e))}}update(){if(!this.visible||!this.viewer||!this.position)return;const{position:t,viewer:e,container:i,option:r}=this;let{x:n,y:s}=e.coordWorldToScreen(t.x,t.y,t.z);(isNaN(n)||n==Number.POSITIVE_INFINITY||n==Number.NEGATIVE_INFINITY)&&(n=0),(isNaN(s)||s==Number.POSITIVE_INFINITY||s==Number.NEGATIVE_INFINITY)&&(s=0);const{clientWidth:o,clientHeight:a}=this.container,{width:l,height:h}=e.getSize(),c=$e(r.offset||[0,0]);if(i.style.left=n-o/2+c.x+"px",i.style.top=s-a+c.y+"px",r.lineWidth>0&&this.visible){const{lineDash:t,lineStartOffsetRatio:e,linePointSize:i,linePointColor:d,lineColor:u,lineWidth:p,lineEndPosition:m}=r;let f=n-o*(.5-m[0])+c.x,g=n+(f-n)*e[0],v=s-a*(1-m[1])+c.y,y=s+(v-s)*e[1];const w={x1:n/l*100,y1:s/h*100,x2:g/l*100,y2:y/h*100},x={x1:g/l*100,y1:y/h*100,x2:f/l*100,y2:v/h*100};let b=`\n\t\t\t\t\t\t\t\t<line stroke-dasharray="${t.join(",")}" x1="${w.x1}%" y1="${w.y1}%" x2="${w.x2}%" y2="${w.y2}%" style="stroke:${u};stroke-width:${p}"/>\n\t\t\t\t\t\t`;if((e[0]<1||e[1]<1)&&(b+=`\n\t\t\t\t\t\t\t\t<line stroke-dasharray="${t.join(",")}" x1="${x.x1}%" y1="${x.y1}%" x2="${x.x2}%" y2="${x.y2}%" style="stroke:${u};stroke-width:${p}"/>\n\t\t\t\t\t\t`),i>0&&(b+=`\n\t\t\t\t\t\t\t\t\t\t<circle cx="${w.x1}%" cy="${w.y1}%" r="${i}" fill="${u}" stroke="${u}" style="stroke-width:${p}" />\n\t\t\t\t\t\t\t\t`),this.svgContainer)try{this.svgContainer.innerHTML=b}catch(t){}}}},t.Rain=class extends Mo{constructor(t){super(pt({material:{rainSpeed:.4,rainColor:"#ffffff",radian:100*be.MathUtils.DEG2RAD,dark:.4,transparent:!0,side:2,depthWrite:!1,depthTest:!1}},t)),this.type="Rain",this.isRain=!0,ht(["_updateTime"],this),this.name="rain",this.particle=null,this._createMesh(),this.updateMaterial(this.option.material),this.locked=!0}setupCommonEvent(){super.setupCommonEvent(),this.addEventListener("added",(()=>{if(this.scene&&this.scene.viewer){this.scene.viewer.rm.addEventListener("render",this._updateTime)}})),this.addEventListener("removed",(()=>{if(this.scene&&this.scene.viewer){const{rm:t}=this.scene.viewer;t.removeEventListener("render",this._updateTime)}}))}_updateTime({clock:t}){this.mesh.material.uniforms.u_time.value=t.getElapsedTime()}updateMaterial(t){super.updateMaterial(t);const e=this.option.material;for(const t in e)if(this.mesh.material.uniforms[t]){let i=e[t];"rainColor"==t&&(i=new be.Color(i)),this.mesh.material.uniforms[t].value=i}}_createMesh(){var t=new be.PlaneBufferGeometry(2,2),e={u_time:{type:"f",value:0},tDiffuse:{value:null},u_resolution:{type:"v2",value:new be.Vector2(window.innerWidth,window.innerHeight).multiplyScalar(window.devicePixelRatio)},dark:{type:"f",value:this.option.material.dark},radian:{value:this.option.material.radian},rainSpeed:{value:this.option.material.rainSpeed},rainColor:{value:new be.Color(this.option.material.rainColor)}},i=new be.ShaderMaterial({transparent:!0,uniforms:e,vertexShader:"\n\t\t\t\t\t\t\t\t#define GLSLIFY 1\n\t\t\t\t\t\t\t\tvarying vec2 vUv;\n\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\t\t\t\t\t\tvUv = uv;\n\t\t\t\t\t\t\t\t\t\tgl_Position = vec4( position, 1.0 );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t",fragmentShader:"\n\t\t\t\t\t\t\t\tuniform sampler2D tDiffuse;\n\t\t\t\t\t\t\t\tuniform vec2 u_resolution;\n\t\t\t\t\t\t\t\tuniform float u_time;\n\t\t\t\t\t\t\t\tuniform float rainSpeed;\n\t\t\t\t\t\t\t\tuniform vec3 rainColor;\n\t\t\t\t\t\t\t\tuniform float radian;\n\t\t\t\t\t\t\t\tuniform float dark;\n\t\t\t\t\t\t\t\tvarying highp vec2 vUv;\n\t\t\t\t\t\t\t\tfloat hash(vec2 p){\n\t\t\t\t\t\t\t\t\t\tp\t= 50.0*fract( p*0.3183099 + vec2(0.71,0.113));\n\t\t\t\t\t\t\t\t\t\treturn -1.0+2.0*fract( p.x*p.y*(p.x+p.y) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfloat noise( in vec2 p ){\n\t\t\t\t\t\t\t\t\t\tvec2 i = floor( p );\n\t\t\t\t\t\t\t\t\t\tvec2 f = fract( p );\n\t\t\t\t\t\t\t\t\t\tvec2 u = f*f*(3.0-2.0*f);\n\t\t\t\t\t\t\t\t\t\treturn mix( mix( hash( i + vec2(0.0,0.0) ), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\thash( i + vec2(1.0,0.0) ), u.x),\n\t\t\t\t\t\t\t\t\t\t\t\tmix( hash( i + vec2(0.0,1.0) ), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\thash( i + vec2(1.0,1.0) ), u.x), u.y);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvoid main(){\n\t\t\t\t\t\t\t\t\t\tvec3 col=texture(tDiffuse,vUv).rgb;\n\t\t\t\t\t\t\t\t\t\tvec2 q = gl_FragCoord.xy/u_resolution.xy;\n\t\t\t\t\t\t\t\t\t\tvec2 p = -1.0+2.0*q;\n\t\t\t\t\t\t\t\t\t\tp.x *= u_resolution.x/u_resolution.y;\n\t\t\t\t\t\t\t\t\t\tvec2 st =\t(p * vec2(.5, .01)+vec2(u_time)*0.05*rainSpeed)-vec2(q.y*cos(radian),0.0);\n\t\t\t\t\t\t\t\t\t\tst*=1000.;\n\t\t\t\t\t\t\t\t\t\tfloat f = noise(st) * noise(st*.773)* 1.55;\n\t\t\t\t\t\t\t\t\t\tf = clamp(pow(abs(f), 23.0) * 13.0, 0.0, q.y*.14) * 2.7;\n\t\t\t\t\t\t\t\t\t\tcol += clamp(f,0.0,1.0)*rainColor;\n\t\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(col, dark);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t"}),r=new be.Mesh(t,i);this.mesh=r,this.add(r)}toJSON(){return super.toJSON()}},t.RectAreaLight=Uu,t.Reflector=ru,t.ReflectorPlane=nu,t.Refractor=su,t.Ring=zo,t.RomaControl=class extends ui{constructor(t,e,i){if(super(),this.option=pt({speed:40,offsetX:0,offsetY:1.7,offsetZ:0,showPath:!1,points:[],model:null,moveStep:.25,loop:!0,tension:.2,line:null,cameraFollow:!0,godMode:!1,inspectionMode:!1,equalDistance:1,inspectionPauseTime:2e3,audio:"",playAudio:!0},e||{}),this.path=null,this._pathPoints=[],this.viewer=t,this.parent=i||this.viewer.scene,this.root=new Ya,this.parent.add(this.root),this.viewpoints=this.option.viewpoints,this.actions=this.option.actions,this.speed=this.option.speed,this.moveStep=this.option.moveStep,this._startGeometry=new Yo({geometry:{radius:.15,height:.75},material:{side:2,color:"#ff0000",transparent:!0,opacity:.95}}),this.option.model){const t=this.model=new Fo(this.option.model);this.root.add(t)}this.box=new Oo({geometry:{width:.1,depth:.1,height:1.7}}),this.audio=new be.Audio(new be.AudioListener),this.setAudio(this.option.audio),this.status=0,this.time=0,this._oldDampingFactor=t.cameraControl?t.cameraControl.control.dampingFactor:.3,this.setPoints(this.option.points||[]),ht(["_playAction","_onPointerDown","_onPointerMove"],this)}setModelParent(t){this.model&&t.attach(this.model)}_initAudio(){}setAudio(t,e){t&&(new be.AudioLoader).load(mo.transformUrl(t),(t=>{this.audio.setBuffer(t),this.audio.setLoop(!0),this.audio.setVolume(1),this.dispatchEvent({type:"audio.loaded"}),e&&e(this.audio)}))}pickStartPoint(){this.viewer.cameraControl.setFirstPersonMode(!1),this._oldView=this.viewer.getView();const t=this.viewer.rm;t.effectRenderer&&(this._effectRendererEnable=t.effectRenderer.enable,t.effectRenderer.enable=!1),this.viewer.container.addEventListener("pointermove",this._onPointerMove),this.viewer.container.addEventListener("pointerdown",this._onPointerDown)}_onPointerMove(t){const e=this.viewer.sceneManager.sceneHelpers,i=this.viewer.coordScreenToWorldWithPick(t.clientX,t.clientY);i&&(e.hasChild(this._startGeometry)||e.add(this._startGeometry),i[1]+=this._startGeometry.getSize().y/2,this._startGeometry.position.fromArray(i))}_onPointerDown(t){let e=this.viewer.coordScreenToWorldWithPick(t.clientX,t.clientY);const i=this.viewer.cameraControl;if(this.moveStep,i.setPosition(e,!1),i.setFirstPersonMode(!0,this.option),i._oldMoveStep=i.moveStep,i.moveStep=this.moveStep,this._startGeometry.removeBySelf(),this.viewer.container.removeEventListener("pointermove",this._onPointerMove),this.viewer.container.removeEventListener("pointerdown",this._onPointerDown),this.mode="firstPerson",this._effectRendererEnable){this.viewer.rm.effectRenderer.enable=!0,delete this._effectRendererEnable}}_getMileSpeed(){return 1e3*this.speed/3600}setPoints(t){if(!t||!t.length)return;let e=[],i=0;for(let i=0;i<t.length;i++){const r=t[i],n=new be.Vector3(r[0],r[1],r[2]);e.push(n)}this.points=e,this._visitedPointIndex=0,e.slice(1).forEach((t=>{i+=t.distanceTo(e[0])}));const r=this._getMileSpeed(),n=10*Math.round(i/r);if(this.path=new be.CatmullRomCurve3(e,!1,"catmullrom",this.option.tension),this._pathPoints=this.path.getPoints(n),this.option.showPath&&t){const e=this.option.line||{},i=this.routeLine=new cc({points:t,locked:!0,material:{linewidth:3,worldUnits:!1,...e.material||{}}});this.root.add(i)}this._initModel()}isPlaying(){return 1==this.status}isPaused(){return 2==this.status}isStopped(){return 0==this.status}_initModel(){const t=this.model;if(!t)return;let e=this.path.getPointAt(1e-4),i=this.path.getPointAt(2e-4);e&&e.x&&i&&(t.position.set(e.x,e.y,e.z),t.lookAt(i.x,i.y,i.z))}_playAction(){const t=this._pathPoints;if(this.isPlaying()&&t&&t.length){const{loop:i,inspectionMode:r}=this.option,n=t.length;if(this.time>n&&!i)return void this.stop();this.time>n&&(this.time=0,this._visitedPointIndex=0);const s=this.time%n,o=(this.time+1)%n;this.time+=1;let a=this.path.getPointAt(s/n),l=this.path.getPointAt(o/n);if(a&&a.x&&0!==s&&0!==o){this.model&&(this.model.position.set(a.x,a.y,a.z),this.model.lookAt(l.x,l.y,l.z)),this.box.position.set(a.x,a.y,a.z),this.box.lookAt(l.x,l.y,l.z);const{offsetX:t,offsetY:i,offsetZ:r,godMode:n}=this.option,s=new be.Vector3(a.x,a.y+(n?0:i),a.z);if(this.dispatchEvent({type:"playing"}),this.viewer._updatePopups(),this.option.inspectionMode){const{equalDistance:t,inspectionPauseTime:e}=this.option;let i=this._visitedPointIndex;const r=this.points[i];this.time>0&&r&&a.distanceTo(r)<=t&&(this.pause(),this.dispatchEvent({type:"inspection.pause",data:{index:i,point:r.clone()}}),setTimeout((()=>{this._visitedPointIndex+=1,this.dispatchEvent({type:"inspection.continue",data:{index:i,point:r.clone()}}),this.play()}),e||0))}if(this.option.cameraFollow){var e=new be.Vector3(n?0:t,i,n?0:r).applyMatrix4(this.box.matrixWorld);this.viewer.cameraControl.lookAt(s,e,!1)}this.viewer.rendererManager.enableRender()}}this._playActionFrame=requestAnimationFrame(this._playAction)}playAudio(){this.audio&&this.option.playAudio&&this.option.audio&&(this.audio.isPlaying||this.audio.play())}play(){this.isStopped()?(this.time=0,this.status=1,this._playAction()):this.status=1,this.dispatchEvent({type:"play"})}pause(){this.status=2,this.viewer&&(this.audio&&this.option.playAudio&&this.option.audio,this.viewer.cameraControl&&(this.viewer.cameraControl.control.dampingFactor=this._oldDampingFactor),this.dispatchEvent({type:"pause"}))}stop(){this.time=0,cancelAnimationFrame(this._playAction),cancelAnimationFrame(this._playActionFrame),this.status=0,this.time=0,this._visitedPointIndex=0,this._playActionFrame=null,this.audio&&this.option.playAudio&&this.option.audio&&this.audio.stop();const t=this.viewer;t.cameraControl.firstPersonMode&&(t.cameraControl.setFirstPersonMode(!1),t.cameraControl.moveStep=t.cameraControl._oldMoveStep),this._initModel(),this.viewer.cameraControl.control.dampingFactor=this._oldDampingFactor,this.dispatchEvent({type:"stop"})}exit(){this.stop(),this._oldView&&(this.viewer.setView(this._oldView),this._oldView=null),this.dispatchEvent({type:"exit"})}clear(){const t=this.viewer;this._startGeometry.removeBySelf(),t.container.removeEventListener("pointermove",this._onPointerMove),t.container.removeEventListener("pointerdown",this._onPointerDown),t.cameraControl.firstPersonMode&&t.cameraControl.setFirstPersonMode(!1)}destroy(){this.stop(),this.clear(),this.root.clear()}},t.RouteLine=Ic,t.Selector=Ql,t.SmokeFire=class extends Mo{constructor(t){super(pt({particle:{sizeScale:1,positionStyle:"cube",positionBase:[0,0,0],positionRadius:.5,positionSpread:[.5,0,.5],speedBase:.1,speedSpread:.2,sizeBase:0,sizeSpread:0,velocityStyle:"cube",velocityBase:[0,50,0],velocitySpread:[40,50,40],accelerationBase:[0,-10,0],sizeTween:[[0,.2],[2,16]],opacityTween:[[0,.2],[.8,0]],colorTween:[[0,.1],[[.8,.8,.8],[.1,.1,.1]]],colorBase:[1,1,1],angleBase:0,angleSpread:720,angleVelocityBase:0,angleVelocitySpread:720,angleAccelerationBase:0,angleAccelerationSpread:0,particlesPerSecond:300,particleDeathAge:2,particleTexture:"",emitterAge:0,emitterDeathAge:1e4,emitterAlive:!0}},t)),this.isParticle=!0,this.type="SmokeFire",this.isSmokeFire=!0,this.particle={},ht(["_updateParticle"],this)}setupCommonEvent(){super.setupCommonEvent(),this.addEventListener("added",(()=>{if(this.scene){this.updateParticle();const{rm:t}=this.scene.viewer;t.addEventListener("render",this._updateParticle)}}))}_updateParticle({clock:t}){if(!(this.visible&&t&&this.scene&&this.engine))return;let e=t.getDelta();this.engine.update(e)}updateParticle(t){pt(this.option.particle,t);const e=this.option.particle;for(const t in e){const i=e[t];switch(t){case"positionStyle":case"velocityStyle":this.particle[t]=Hf[i.toUpperCase()];break;case"particleTexture":if(i){const e=(new be.TextureLoader).load(mo.transformUrl(i));e.encoding=be.sRGBEncoding,this.particle[t]=e}else this.particle[t]=null;break;case"sizeTween":case"colorTween":case"opacityTween":if(i){const e="sizeTween"===t?this.option.particle.sizeScale:1;let r=i[0].map((t=>Array.isArray(t)?ti(t).multiplyScalar(e):t*e)),n=i[1].map((t=>Array.isArray(t)?ti(t).multiplyScalar(e):t*e));this.particle[t]=new jf(r,n)}else this.particle[t]=new jf;break;case"colorBase":case"colorSpread":case"positionBase":case"positionSpread":case"velocityBase":case"velocitySpread":case"accelerationBase":case"accelerationSpread":this.particle[t]=ti(i);break;default:this.particle[t]=i}}this.engine&&this.engine.destroy(),this.engine=new Gf(this),this.engine.setValues(this.particle),this.engine.initialize()}},t.Snow=class extends Mo{constructor(t){super(pt({number:1e4,range:100,speed:.3,material:{size:2,opacity:.6,depthTest:!1,transparent:!0}},t)),this.type="Snow",this.isSnow=!0,ht(["snowing"],this),this._updatePosition=ut(this.__updatePosition,100,this),this.name="snow",this.speed=this.option.speed,this.size=this.option.material.size,this.particle=null,this._createParticle(),this.updateMaterial(this.option.material),this.locked=!0}setupCommonEvent(){super.setupCommonEvent(),this.addEventListener("added",(()=>{if(this.scene&&this.scene.viewer){const{rm:t,cameraControl:e}=this.scene.viewer;t.addEventListener("render",this.snowing),e.control.addEventListener("control",this._updatePosition)}})),this.addEventListener("removed",(()=>{if(this.scene&&this.scene.viewer){const{rm:t,cameraControl:e}=this.scene.viewer;t.removeEventListener("render",this.snowing),e.control.removeEventListener("control",this._updatePosition)}}))}__updatePosition(){if(this.scene&&this.scene.viewer){const{rm:t,cameraControl:e}=this.scene.viewer,i=e.camera.position;this.position.copy(i),t.enableRender()}}_createParticle(){const{number:t,range:e}=this.option,i=new be.BufferGeometry,r=new be.PointsMaterial({depthWrite:!1,vertexColors:!0,blending:be.AdditiveBlending});let n=[];const s=[];for(let i=0;i<t;i++){const t=new be.Color,i={h:0,s:0,l:0};t.getHSL(i),t.setHSL(i.h,i.s,i.l*Math.random()),s.push(t.r,t.g,t.b),n.push(be.MathUtils.randFloatSpread(2*e),be.MathUtils.randFloatSpread(2*e),be.MathUtils.randFloatSpread(2*e))}i.setAttribute("position",new be.Float32BufferAttribute(n,3)),i.setAttribute("color",new be.Float32BufferAttribute(s,3)),this.particle=new be.Points(i,r),this.add(this.particle)}get size(){return this.option.material.size}set size(t){this.updateMaterial({size:t})}snowing(){const{range:t}=this.option,e=this.particle.geometry.attributes.position;for(let i=0;i<e.count;i++){let r=e.getY(i);r-=this.speed,r<-t&&(r=t),e.setY(i,r)}e.needsUpdate=!0}},t.Sphere=Go,t.SpotLight=Ym,t.TAGS=["Respawn","Finish","EditorOnly","MainCamera","Player","GameController"],t.THREE=Kf,t.TWEEN=Wt,t.Tetrahedron=Ho,t.Texture=Lf,t.Thing=Mo,t.Torus=Xo,t.TorusKnot=Wo,t.TubeLine=Uc,t.TubeLine2=kc,t.Utils=Jf,t.VideoPlane=au,t.Viewer=bm,t.Water=zc,t.WaveCircle=class extends No{constructor(t){super(pt({rotation:[-Math.PI/2,0,0],geometry:{radius:1,segments:30,thetaStart:0,thetaLength:2*Math.PI},material:{side:2,depthWrite:!1,depthTest:!1,depthFunc:0,vertexColors:!0,blending:be.AdditiveBlending,uniforms:{uColor:"#ffffff",uOpacity:1,uSpeed:.25,uSge:5,uRadius:1,time:0}}},t)),this.type="WaveCircle",this.isWaveCircle=!0,ht(["_updateTime"],this),this._initMaterial()}setupCommonEvent(){super.setupCommonEvent(),this.addEventListener("added",(()=>{if(this.scene&&this.scene.viewer){this.scene.viewer.rm.addEventListener("render",this._updateTime)}})),this.addEventListener("removed",(()=>{if(this.scene&&this.scene.viewer){const{rm:t}=this.scene.viewer;t.removeEventListener("render",this._updateTime)}}))}updateGeometry(t){super.updateGeometry(t),t&&t.radius&&(this.mesh.material.uniforms.uRadius.value=t.radius)}_updateTime({clock:t}){t&&(this.mesh.material.uniforms.time.value=t.getElapsedTime())}updateMaterial(t){super.updateMaterial(t)}_initMaterial(){const t=this.option.material.uniforms,e=new be.ShaderMaterial({uniforms:{uColor:{value:new be.Color(t.uColor)},uOpacity:{value:t.uOpacity},uSpeed:{value:t.uSpeed},uSge:{value:t.uSge},uRadius:{value:this.option.geometry.radius},time:{value:t.time}},transparent:!0,vertexShader:`\n\t\t\t\t\t\t\t\t${be.ShaderChunk.common}\n\t\t\t\t\t\t\t\t${be.ShaderChunk.logdepthbuf_pars_vertex}\n\t\t\t\t\t\t\t\tvarying vec2 vUv;\n\t\t\t\t\t\t\t\tvoid main() { \n\t\t\t\t\t\t\t\t\t\tvUv = uv;\n\t\t\t\t\t\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t\t\t\t\t\t\t${be.ShaderChunk.logdepthbuf_vertex}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t`,fragmentShader:`\n\n\t\t\t\t\t\t${be.ShaderChunk.logdepthbuf_pars_fragment}\n\n\t\t\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t\t\tuniform vec3 uColor;\n\t\t\t\t\t\tuniform float uOpacity;\n\t\t\t\t\t\tuniform float uSpeed; \n\t\t\t\t\t\tuniform float uSge;\n\t\t\t\t\t\tuniform float time;\n\n\t\t\t\t\t\tfloat PI = 3.14159265;\n\n\t\t\t\t\t\tfloat drawCircle(float index, float range) {\n\t\t\t\t\t\t\t\tfloat opacity = 1.0;\n\t\t\t\t\t\t\t\tif (index >= 1.0 - range) {\n\t\t\t\t\t\t\t\t\t\topacity = 1.0 - (index - (1.0 - range)) / range;\n\t\t\t\t\t\t\t\t} else if(index <= range) {\n\t\t\t\t\t\t\t\t\t\topacity = index / range;\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\treturn opacity;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfloat distanceTo(vec2 src, vec2 dst) {\n\t\t\t\t\t\t\t\tfloat dx = src.x - dst.x;\n\t\t\t\t\t\t\t\tfloat dy = src.y - dst.y;\n\t\t\t\t\t\t\t\tfloat dv = dx * dx + dy * dy;\n\t\t\t\t\t\t\t\treturn sqrt(dv);\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\tvoid main() { \n\t\t\t\t\t\t\t\tfloat iTime = -time * uSpeed;\n\t\t\t\t\t\t\t\tfloat opacity = 0.0;\n\n\t\t\t\t\t\t\t\tfloat len = distanceTo(vec2(0.5, 0.5), vec2(vUv.x, vUv.y)); \n\t\t\n\t\t\t\t\t\t\t\tfloat size = 1.0 / uSge;\n\t\t\t\t\t\t\t\tvec2 range = vec2(0.65, 0.75);\n\t\t\t\t\t\t\t\tfloat index = mod(iTime + len, size); \n\t\t\t\t\t\t\t\t// 中心圆 \n\t\t\t\t\t\t\t\tvec2 cRadius = vec2(0.06, 0.12); \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (index < size && len <= 0.5) {\t \n\t\t\t\t\t\t\t\t\t\tfloat i = sin(index / size * PI); \n\t\t\n\t\t\t\t\t\t\t\t\t\t// 处理边缘锯齿\n\t\t\t\t\t\t\t\t\t\tif (i >= range.x && i <= range.y){\n\t\t\t\t\t\t\t\t\t\t\t\t// 归一\n\t\t\t\t\t\t\t\t\t\t\t\tfloat t = (i - range.x) / (range.y - range.x);\n\t\t\t\t\t\t\t\t\t\t\t\t// 边缘锯齿范围\n\t\t\t\t\t\t\t\t\t\t\t\tfloat r = 0.3;\n\t\t\t\t\t\t\t\t\t\t\t\topacity = drawCircle(t, r);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// 渐变\n\t\t\t\t\t\t\t\t\t\topacity *=\t1.0 - len / 0.5;\n\t\t\t\t\t\t\t\t}; \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tgl_FragColor = vec4(uColor, uOpacity * opacity);\n\n\t\t\t\t\t\t\t\t${be.ShaderChunk.logdepthbuf_fragment}\n\t\t\t\t\t\t}`});this.mesh.material=e}},t.hotkeys=Xl,t.materialManager=wo,t.path=qf,t.resourceManager=mo,t.version="1.0.0",Object.defineProperty(t,"__esModule",{value:!0})}));