PageSourceSearch

https://static2.hicustom.com/static/admin/dist/[email protected]

js hicustom.com collected 2026-09-26 08:32:25 UTC 963,323 bytes, 12 lines download raw bytes

1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Zw3d=e():t.Zw3d=e()}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=33)}([function(t,e,i){(function(e){var i;i=function(){"use strict";
2/*
3     * Konva JavaScript Framework v7.2.1
4     * http://konvajs.org/
5     * Licensed under the MIT
6     * Date: Mon Dec 07 2020
7     *
8     * Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
9     * Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
10     *
11     * @license
12     */var t=Math.PI/180,i=function(t){var e=t.indexOf("msie ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("trident/")>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var n=t.indexOf("edge/");return n>0&&parseInt(t.substring(n+5,t.indexOf(".",n)),10)},n=function(t){var e=t.toLowerCase(),n=/(chrome)[ /]([\w.]+)/.exec(e)||/(webkit)[ /]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],r=!!t.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i),a=!!t.match(/IEMobile/i);return{browser:n[1]||"",version:n[2]||"0",isIE:i(e),mobile:r,ieMobile:a}},r=void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},a={_global:r,version:"7.2.1",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(t){}.toString()),dblClickWindow:400,getAngle:function(e){return a.angleDeg?e*t:e},enableTrace:!1,_pointerEventsEnabled:!1,hitOnDragEnabled:!1,captureTouchEventsEnabled:!1,listenClickTap:!1,inDblClickWindow:!1,pixelRatio:void 0,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:function(){return a.DD.isDragging},isDragReady:function(){return!!a.DD.node},UA:n(r.navigator&&r.navigator.userAgent||""),document:r.document,_injectGlobal:function(t){r.Konva=t},_parseUA:n},o={},s=function(t){o[t.prototype.getClassName()]=t,a[t.prototype.getClassName()]=t},h=function(){function t(){}return t.toCollection=function(e){var i,n=new t,r=e.length;for(i=0;i<r;i++)n.push(e[i]);return n},t._mapMethod=function(e){t.prototype[e]=function(){var t,i=this.length,n=[].slice.call(arguments);for(t=0;t<i;t++)this[t][e].apply(this[t],n);return this}},t.mapMethods=function(e){var i=e.prototype;for(var n in i)t._mapMethod(n)},t}();h.prototype=[],h.prototype.each=function(t){for(var e=0;e<this.length;e++)t(this[e],e)},h.prototype.toArray=function(){var t,e=[],i=this.length;for(t=0;t<i;t++)e.push(this[t]);return e};var c=function(){function t(t){void 0===t&&(t=[1,0,0,1,0,0]),this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}return t.prototype.reset=function(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0},t.prototype.copy=function(){return new t(this.m)},t.prototype.copyInto=function(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]},t.prototype.point=function(t){var e=this.m;return{x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}},t.prototype.translate=function(t,e){return this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e,this},t.prototype.scale=function(t,e){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.m[0]*e+this.m[2]*i,r=this.m[1]*e+this.m[3]*i,a=this.m[0]*-i+this.m[2]*e,o=this.m[1]*-i+this.m[3]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=a,this.m[3]=o,this},t.prototype.getTranslation=function(){return{x:this.m[4],y:this.m[5]}},t.prototype.skew=function(t,e){var i=this.m[0]+this.m[2]*e,n=this.m[1]+this.m[3]*e,r=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=i,this.m[1]=n,this.m[2]=r,this.m[3]=a,this},t.prototype.multiply=function(t){var e=this.m[0]*t.m[0]+this.m[2]*t.m[1],i=this.m[1]*t.m[0]+this.m[3]*t.m[1],n=this.m[0]*t.m[2]+this.m[2]*t.m[3],r=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],o=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=e,this.m[1]=i,this.m[2]=n,this.m[3]=r,this.m[4]=a,this.m[5]=o,this},t.prototype.invert=function(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),e=this.m[3]*t,i=-this.m[1]*t,n=-this.m[2]*t,r=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=e,this.m[1]=i,this.m[2]=n,this.m[3]=r,this.m[4]=a,this.m[5]=o,this},t.prototype.getMatrix=function(){return this.m},t.prototype.setAbsolutePosition=function(t,e){var i=this.m[0],n=this.m[1],r=this.m[2],a=this.m[3],o=this.m[4],s=(i*(e-this.m[5])-n*(t-o))/(i*a-n*r),h=(t-o-r*s)/i;return this.translate(h,s)},t.prototype.decompose=function(){var t=this.m[0],e=this.m[1],i=this.m[2],n=this.m[3],r=t*n-e*i,a={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=t||0!=e){var o=Math.sqrt(t*t+e*e);a.rotation=e>0?Math.acos(t/o):-Math.acos(t/o),a.scaleX=o,a.scaleY=r/o,a.skewX=(t*i+e*n)/r,a.skewY=0}
12else if(0!=i||0!=n){var s=Math.sqrt(i*i+n*n);a.rotation=Math.PI/2-(n>0?Math.acos(-i/s):-Math.acos(i/s)),a.scaleX=r/s,a.scaleY=s,a.skewX=0,a.skewY=(t*i+e*n)/r}return a.rotation=m._getRotation(a.rotation),a},t}(),l=Math.PI/180,u=180/Math.PI,d={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},p=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,f=[],m={_isElement:function(t){return!(!t||1!=t.nodeType)},_isFunction:function(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject:function(t){return!!t&&t.constructor===Object},_isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},_isNumber:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)&&isFinite(t)},_isString:function(t){return"[object String]"===Object.prototype.toString.call(t)},_isBoolean:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},isObject:function(t){return t instanceof Object},isValidSelector:function(t){if("string"!=typeof t)return!1;var e=t[0];return"#"===e||"."===e||e===e.toUpperCase()},_sign:function(t){return 0===t?0:t>0?1:-1},requestAnimFrame:function(t){f.push(t),1===f.length&&requestAnimationFrame((function(){var t=f;f=[],t.forEach((function(t){t()}))}))},createCanvasElement:function(){var t=document.createElement("canvas");try{t.style=t.style||{}}catch(t){}return t},createImageElement:function(){return document.createElement("img")},_isInDocument:function(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_simplifyArray:function(t){var e,i,n=[],r=t.length,a=m;for(e=0;e<r;e++)i=t[e],a._isNumber(i)?i=Math.round(1e3*i)/1e3:a._isString(i)||(i=i.toString()),n.push(i);return n},_urlToImage:function(t,e){var i=new r.Image;i.onload=function(){e(i)},i.src=t}
12,_rgbToHex:function(t,e,i){return((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},_hexToRgb:function(t){t=t.replace("#","");var e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},getRandomColor:function(){for(var t=(16777215*Math.random()<<0).toString(16);t.length<6;)t="0"+t;return"#"+t},get:function(t,e){return void 0===t?e:t},getRGB:function(t){var e;return t in d?{r:(e=d[t])[0],g:e[1],b:e[2]}:"#"===t[0]?this._hexToRgb(t.substring(1)):"rgb("===t.substr(0,4)?(e=p.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA:function(t){return t=t||"black",m._namedColorToRBA(t)||m._hex3ColorToRGBA(t)||m._hex6ColorToRGBA(t)||m._rgbColorToRGBA(t)||m._rgbaColorToRGBA(t)||m._hslColorToRGBA(t)},_namedColorToRBA:function(t){var e=d[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA:function(t){if(0===t.indexOf("rgb(")){var e=(t=t.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA:function(t){if(0===t.indexOf("rgba(")){var e=(t=t.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex6ColorToRGBA:function(t){if("#"===t[0]&&7===t.length)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex3ColorToRGBA:function(t){if("#"===t[0]&&4===t.length)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA:function(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){var e=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),i=(e[0],e.slice(1)),n=Number(i[0])/360,r=Number(i[1])/100,a=Number(i[2])/100,o=void 0,s=void 0,h=void 0;if(0===r)return h=255*a,{r:Math.round(h),g:Math.round(h),b:Math.round(h),a:1};for(var c=2*a-(o=a<.5?a*(1+r):a+r-a*r),l=[0,0,0],u=0;u<3;u++)(s=n+1/3*-(u-1))<0&&s++,s>1&&s--,h=6*s<1?c+6*(o-c)*s:2*s<1?o:3*s<2?c+(o-c)*(2/3-s)*6:c,l[u]=255*h;return{r:Math.round(l[0]),g:Math.round(l[1]),b:Math.round(l[2]),a:1}}},haveIntersection:function(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject:function(t){var e={};for(var i in t)this._isPlainObject(t[i])?e[i]=this.cloneObject(t[i]):this._isArray(t[i])?e[i]=this.cloneArray(t[i]):e[i]=t[i];return e},cloneArray:function(t){return t.slice(0)},_degToRad:function(t){return t*l},_radToDeg:function(t){return t*u},_getRotation:function(t){return a.angleDeg?m._radToDeg(t):t},_capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw:function(t){throw new Error("Konva error: "+t)},error:function(t){console.error("Konva error: "+t)},warn:function(t){a.showWarnings&&console.warn("Konva warning: "+t)},extend:function(t,e){function i(){this.constructor=t}i.prototype=e.prototype;var n=t.prototype;for(var r in t.prototype=new i,n)n.hasOwnProperty(r)&&(t.prototype[r]=n[r]);t.__super__=e.prototype,t.super=e},_getControlPoints:function(t,e,i,n,r,a,o){var s=Math.sqrt(Math.pow(i-t,2)+Math.pow(n-e,2)),h=Math.sqrt(Math.pow(r-i,2)+Math.pow(a-n,2)),c=o*s/(s+h),l=o*h/(s+h);return[i-c*(r-t),n-c*(a-e),i+l*(r-t),n+l*(a-e)]},_expandPoints:function(t,e){var i,n,r=t.length,a=[];for(i=2;i<r-2;i+=2)n=m._getControlPoints(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e),a.push(n[0]),a.push(n[1]),a.push(t[i]),a.push(t[i+1]),a.push(n[2]),a.push(n[3]);return a},each:function(t,e){for(var i in t)e(i,t[i])},_inRange:function(t,e,i){return e<=t&&t<i},_getProjectionToSegment:function(t,e,i,n,r,a){var o,s,h,c=(t-i)*(t-i)+(e-n)*(e-n);if(0==c)o=t,s=e,h=(r-i)*(r-i)+(a-n)*(a-n);else{var l=((r-t)*(i-t)+(a-e)*(n-e))/c;l<0?(o=t,s=e,h=(t-r)*(t-r)+(e-a)*(e-a)):l>
121?(o=i,s=n,h=(i-r)*(i-r)+(n-a)*(n-a)):h=((o=t+l*(i-t))-r)*(o-r)+((s=e+l*(n-e))-a)*(s-a)}return[o,s,h]},_getProjectionToLine:function(t,e,i){var n=m.cloneObject(t),r=Number.MAX_VALUE;return e.forEach((function(a,o){if(i||o!==e.length-1){var s=e[(o+1)%e.length],h=m._getProjectionToSegment(a.x,a.y,s.x,s.y,t.x,t.y),c=h[0],l=h[1],u=h[2];u<r&&(n.x=c,n.y=l,r=u)}})),n},_prepareArrayForTween:function(t,e,i){var n,r=[],a=[];if(t.length>e.length){var o=e;e=t,t=o}for(n=0;n<t.length;n+=2)r.push({x:t[n],y:t[n+1]});for(n=0;n<e.length;n+=2)a.push({x:e[n],y:e[n+1]});var s=[];return a.forEach((function(t){var e=m._getProjectionToLine(t,r,i);s.push(e.x),s.push(e.y)})),s},_prepareToStringify:function(t){var e;for(var i in t.visitedByCircularReferenceRemoval=!0,t)if(t.hasOwnProperty(i)&&t[i]&&"object"==typeof t[i])if(e=Object.getOwnPropertyDescriptor(t,i),t[i].visitedByCircularReferenceRemoval||m._isElement(t[i])){if(!e.configurable)return null;delete t[i]}else if(null===m._prepareToStringify(t[i])){if(!e.configurable)return null;delete t[i]}return delete t.visitedByCircularReferenceRemoval,t},_assign:function(t,e){for(var i in e)t[i]=e[i];return t},_getFirstPointerId:function(t){return t.touches?t.changedTouches[0].identifier:999}};function g(t){return m._isString(t)?'"'+t+'"':"[object Number]"===Object.prototype.toString.call(t)||m._isBoolean(t)?t:Object.prototype.toString.call(t)}function v(t){return t>255?255:t<0?0:Math.round(t)}function y(){if(a.isUnminified)return function(t,e){return m._isNumber(t)||m.warn(g(t)+' is a not val
12id value for "'+e+'" attribute. The value should be a number.'),t}}function x(t){if(a.isUnminified)return function(e,i){var n=m._isNumber(e),r=m._isArray(e)&&e.length==t;return n||r||m.warn(g(e)+' is a not valid value for "'+i+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function b(){if(a.isUnminified)return function(t,e){return m._isNumber(t)||"auto"===t||m.warn(g(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function _(){if(a.isUnminified)return function(t,e){return m._isString(t)||m.warn(g(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function w(){if(a.isUnminified)return function(t,e){var i=m._isString(t),n="[object CanvasGradient]"===Object.prototype.toString.call(t);return i||n||m.warn(g(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function M(){if(a.isUnminified)return function(t,e){return!0===t||!1===t||m.warn(g(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}var S={addGetterSetter:function(t,e,i,n,r){S.addGetter(t,e,i),S.addSetter(t,e,n,r),S.addOverloadedGetterSetter(t,e)},addGetter:function(t,e,i){var n="get"+m._capitalize(e);t.prototype[n]=t.prototype[n]||function(){var t=this.attrs[e];return void 0===t?i:t}},addSetter:function(t,e,i,n){var r="set"+m._capitalize(e);t.prototype[r]||S.overWriteSetter(t,e,i,n)},overWriteSetter:function(t,e,i,n){var r="set"+m._capitalize(e);t.prototype[r]=function(t){return i&&null!=t&&(t=i.call(this,t,e)),this._setAttr(e,t),n&&n.call(this),this}},addComponentsGetterSetter:function(t,e,i,n,r){var o,s,h=i.length,c=m._capitalize,l="get"+c(e),u="set"+c(e);t.prototype[l]=function(){var t={};for(o=0;o<h;o++)t[s=i[o]]=this.getAttr(e+c(s));return t};var d=function(t){if(a.isUnminified)return function(e,i){return m.isObject(e)||m.warn(g(e)+' is a not val
12id value for "'+i+'" attribute. The value should be an object with properties '+t),e}}(i);t.prototype[u]=function(t){var i,a=this.attrs[e];for(i in n&&(t=n.call(this,t)),d&&d.call(this,t,e),t)t.hasOwnProperty(i)&&this._setAttr(e+c(i),t[i]);return this._fireChangeEvent(e,a,t),r&&r.call(this),this},S.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter:function(t,e){var i=m._capitalize(e),n="set"+i,r="get"+i;t.prototype[e]=function(){return arguments.length?(this[n](arguments[0]),this):this[r]()}},addDeprecatedGetterSetter:function(t,e,i,n){m.error("Adding deprecated "+e);var r="get"+m._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[r]=function(){m.error(a);var t=this.attrs[e];return void 0===t?i:t},S.addSetter(t,e,n,(function(){m.error(a)})),S.addOverloadedGetterSetter(t,e)},backCompat:function(t,e){m.each(e,(function(e,i){var n=t.prototype[i],r="get"+m._capitalize(e),a="set"+m._capitalize(e);function o(){n.apply(this,arguments),m.error('"'+e+'" method is deprecated and will be removed soon. Use ""'+i+'" instead.')}t.prototype[e]=o,t.prototype[r]=o,t.prototype[a]=o}))},afterSetFilter:function(){this._filterUpToDate=!1}},T=function(t,e){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function E(t,e){function i(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var A=function(){return(A=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},P=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],C=function(){function t(t){this.canvas=t,this._context=t._canvas.getContext("2d"),a.enableTrace&&(this.traceArr=[],this._enableTrace())}return t.prototype.fillShape=function(t){t.fillEnabled()&&this._fill(t)},t.prototype._fill=function(t){},t.prototype.strokeShape=function(t){t.hasStroke()&&this._stroke(t)},t.prototype._stroke=function(t){},t.prototype.fillStrokeShape=function(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))},t.prototype.getTrace=function(t){var e,i,n,r,a=this.traceArr,o=a.length,s="";for(e=0;e<o;e++)(n=(i=a[e]).method)?(r=i.args,s+=n,t?s+="()":m._isArray(r[0])?s+="(["+r.join(",")+"])":s+="("+r.join(",")+")"):(s+=i.property,t||(s+="="+i.val)),s+=";";return s},t.prototype.clearTrace=function(){this.traceArr=[]},t.prototype._trace=function(t){var e=this.traceArr;e.push(t),e.length>=100&&e.shift()},t.prototype.reset=function(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)},t.prototype.getCanvas=function(){return this.canvas},t.prototype.clear=function(t){var e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)},t.prototype._applyLineCap=function(t){var e=t.getLineCap();e&&this.setAttr("lineCap",e)},t.prototype._applyOpacity=function(t){var e=t.getAbsoluteOpacity();1!==e&&this.setAttr("globalAlpha",e)},t.prototype._applyLineJoin=function(t){var e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)},t.prototype.setAttr=function(t,e){this._context[t]=e},t.prototype.arc=function(t,e,i,n,r,a){this._context.arc(t,e,i,n,r,a)},t.prototype.arcTo=function(t,e,i,n,r){this._context.arcTo(t,e,i,n,r)},t.prototype.beginPath=function(){this._context.beginPath()},t.prototype.bezierCurveTo=function(t,e,i,n,r,a){this._context.bezierCurveTo(t,e,i,n,r,a)},t.prototype.clearRect=function(t,e,i,n){this._context.clearRect(t,e,i,n)},t.prototype.clip=function(){this._context.clip()},t.prototype.closePath=function(){this._context.closePath()},t.prototype.createImageData=function(t,e){var i=arguments;return 2===i.length?this._context.createImageData(t,e):1===i.length?this._context.createImageData(t):void 0}
12,t.prototype.createLinearGradient=function(t,e,i,n){return this._context.createLinearGradient(t,e,i,n)},t.prototype.createPattern=function(t,e){return this._context.createPattern(t,e)},t.prototype.createRadialGradient=function(t,e,i,n,r,a){return this._context.createRadialGradient(t,e,i,n,r,a)},t.prototype.drawImage=function(t,e,i,n,r,a,o,s,h){var c=arguments,l=this._context;3===c.length?l.drawImage(t,e,i):5===c.length?l.drawImage(t,e,i,n,r):9===c.length&&l.drawImage(t,e,i,n,r,a,o,s,h)},t.prototype.ellipse=function(t,e,i,n,r,a,o,s){this._context.ellipse(t,e,i,n,r,a,o,s)},t.prototype.isPointInPath=function(t,e){return this._context.isPointInPath(t,e)},t.prototype.fill=function(){this._context.fill()},t.prototype.fillRect=function(t,e,i,n){this._context.fillRect(t,e,i,n)},t.prototype.strokeRect=function(t,e,i,n){this._context.strokeRect(t,e,i,n)},t.prototype.fillText=function(t,e,i){this._context.fillText(t,e,i)},t.prototype.measureText=function(t){return this._context.measureText(t)},t.prototype.getImageData=function(t,e,i,n){return this._context.getImageData(t,e,i,n)},t.prototype.lineTo=function(t,e){this._context.lineTo(t,e)},t.prototype.moveTo=function(t,e){this._context.moveTo(t,e)},t.prototype.rect=function(t,e,i,n){this._context.rect(t,e,i,n)},t.prototype.putImageData=function(t,e,i){this._context.putImageData(t,e,i)},t.prototype.quadraticCurveTo=function(t,e,i,n){this._context.quadraticCurveTo(t,e,i,n)},t.prototype.restore=function(){this._context.restore()},t.prototype.rotate=function(t){this._context.rotate(t)},t.prototype.save=function(){this._context.save()},t.prototype.scale=function(t,e){this._context.scale(t,e)},t.prototype.setLineDash=function(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)},t.prototype.getLineDash=function(){return this._context.getLineDash()},t.prototype.setTransform=function(t,e,i,n,r,a){this._context.setTransform(t,e,i,n,r,a)},t.prototype.stroke=function(){this._context.stroke()},t.prototype.strokeText=function(t,e,i,n){this._context.strokeText(t,e,i,n)},t.prototype.transform=function(t,e,i,n,r,a){this._context.transform(t,e,i,n,r,a)},t.prototype.translate=function(t,e){this._context.translate(t,e)},t.prototype._enableTrace=function(){var t,e,i=this,n=P.length,r=m._simplifyArray,a=this.setAttr,o=function(t){var n,a=i[t];i[t]=function(){return e=r(Array.prototype.slice.call(arguments,0)),n=a.apply(i,arguments),i._trace({method:t,args:e}),n}};for(t=0;t<n;t++)o(P[t]);i.setAttr=function(){a.apply(i,arguments);var t=arguments[0],e=arguments[1];"shadowOffsetX"!==t&&"shadowOffsetY"!==t&&"shadowBlur"!==t||(e/=this.canvas.getPixelRatio()),i._trace({property:t,val:e})}},t.prototype._applyGlobalCompositeOperation=function(t){var e=t.getGlobalCompositeOperation();"source-over"!==e&&this.setAttr("globalCompositeOperation",e)},t}();["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"].forEach((function(t){Object.defineProperty(C.prototype,t,{get:function(){return this._context[t]},set:function(e){this._context[t]=e}})}));var L,R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._fillColor=function(t){var e=t.fill();this.setAttr("fillStyle",e),t._fillFunc(this)},e.prototype._fillPattern=function(t){var e=t.getFillPatternX(),i=t.getFillPatternY(),n=a.getAngle(t.getFillPatternRotation()),r=t.getFillPatternOffsetX(),o=t.getFillPatternOffsetY();t.getFillPatternScaleX(),t.getFillPatternScaleY(),(e||i)&&this.translate(e||0,i||0),n&&this.rotate(n),(r||o)&&this.translate(-1*r,-1*o),this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)},e.prototype._fillLinearGradient=function(t){var e=t._getLinearGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))},e.prototype._fillRadialGradient=function(t){var e=t._getRadialGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))},e.prototype._fill=function(t){var e=t.fill(),i=t.getFillPriority();if(e&&"color"===i)this._fillColor(t);else{var n=t.getFillPatternImage();if(n&&"pattern"===i)this._fillPattern(t);else{var r=t.getFillLinearGradientColorStops();if(r&&"linear-gradient"===i)this._fillLinearGradient(t);else{var a=t.getFillRadialGradientColorStops();a&&"radial-gradient"===i?this._fillRadialGradient(t):e?this._fillColor(t):n?this._fillPattern(t):r?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}}}},e.prototype._strokeLinearGradient=function(t){var e=t.getStrokeLinearGradientStartPoint(),i=t.getStrokeLinearGradientEndPoint(),n=t.getStrokeLinearGradientColorStops(),r=this.createLinearGradient(e.x,e.y,i.x,i.y);if(n){for(var a=0;a<n.length;a+=2)r.addColorStop(n[a],n[a+1]);this.setAttr("strokeStyle",r)}},e.prototype._stroke=function(t){var e=t.dash(),i=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!i){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),i||this.restore(
12)}},e.prototype._applyShadow=function(t){var e=m,i=e.get(t.getShadowRGBA(),"black"),n=e.get(t.getShadowBlur(),5),r=e.get(t.getShadowOffset(),{x:0,y:0}),a=t.getAbsoluteScale(),o=this.canvas.getPixelRatio(),s=a.x*o,h=a.y*o;this.setAttr("shadowColor",i),this.setAttr("shadowBlur",n*Math.min(Math.abs(s),Math.abs(h))),this.setAttr("shadowOffsetX",r.x*s),this.setAttr("shadowOffsetY",r.y*h)},e}(C),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._fill=function(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()},e.prototype.strokeShape=function(t){t.hasHitStroke()&&this._stroke(t)},e.prototype._stroke=function(t){if(t.hasHitStroke()){var e=t.getStrokeScaleEnabled();if(!e){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),r="auto"===n?t.strokeWidth():n;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),e||this.restore()}},e}(C),O=function(){function t(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var e=(t||{}).pixelRatio||a.pixelRatio||function(){if(L)return L;var t=m.createCanvasElement().getContext("2d");return L=(a._global.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}();this.pixelRatio=e,this._canvas=m.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}return t.prototype.getContext=function(){return this.context},t.prototype.getPixelRatio=function(){return this.pixelRatio},t.prototype.setPixelRatio=function(t){var e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)},t.prototype.setWidth=function(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var e=this.pixelRatio;this.getContext()._context.scale(e,e)},t.prototype.setHeight=function(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var e=this.pixelRatio;this.getContext()._context.scale(e,e)},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.setSize=function(t,e){this.setWidth(t||0),this.setHeight(e||0)},t.prototype.toDataURL=function(t,e){try{return this._canvas.toDataURL(t,e)}catch(t){try{return this._canvas.toDataURL()}catch(t){return m.error("Unable to get data URL. "+t.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}},t}();S.addGetterSetter(O,"pixelRatio",void 0,y());var D=function(t){function e(e){void 0===e&&(e={width:0,height:0});var i=t.call(this,e)||this;return i.context=new R(i),i.setSize(e.width,e.height),i}return E(e,t),e}(O),N=function(t){function e(e){void 0===e&&(e={width:0,height:0});var i=t.call(this,e)||this;return i.hitCanvas=!0,i.context=new I(i),i.setSize(e.width,e.height),i}return E(e,t),e}(O),k={get isDragging(){var t=!1;return k._dragElements.forEach((function(e){"dragging"===e.dragStatus&&(t=!0)})),t},justDragged:!1,get node(){var t;return k._dragElements.forEach((function(e){t=e.node})),t},_dragElements:new Map,_drag:function(t){var e=[];k._dragElements.forEach((function(i,n){var r=i.node,a=r.getStage();a.setPointersPositions(t),void 0===i.pointerId&&(i.pointerId=m._getFirstPointerId(t));var o=a._changedPointerPositions.find((function(t){return t.id===i.pointerId}));if(o){if("dragging"!==i.dragStatus){var s=r.dragDistance();if(Math.max(Math.abs(o.x-i.startPointerPos.x),Math.abs(o.y-i.startPointerPos.y))<s)return;if(r.startDrag({evt:t}),!r.isDragging())return}r._setDragPosition(t,i),e.push(r)}})),e.forEach((function(e){e.fire("dragmove",{type:"dragmove",target:e,evt:t},!0)}))},_endDragBefore:function(t){k._dragElements.forEach((function(e,i){var n=e.node.getStage();if(t&&n.setPointersPositions(t),n._changedPointerPositions.find((function(t){return t.id===e.pointerId}))){"dragging"!==e.dragStatus&&"stopped"!==e.dragStatus||(k.justDragged=!0,a.listenClickTap=!1,e.dragStatus="stopped");var r=e.node.getLayer()||e.node instanceof a.Stage&&e.node;r&&r.batchDraw()}}))}
12,_endDragAfter:function(t){k._dragElements.forEach((function(e,i){"stopped"===e.dragStatus&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),"dragging"!==e.dragStatus&&k._dragElements.delete(i)}))}};a.isBrowser&&(window.addEventListener("mouseup",k._endDragBefore,!0),window.addEventListener("touchend",k._endDragBefore,!0),window.addEventListener("mousemove",k._drag),window.addEventListener("touchmove",k._drag),window.addEventListener("mouseup",k._endDragAfter,!1),window.addEventListener("touchend",k._endDragAfter,!1));var F={},G={},z=function(t,e){t&&F[t]===e&&delete F[t]},U=function(t,e){e&&(G[e]||(G[e]=[]),G[e].push(t))},B=function(t,e){if(t){var i=G[t];if(i){for(var n=0;n<i.length;n++)i[n]._id===e&&i.splice(n,1);0===i.length&&delete G[t]}}},H=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(" "),j=new h,V=1,W=function(){function t(t){this._id=V++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this.children=j,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}return t.prototype.hasChildren=function(){return!1},t.prototype.getChildren=function(){return j},t.prototype._clearCache=function(t){"transform"!==t&&"absoluteTransform"!==t||!this._cache.get(t)?t?this._cache.delete(t):this._cache.clear():this._cache.get(t).dirty=!0},t.prototype._getCache=function(t,e){var i=this._cache.get(t);return(void 0===i||("transform"===t||"absoluteTransform"===t)&&!0===i.dirty)&&(i=e.call(this),this._cache.set(t,i)),i},t.prototype._calculate=function(t,e,i){var n=this;if(!this._attachedDepsListeners.get(t)){var r=e.map((function(t){return t+"Change.konva"})).join(" ");this.on(r,(function(){n._clearCache(t)})),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)},t.prototype._getCanvasCache=function(){return this._cache.get("canvas")},t.prototype._clearSelfAndDescendantCache=function(t,e){this._clearCache(t),e&&"absoluteTransform"===t&&this.fire("_clearTransformCache"),this.isCached()||this.children&&this.children.each((function(e){e._clearSelfAndDescendantCache(t,!0)}))},t.prototype.clearCache=function(){return this._cache.delete("canvas"),this._clearSelfAndDescendantCache(),this},t.prototype.cache=function(t){var e=t||{},i={};void 0!==e.x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height||(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var n=Math.ceil(e.width||i.width),r=Math.ceil(e.height||i.height),a=e.pixelRatio,o=void 0===e.x?i.x:e.x,s=void 0===e.y?i.y:e.y,h=e.offset||0,c=e.drawBorder||!1;if(n&&r){o-=h,s-=h;var l=new D({pixelRatio:a,width:n+=2*h,height:r+=2*h}),u=new D({pixelRatio:a,width:0,height:0}),d=new N({pixelRatio:1,width:n,height:r}),p=l.getContext(),f=d.getContext();return d.isCache=!0,l.isCache=!0,this._cache.delete("canvas"),this._filterUpToDate=!1,!1===e.imageSmoothingEnabled&&(l.getContext()._context.imageSmoothingEnabled=!1,u.getContext()._context.imageSmoothingEnabled=!1),p.save(),f.save(),p.translate(-o,-s),f.translate(-o,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache("absoluteOpacity"),this._clearSelfAndDescendantCache("absoluteScale"),this.drawScene(l,this),this.drawHit(d,this),this._isUnderCache=!1,p.restore(
12),f.restore(),c&&(p.save(),p.beginPath(),p.rect(0,0,n,r),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set("canvas",{scene:l,filter:u,hit:d,x:o,y:s}),this}m.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")},t.prototype.isCached=function(){return this._cache.has("canvas")},t.prototype.getClientRect=function(t){throw new Error('abstract "getClientRect" method call')},t.prototype._transformedRect=function(t,e){var i,n,r,a,o=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=this.getAbsoluteTransform(e);return o.forEach((function(t){var e=s.point(t);void 0===i&&(i=r=e.x,n=a=e.y),i=Math.min(i,e.x),n=Math.min(n,e.y),r=Math.max(r,e.x),a=Math.max(a,e.y)})),{x:i,y:n,width:r-i,height:a-n}},t.prototype._drawCachedSceneCanvas=function(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);var e=this._getCanvasCache();t.translate(e.x,e.y);var i=this._getCachedSceneCanvas(),n=i.pixelRatio;t.drawImage(i._canvas,0,0,i.width/n,i.height/n),t.restore()},t.prototype._drawCachedHitCanvas=function(t){var e=this._getCanvasCache(),i=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(i._canvas,0,0),t.restore()},t.prototype._getCachedSceneCanvas=function(){var t,e,i,n,r=this.filters(),a=this._getCanvasCache(),o=a.scene,s=a.filter,h=s.getContext();if(r){if(!this._filterUpToDate){var c=o.pixelRatio;s.setSize(o.width/o.pixelRatio,o.height/o.pixelRatio);try{for(t=r.length,h.clear(),h.drawImage(o._canvas,0,0,o.getWidth()/c,o.getHeight()/c),e=h.getImageData(0,0,s.getWidth(),s.getHeight()),i=0;i<t;i++)"function"==typeof(n=r[i])?(n.call(this,e),h.putImageData(e,0,0)):m.error("Filter should be type of function, but got "+typeof n+" instead. Please check correct filters")}catch(t){m.error("Unable to apply filter. "+t.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return s}return o},t.prototype.on=function(t,e){if(this._cache&&this._cache.delete("allEventListeners"),3===arguments.length)return this._delegate.apply(this,arguments);var i,n,r,a,o=t.split(" "),s=o.length;for(i=0;i<s;i++)r=(n=o[i].split("."))[0],a=n[1]||"",this.eventListeners[r]||(this.eventListeners[r]=[]),this.eventListeners[r].push({name:a,handler:e});return this},t.prototype.off=function(t,e){var i,n,r,a,o,s=(t||"").split(" "),h=s.length;if(this._cache&&this._cache.delete("allEventListeners"),!t)for(n in this.eventListeners)this._off(n);for(i=0;i<h;i++)if(a=(r=s[i].split("."))[0],o=r[1],a)this.eventListeners[a]&&this._off(a,o,e);else for(n in this.eventListeners)this._off(n,o,e);return this},t.prototype.dispatchEvent=function(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this},t.prototype.addEventListener=function(t,e){return this.on(t,(function(t){e.call(this,t.evt)})),this},t.prototype.removeEventListener=function(t){return this.off(t),this},t.prototype._delegate=function(t,e,i){var n=this;this.on(t,(function(t){for(var r=t.target.findAncestors(e,!0,n),a=0;a<r.length;a++)(t=m.cloneObject(t)).currentTarget=r[a],i.call(r[a],t)}))},t.prototype.remove=function(){return this.isDragging()&&this.stopDrag(
12),k._dragElements.delete(this._id),this._remove(),this},t.prototype._clearCaches=function(){this._clearSelfAndDescendantCache("absoluteTransform"),this._clearSelfAndDescendantCache("absoluteOpacity"),this._clearSelfAndDescendantCache("absoluteScale"),this._clearSelfAndDescendantCache("stage"),this._clearSelfAndDescendantCache("visible"),this._clearSelfAndDescendantCache("listening")},t.prototype._remove=function(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)},t.prototype.destroy=function(){z(this.id(),this);for(var t=(this.name()||"").split(/\s/g),e=0;e<t.length;e++){var i=t[e];B(i,this._id)}return this.remove(),this},t.prototype.getAttr=function(t){var e="get"+m._capitalize(t);return m._isFunction(this[e])?this[e]():this.attrs[t]},t.prototype.getAncestors=function(){for(var t=this.getParent(),e=new h;t;)e.push(t),t=t.getParent();return e},t.prototype.getAttrs=function(){return this.attrs||{}},t.prototype.setAttrs=function(t){var e=this;return this._batchTransformChanges((function(){var i,n;if(!t)return e;for(i in t)"children"!==i&&(n="set"+m._capitalize(i),m._isFunction(e[n])?e[n](t[i]):e._setAttr(i,t[i]))})),this},t.prototype.isListening=function(){return this._getCache("listening",this._isListening)},t.prototype._isListening=function(t){if(!this.listening())return!1;var e=this.getParent();return!e||e===t||this===t||e._isListening(t)},t.prototype.isVisible=function(){return this._getCache("visible",this._isVisible)},t.prototype._isVisible=function(t){if(!this.visible())return!1;var e=this.getParent();return!e||e===t||this===t||e._isVisible(t)},t.prototype.shouldDrawHit=function(t){if(t)return this._isVisible(t)&&this._isListening(t);var e=this.getLayer(),i=!1;k._dragElements.forEach((function(t){"dragging"===t.dragStatus&&("Stage"===t.node.nodeType||t.node.getLayer()===e)&&(i=!0)}));var n=!a.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!n},t.prototype.show=function(){return this.visible(!0),this},t.prototype.hide=function(){return this.visible(!1),this},t.prototype.getZIndex=function(){return this.index||0},t.prototype.getAbsoluteZIndex=function(){var t,e,i,n,r=this.getDepth(),a=this,o=0;return"Stage"!==a.nodeType&&function s(h){for(t=[],e=h.length,i=0;i<e;i++)n=h[i],o++,"Shape"!==n.nodeType&&(t=t.concat(n.getChildren().toArray())),n._id===a._id&&(i=e);t.length>0&&t[0].getDepth()<=r&&s(t)}(a.getStage().getChildren()),o},t.prototype.getDepth=function(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t},t.prototype._batchTransformChanges=function(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform",!0)),this._needClearTransformCache=!1},t.prototype.setPosition=function(t){var e=this;return this._batchTransformChanges((function(){e.x(t.x),e.y(t.y)})),this},t.prototype.getPosition=function(){return{x:this.x(),y:this.y()}},t.prototype.getAbsolutePosition=function(t){for(var e=!1,i=this.parent;i;){if(i.isCached()){e=!0;break}i=i.parent}e&&!t&&(t=!0);var n=this.getAbsoluteTransform(t).getMatrix(),r=new c,a=this.offset();return r.m=n.slice(),r.translate(a.x,a.y),r.getTranslation()},t.prototype.setAbsolutePosition=function(t){var e=this._clearTransform();this.attrs.x=e.x,this.attrs.y=e.y,delete e.x,delete e.y,this._clearCache("transform");var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(t.x,t.y),t={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(e),this.setPosition({x:t.x,y:t.y}),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform"),this},t.prototype._setTransform=function(t){var e;for(e in t)this.attrs[e]=t[e]},t.prototype._clearTransform=function(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t},t.prototype.move=function(t){var e=t.x,i=t.y,n=this.x(),r=this.y();return void 0!==e&&(n+=e),void 0!==i&&(r+=i),this.setPosition({x:n,y:r}),this},t.prototype._eachAncestorReverse=function(t,e){var i,n,r=[],a=this.getParent();if(!e||e._id!==this._id){for(r.unshift(this);a&&(!e||a._id!==e._id);)r.unshift(a),a=a.parent;for(i=r.length,n=0;n<i;n++)t(r[n])}},t.prototype.rotate=function(t){return this.rotation(this.rotation()+t),this},t.prototype.moveToTop=function(){if(!this.parent)return m.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index;return this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0},t.prototype.moveUp=function(){if(!this.parent)return m.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index;return t<this.parent.getChildren().length-1&&(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0)},t.prototype.moveDown=function(){if(!this.parent)return m.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0)},t.prototype.moveToBottom=function(){if(!this.parent)return m.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)},t.prototype.setZIndex=function(t){if(!this.parent)return m.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>
12=this.parent.children.length)&&m.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this},t.prototype.getAbsoluteOpacity=function(){return this._getCache("absoluteOpacity",this._getAbsoluteOpacity)},t.prototype._getAbsoluteOpacity=function(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t},t.prototype.moveTo=function(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this},t.prototype.toObject=function(){var t,e,i,n,r={},a=this.getAttrs();for(t in r.attrs={},a)e=a[t],m.isObject(e)&&!m._isPlainObject(e)&&!m._isArray(e)||(i="function"==typeof this[t]&&this[t],delete a[t],n=i?i.call(this):null,a[t]=e,n!==e&&(r.attrs[t]=e));return r.className=this.getClassName(),m._prepareToStringify(r)},t.prototype.toJSON=function(){return JSON.stringify(this.toObject())},t.prototype.getParent=function(){return this.parent},t.prototype.findAncestors=function(t,e,i){var n=[];e&&this._isMatch(t)&&n.push(this);for(var r=this.parent;r;){if(r===i)return n;r._isMatch(t)&&n.push(r),r=r.parent}return n},t.prototype.isAncestorOf=function(t){return!1},t.prototype.findAncestor=function(t,e,i){return this.findAncestors(t,e,i)[0]},t.prototype._isMatch=function(t){if(!t)return!1;if("function"==typeof t)return t(this);var e,i,n=t.replace(/ /g,"").split(","),r=n.length;for(e=0;e<r;e++)if(i=n[e],m.isValidSelector(i)||(m.warn('Selector "'+i+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),m.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),m.warn("Konva is awesome, right?")),"#"===i.charAt(0)){if(this.id()===i.slice(1))return!0}else if("."===i.charAt(0)){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1},t.prototype.getLayer=function(){var t=this.getParent();return t?t.getLayer():null},t.prototype.getStage=function(){return this._getCache("stage",this._getStage)},t.prototype._getStage=function(){var t=this.getParent();return t?t.getStage():void 0},t.prototype.fire=function(t,e,i){return void 0===e&&(e={}),e.target=e.target||this,i?this._fireAndBubble(t,e):this._fire(t,e),this},t.prototype.getAbsoluteTransform=function(t){return t?this._getAbsoluteTransform(t):this._getCache("absoluteTransform",this._getAbsoluteTransform)},t.prototype._getAbsoluteTransform=function(t){var e;if(t)return e=new c,this._eachAncestorReverse((function(t){var i=t.transformsEnabled();"all"===i?e.multiply(t.getTransform()):"position"===i&&e.translate(t.x()-t.offsetX(),t.y()-t.offsetY())}),t),e;e=this._cache.get("absoluteTransform")||new c,this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset();var i=this.transformsEnabled();if("all"===i)e.multiply(this.getTransform());else if("position"===i){var n=this.attrs.x||0,r=this.attrs.y||0,a=this.attrs.offsetX||0,o=this.attrs.offsetY||0;e.translate(n-a,r-o)}return e.dirty=!1,e},t.prototype.getAbsoluteScale=function(t){for(var e=this;e;)e._isUnderCache&&(t=e),e=e.getParent();var i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}},t.prototype.getAbsoluteRotation=function(){return this.getAbsoluteTransform().decompose().rotation},t.prototype.getTransform=function(){return this._getCache("transform",this._getTransform)},t.prototype._getTransform=function(){var t,e,i=this._cache.get("transform")||new c;i.reset();var n=this.x(),r=this.y(),o=a.getAngle(this.rotation()),s=null!==(t=this.attrs.scaleX)&&void 0!==t?t:1,h=null!==(e=this.attrs.scaleY)&&void 0!==e?e:1,l=this.attrs.skewX||0,u=this.attrs.skewY||0,d=this.attrs.offsetX||0,p=this.attrs.offsetY||0;return 0===n&&0===r||i.translate(n,r),0!==o&&i.rotate(o),0===l&&0===u||i.skew(l,u),1===s&&1===h||i.scale(s,h),0===d&&0===p||i.translate(-1*d,-1*p),i.dirty=!1,i},t.prototype.clone=function(t){var e,i,n,r,a,o=m.cloneObject(this.attrs);for(e in t)o[e]=t[e];var s=new this.constructor(o);for(e in this.eventListeners)for(n=(i=this.eventListeners[e]).length,r=0;r<n;r++)(a=i[r]).name.indexOf("konva")<0&&(s.eventListeners[e]||(s.eventListeners[e]=[]),s.eventListeners[e].push(a));return s},t.prototype._toKonvaCanvas=function(t){t=t||{};var e=this.getClientRect(),i=this.getStage(),n=void 0!==t.x?t.x:e.x,r=void 0!==t.y?t.y:e.y,a=t.pixelRatio||1,o=new D({width:t.width||e.width||(i?i.width():0),height:t.height||e.height||(i?i.height():0),pixelRatio:a}),s=o.getContext();return s.save(),(n||r)&&s.translate(-1*n,-1*r),this.drawScene(o),s.restore(
12),o},t.prototype.toCanvas=function(t){return this._toKonvaCanvas(t)._canvas},t.prototype.toDataURL=function(t){var e=(t=t||{}).mimeType||null,i=t.quality||null,n=this._toKonvaCanvas(t).toDataURL(e,i);return t.callback&&t.callback(n),n},t.prototype.toImage=function(t){if(!t||!t.callback)throw"callback required for toImage method config argument";var e=t.callback;delete t.callback,m._urlToImage(this.toDataURL(t),(function(t){e(t)}))},t.prototype.setSize=function(t){return this.width(t.width),this.height(t.height),this},t.prototype.getSize=function(){return{width:this.width(),height:this.height()}},t.prototype.getClassName=function(){return this.className||this.nodeType},t.prototype.getType=function(){return this.nodeType},t.prototype.getDragDistance=function(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():a.dragDistance},t.prototype._off=function(t,e,i){var n,r,a,o=this.eventListeners[t];for(n=0;n<o.length;n++)if(r=o[n].name,a=o[n].handler,!("konva"===r&&"konva"!==e||e&&r!==e||i&&i!==a)){if(o.splice(n,1),0===o.length){delete this.eventListeners[t];break}n--}},t.prototype._fireChangeEvent=function(t,e,i){this._fire(t+"Change",{oldVal:e,newVal:i})},t.prototype.setId=function(t){var e=this.id();return z(e,this),function(t,e){e&&(F[e]=t)}(this,t),this._setAttr("id",t),this},t.prototype.setName=function(t){var e,i,n=(this.name()||"").split(/\s/g),r=(t||"").split(/\s/g);for(i=0;i<n.length;i++)e=n[i],-1===r.indexOf(e)&&e&&B(e,this._id);for(i=0;i<r.length;i++)e=r[i],-1===n.indexOf(e)&&e&&U(this,e);return this._setAttr("name",t),this},t.prototype.addName=function(t){if(!this.hasName(t)){var e=this.name(),i=e?e+" "+t:t;this.setName(i)}return this},t.prototype.hasName=function(t){if(!t)return!1;var e=this.name();return!!e&&-1!==(e||"").split(/\s/g).indexOf(t)},t.prototype.removeName=function(t){var e=(this.name()||"").split(/\s/g),i=e.indexOf(t);return-1!==i&&(e.splice(i,1),this.setName(e.join(" "))),this},t.prototype.setAttr=function(t,e){var i=this["set"+m._capitalize(t)];return m._isFunction(i)?i.call(this,e):this._setAttr(t,e),this},t.prototype._setAttr=function(t,e,i){var n=this.attrs[t];(n!==e||m.isObject(e))&&(null==e?delete this.attrs[t]:this.attrs[t]=e,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,e))},t.prototype._setComponentAttr=function(t,e,i){var n;void 0!==i&&((n=this.attrs[t])||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=i,this._fireChangeEvent(t,n,i))},t.prototype._fireAndBubble=function(t,e,i){if(e&&"Shape"===this.nodeType&&(e.target=this),"mouseenter"!==t&&"mouseleave"!==t||!(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||"Stage"===this.nodeType&&!i)){this._fire(t,e);var n=("mouseenter"===t||"mouseleave"===t)&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!n&&(i&&i.parent?this._fireAndBubble.call(this.parent,t,e,i):this._fireAndBubble.call(this.parent,t,e))}},t.prototype._getProtoListeners=function(t){var e=this._cache.get("allEventListeners");if(!e){e={};for(var i=Object.getPrototypeOf(this);i;)if(i.eventListeners){for(var n in i.eventListeners){var r=i.eventListeners[n],a=e[n]||[];e[n]=r.concat(a)}i=Object.getPrototypeOf(i)}else i=Object.getPrototypeOf(i);this._cache.set("allEventListeners",e)}return e[t]},t.prototype._fire=function(t,e){(e=e||{}).currentTarget=this,e.type=t;var i=this._getProtoListeners(t);if(i)for(var n=0;n<i.length;n++)i[n].handler.call(this,e);var r=this.eventListeners[t];if(r)for(n=0;n<r.length;n++)r[n].handler.call(this,e)},t.prototype.draw=function(){return this.drawScene(),this.drawHit(),this},t.prototype._createDragElement=function(t){var e=t?t.pointerId:void 0,i=this.getStage(),n=this.getAbsolutePosition(),r=i._getPointerById(e)||i._changedPointerPositions[0]||n;k._dragElements.set(this._id,{node:this,startPointerPos:r,offset:{x:r.x-n.x,y:r.y-n.y},dragStatus:"ready",pointerId:e})},t.prototype.startDrag=function(t,e){void 0===e&&(e=!0),k._dragElements.has(this._id)||this._createDragElement(t),k._dragElements.get(this._id).dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},e)},t.prototype._setDragPosition=function(t,e){var i=this.getStage()._getPointerById(e.pointerId);if(i){var n={x:i.x-e.offset.x,y:i.y-e.offset.y},r=this.dragBoundFunc();if(void 0!==r){var a=r.call(this,n,t);a?n=a:m.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===n.x&&this._lastPos.y===n.y||(this.setAbsolutePosition(n),this.getLayer()?this.getLayer().batchDraw():this.getStage()&&this.get
12Stage().batchDraw()),this._lastPos=n}},t.prototype.stopDrag=function(t){var e=k._dragElements.get(this._id);e&&(e.dragStatus="stopped"),k._endDragBefore(t),k._endDragAfter(t)},t.prototype.setDraggable=function(t){this._setAttr("draggable",t),this._dragChange()},t.prototype.isDragging=function(){var t=k._dragElements.get(this._id);return!!t&&"dragging"===t.dragStatus},t.prototype._listenDrag=function(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",(function(t){var e=this;if((void 0===t.evt.button||a.dragButtons.indexOf(t.evt.button)>=0)&&!this.isDragging()){var i=!1;k._dragElements.forEach((function(t){e.isAncestorOf(t.node)&&(i=!0)})),i||this._createDragElement(t)}}))},t.prototype._dragChange=function(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;var t=k._dragElements.get(this._id),e=t&&"dragging"===t.dragStatus,i=t&&"ready"===t.dragStatus;e?this.stopDrag():i&&k._dragElements.delete(this._id)}},t.prototype._dragCleanup=function(){this.off("mousedown.konva"),this.off("touchstart.konva")},t.create=function(t,e){return m._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)},t._createNode=function(e,i){var n,r,a,s=t.prototype.getClassName.call(e),h=e.children;if(i&&(e.attrs.container=i),o[s]||(m.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape"),n=new(0,o[s])(e.attrs),h)for(r=h.length,a=0;a<r;a++)n.add(t._createNode(h[a]));return n},t}();W.prototype.nodeType="Node",W.prototype._attrsAffectingSize=[],W.prototype.eventListeners={},W.prototype.on.call(W.prototype,H,(function(){this._batchingTransformChange?this._needClearTransformCache=!0:(this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform"))})),W.prototype.on.call(W.prototype,"visibleChange.konva",(function(){this._clearSelfAndDescendantCache("visible")})),W.prototype.on.call(W.prototype,"listeningChange.konva",(function(){this._clearSelfAndDescendantCache("listening")})),W.prototype.on.call(W.prototype,"opacityChange.konva",(function(){this._clearSelfAndDescendantCache("absoluteOpacity")}));var X=S.addGetterSetter;X(W,"zIndex"),X(W,"absolutePosition"),X(W,"position"),X(W,"x",0,y()),X(W,"y",0,y()),X(W,"globalCompositeOperation","source-over",_()),X(W,"opacity",1,y()),X(W,"name","",_()),X(W,"id","",_()),X(W,"rotation",0,y()),S.addComponentsGetterSetter(W,"scale",["x","y"]),X(W,"scaleX",1,y()),X(W,"scaleY",1,y()),S.addComponentsGetterSetter(W,"skew",["x","y"]),X(W,"skewX",0,y()),X(W,"skewY",0,y()),S.addComponentsGetterSetter(W,"offset",["x","y"]),X(W,"offsetX",0,y()),X(W,"offsetY",0,y()),X(W,"dragDistance",null,y()),X(W,"width",0,y()),X(W,"height",0,y()),X(W,"listening",!0,M()),X(W,"preventDefault",!0,M()),X(W,"filters",null,(function(t){return this._filterUpToDate=!1,t})),X(W,"visible",!0,M()),X(W,"transformsEnabled","all",_()),X(W,"size"),X(W,"dragBoundFunc"),X(W,"draggable",!1,M()),S.backCompat(W,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),h.mapMethods(W);var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=new h,e}return E(e,t),e.prototype.getChildren=function(t){if(!t)return this.children;var e=new h;return this.children.each((function(i){t(i)&&e.push(i)})),e},e.prototype.hasChildren=function(){return this.getChildren().length>0},e.prototype.removeChildren=function(){for(var t,e=0;e<this.children.length;e++)(t=this.children[e]).parent=null,t.index=0,t.remove();return this.children=new h,this},e.prototype.destroyChildren=function(){for(var t,e=0;e<this.children.length;e++)(t=this.children[e]).parent=null,t.index=0,t.destroy();return this.children=new h,this},e.prototype.add=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(arguments.length>1){for(var i=0;i<arguments.length;i++)this.add(arguments[i]);return this}var n=t[0];if(n.getParent())return n.moveTo(this),this;var r=this.children;return this._validateAdd(n),n._clearCaches(),n.index=r.length,n.parent=this,r.push(n),this._fire("add",{child:n}),this},e.prototype.destroy=function(){return this.hasChildren()&&this.destroyChildren(),t.prototype.destroy.call(this),this},e.prototype.find=function(t){return this._generalFind(t,!1)},e.prototype.get=function(t){return m.warn("collection.get() method is deprecated. Please use collection.find() instead."),this.find(t)},e.prototype.findOne=function(t){var e=this._generalFind(t,!0);return e.length>0?e[0]:void 0},e.prototype._generalFind=function(t,e){var i=[];return this._descendants((function(n){var r=n._isMatch(t);return r&&i.push(n),!(!r||!e)})),h.toCollection(i)},e.prototype._descendants=function(t){for(var e=0;e<this.children.length;e++){var i=this.children[e];if(t(i))return!0;
12if(i.hasChildren()&&i._descendants(t))return!0}return!1},e.prototype.toObject=function(){var t=W.prototype.toObject.call(this);t.children=[];for(var e=this.getChildren(),i=e.length,n=0;n<i;n++){var r=e[n];t.children.push(r.toObject())}return t},e.prototype.isAncestorOf=function(t){for(var e=t.getParent();e;){if(e._id===this._id)return!0;e=e.getParent()}return!1},e.prototype.clone=function(t){var e=W.prototype.clone.call(this,t);return this.getChildren().each((function(t){e.add(t.clone())})),e},e.prototype.getAllIntersections=function(t){var e=[];return this.find("Shape").each((function(i){i.isVisible()&&i.intersects(t)&&e.push(i)})),e},e.prototype._setChildrenIndices=function(){this.children.each((function(t,e){t.index=e}))},e.prototype.drawScene=function(t,e){var i=this.getLayer(),n=t||i&&i.getCanvas(),r=n&&n.getContext(),a=this._getCanvasCache(),o=a&&a.scene,s=n&&n.isCache;if(!this.isVisible()&&!s)return this;if(o){r.save();var h=this.getAbsoluteTransform(e).getMatrix();r.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(r),r.restore()}else this._drawChildren("drawScene",n,e);return this},e.prototype.drawHit=function(t,e){if(!this.shouldDrawHit(e))return this;var i=this.getLayer(),n=t||i&&i.hitCanvas,r=n&&n.getContext(),a=this._getCanvasCache();if(a&&a.hit){r.save();var o=this.getAbsoluteTransform(e).getMatrix();r.transform(o[0],o[1],o[2],o[3],o[4],o[5]),this._drawCachedHitCanvas(r),r.restore()}else this._drawChildren("drawHit",n,e);return this},e.prototype._drawChildren=function(t,e,i){var n=e&&e.getContext(),r=this.clipWidth(),a=this.clipHeight(),o=this.clipFunc(),s=r&&a||o,h=i===this;if(s){n.save();var c=this.getAbsoluteTransform(i),l=c.getMatrix();if(n.transform(l[0],l[1],l[2],l[3],l[4],l[5]),n.beginPath(),o)o.call(this,n,this);else{var u=this.clipX(),d=this.clipY();n.rect(u,d,r,a)}n.clip(),l=c.copy().invert().getMatrix(),n.transform(l[0],l[1],l[2],l[3],l[4],l[5])}var p=!h&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===t;p&&(n.save(),n._applyGlobalCompositeOperation(this)),this.children.each((function(n){n[t](e,i)})),p&&n.restore(),s&&n.restore()},e.prototype.getClientRect=function(t){var e,i,n,r,a=(t=t||{}).skipTransform,o=t.relativeTo,s={x:1/0,y:1/0,width:0,height:0},h=this;this.children.each((function(a){if(a.visible()){var o=a.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});0===o.width&&0===o.height||(void 0===e?(e=o.x,i=o.y,n=o.x+o.width,r=o.y+o.height):(e=Math.min(e,o.x),i=Math.min(i,o.y),n=Math.max(n,o.x+o.width),r=Math.max(r,o.y+o.height)))}}));for(var c=this.find("Shape"),l=!1,u=0;u<c.length;u++)if(c[u]._isVisible(this)){l=!0;break}return s=l&&void 0!==e?{x:e,y:i,width:n-e,height:r-i}:{x:0,y:0,width:0,height:0},a?s:this._transformedRect(s,o)},e}(W);S.addComponentsGetterSetter(Y,"clip",["x","y","width","height"]),S.addGetterSetter(Y,"clipX",void 0,y()),S.addGetterSetter(Y,"clipY",void 0,y()),S.addGetterSetter(Y,"clipWidth",void 0,y()),S.addGetterSetter(Y,"clipHeight",void 0,y()),S.addGetterSetter(Y,"clipFunc"),h.mapMethods(Y);var q=new Map,Z=void 0!==a._global.PointerEvent;function J(t){return q.get(t)}function K(t){return{evt:t,pointerId:t.pointerId}}function Q(t,e){return q.get(t)===e}function $(t,e){tt(t),e.getStage()&&(q.set(t,e),Z&&e._fire("gotpointercapture",K(new PointerEvent("gotpointercapture"))))}function tt(t,e){var i=q.get(t);if(i){var n=i.getStage();n&&n.content,q.delete(t),Z&&i._fire("lostpointercapture",K(new PointerEvent("lostpointercapture")))}}var et=["mouseenter","mousedown","mousemove","mouseup","mouseout","touchstart","touchmove","touchend","mouseover","wheel","contextmenu","pointerdown","pointermove","pointerup","pointercancel","lostpointercapture"],it=et.length;function nt(t,e){t.content.addEventListener(e,(function(i){t["_"+e](i)}),!1)}var rt=[];function at(t){return void 0===t&&(t={}),(t.clipFunc||t.clipWidth||t.clipHeight)&&m.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}var ot,st=function(t){function e(e){var i=t.call(this,at(e))||this;return i._pointerPositions=[],i._changedPointerPositions=[],i._buildDOM(),i._bindContentEvents(),rt.push(i),i.on("widthChange.konva heightChange.konva",i._resizeDOM),i.on("visibleChange.konva",i._checkVisibility),i.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(function(){at(i.attrs)})),i._checkVisibility(),i}return E(e,t),e.prototype._validateAdd=function(t){var e="Layer"===t.getType(),i="FastLayer"===t.getType();e||i||m.throw("You may only add layers to the stage.")},e.prototype._checkVisibility=function(){if(this.content){var t=this.visible()?"":"none";this.content.style.display=t}},e.prototype.setContainer=function(t){if("string"==typeof t){if("."===t.charAt(0)){var e=t.slice(1);t=document.getElementsByClassName(e)[0]}else{var i;i="#"!==t.charAt(0)?t:t.slice(1),t=document.getElementById(i)}if(!t)throw"Can not find container in document with id "+i}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this},e.prototype.shouldDrawHit=function(){return!0},e.prototype.clear=function(){var t,e=this.children,i=e.length;for(t=0;t<i;t++)e[t].clear();return this},e.prototype.clone=function(t){return t||(t={}),t.container=document.createElement("div"),Y.prototype.clone.call(this,t)},e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this.content;e&&m._isInDocument(e)&&this.container().removeChild(e);var i=rt.indexOf(this);return i>-1&&rt.splice(i,1),this},e.prototype.getPointerPosition=function(){var t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(m.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)},e.prototype._getPointerById=function(t){return this._pointerPositions.find((function(e){return e.id===t}))},e.prototype.getPointersPositions=function(){return this._pointerPositions},e.prototype.getStage=function(){return this},e.prototype.getContent=function(){return this.content},e.prototype._toKonvaCanvas=function(t){(t=t||{}).x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var e=new D({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),i=e.getContext()._context,n=this.children;return(t.x||t.y)&&i.translate(-1*t.x,-1*t.y),n.each((function(e){if(e.isVisible()){var n=e._toKonvaCanvas(t);i.drawImage(n._canvas,t.x,t.y,n.getWidth()/n.getPixelRatio(),n.getHeight()/n.getPixelRatio())}})),e},e.prototype.getIntersection=function(t,e){if(!t)return null;var i,n,r=this.children;for(i=r.length-1;i>=0;i--)if(n=r[i].getIntersection(t,e))return n;return null},e.prototype._resizeDOM=function(){var t=this.width(),e=this.height();this.content&&(this.content.style.width=t+"px",this.content.style.height=e+"px"),this.bufferCanvas.setSize(t,e),this.bufferHitCanvas.setSize(t,e),this.children.each((function(i){i.setSize({width:t,height:e}),i.draw()}))},e.prototype.add=function(e){if(arguments.length>1){for(var i=0;i<arguments.length;i++)this.add(arguments[i]);return this}t.prototype.add.call(this,e);var n=this.children.length;return n>5&&m.warn("The stage has "+n+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),a.isBrowser&&this.content.appendChild(e.canvas._canvas),this},e.prototype.getParent=function(){return null},e.prototype.getLayer=function(){return null},e.prototype.hasPointerCapture=function(t){return Q(t,this)},e.prototype.setPointerCapture=function(t){$(t,this)},e.prototype.releaseCapture=function(t){tt(t)},e.prototype.getLayers=function(){return this.getChildren()},e.prototype._bindContentEvents=function(){if(a.isBrowser)for(var t=0;t<it;t++)nt(this,et[t])},e.prototype._mouseenter=function(t){this.setPointersPositions(t),this._fire("mouseenter",{evt:t,target:this,currentTarget:this})},e.prototype._mouseover=function(t){this.setPointersPositions(t),this._fire("contentMouseover",{evt:t}),this._fire("mouseover",{evt:t,target:this,currentTarget:this})},e.prototype._mouseout=function(t){var e;this.setPointersPositions(t);var i=(null===(e=this.targetShape)||void 0===e?void 0:e.getStage())?this.targetShape:null,n=!k.isDragging||a.hitOnDragEnabled;i&&n?(i._fireAndBubble("mouseout",{evt:t}),i._fireAndBubble("mouseleave",{evt:t}),this._fire("mouseleave",{evt:t,target:this,currentTarget:this}),this.targetShape=null):n&&(this._fire("mouseleave",{evt:t,target:this,currentTarget:this}),this._fire("mouseout",{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[],this._fire("contentMouseout",{evt:t})},e.prototype._mousemove=function(t){var e;if(a.UA.ieMobile)return this._touchmove(t);this.setPointersPositions(t);var i,n=m._getFirstPointerId(t),r=(null===(e=this.targetShape)||void 0===e?void 0:e.getStage())?this.targetShape:null,o=!k.isDragging||a.hitOnDragEnabled;o&&((i=this.getIntersection(this.getPointerPosition()))&&i.isListening()?o&&r!==i?(r&&(r._fireAndBubble("mouseout",{evt:t,pointerId:n},i),r._fireAndBubble("mouseleave",{evt:t,pointerId:n},i)),i._fireAndBubble("mouseover",{evt:t,pointerId:n},r),i._fireAndBubble("mouseenter",{evt:t,pointerId:n},r),i._fireAndBubble("mousemove",{evt:t,pointerId:n}),this.targetShape=i):i._fireAndBubble("mousemove",{evt:t,pointerId:n}):(r&&o&&(r._fireAndBubble("mouseout",{evt:t,pointerId:n}),r._fireAndBubble("mouseleave",{evt:t,pointerId:n}),this._fire("mouseover",{evt:t,target:this,currentTarget:this,pointerId:n}),this.targetShape=null),this._fire("mousemove",{evt:t,target:this,currentTarget:this,pointerId:n})),this._fire("contentMousemove",{evt:t})),t.cancelable&&t.preventDefault()},e.prototype._mousedown=function(t){if(a.UA.ieMobile)return this._touchstart(t);this.setPointersPositions(t);var e=m._getFirstPointerId(t),i=this.getIntersection(this.getPointerPosition());k.justDragged=!1,a.listenClickTap=!0,i&&i.isListening()?(this.clickStartShape=i,i._fireAndBubble("mousedown",{evt:t,pointerId:e})):this._fire("mousedown",{evt:t,target:this,currentTarget:this,pointerId:e}),this._fire("contentMousedown",{evt:t})},e.prototype._mouseup=function(t){if(a.UA.ieMobile)return this._touchend(t);this.setPointersPositions(t);var e=m._getFirstPointerId(t),i=this.getIntersection(this.getPointerPosition()),n=this.clickStartShape,r=this.clickEndShape,o=!1;a.inDblClickWindow?(o=!0,clearTimeout(this.dblTimeout)):k.justDragged||(a.inDblClickWindow=!0,clearTimeout(this.dblTimeout)),this.dblTimeout=setTimeout((function(){a.inDblClickWindow=!1}),a.dblClickWindow),i&&i.isListening()?(this.clickEndShape=i,i._fireAndBubble("mouseup",{evt:t,pointerId:e}),a.listenClickTap&&n&&n._id===i._id&&(i._fireAndBubble("click",{evt:t,pointerId:e}),o&&r&&r===i&&i._fireAndBubble("dblclick",{evt:t,pointerId:e}))):(this.clickEndShape=null,this._fire("mouseup",{evt:t,target:this,currentTarget:this,pointerId:e}),a.listenClickTap&&this._fire("click",{evt:t,target:this,currentTarget:this,pointerId:e}),o&&this._fire("dblclick",{evt:t,target:this,currentTarget:this,pointerId:e})),this._fire("contentMouseup",{evt:t}),a.listenClickTap&&(this._fire("contentClick",{evt:t}),o&&this._fire("contentDblclick",{evt:t})),a.listenClickTap=!1,t.cancelable&&t.preventDefault()},e.prototype._contextmenu=function(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble("contextmenu",{evt:t}):this._fire("contextmenu",{evt:t,target:this,currentTarget:this}),this._fire("contentContextmenu",{evt:t})},e.prototype._touchstart=function(t){var e=this;this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach((function(n){var r=e.getIntersection(n);a.listenClickTap=!0,k.justDragged=!1,r&&r.isListening()&&(a.captureTouchEventsEnabled&&r.setPointerCapture(n.id),e.tapStartShape=r,r._fireAndBubble("touchstart",{evt:t,pointerId:n.id},e),i=!0,r.isListening()&&r.preventDefault()&&t.cancelable&&t.preventDefault())})),i||this._fire("touchstart",{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),this._fire("contentTouchstart",{evt:t})},e.prototype._touchmove=function(t){var e=this;if(this.setPointersPositions(t),!k.isDragging||a.hitOnDragEnabled){var i=!1,n={};this._changedPointerPositions.forEach((function(r){var a=J(r.id)||e.getIntersection(r);a&&a.isListening()&&(n[a._id]||(n[a._id]=!0,a._fireAndBubble("touchmove",{evt:t,pointerId:r.id}),i=!0,a.isListening()&&a.preventDefault()&&t.cancelable&&t.preventDefault()))})),i||this._fire("touchmove",{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),this._fire("contentTouchmove",{evt:t})}k.isDragging&&k.node.preventDefault()&&t.cancelable&&t.preventDefault()},e.prototype._touchend=function(t){var e=this;this.setPointersPositions(t);var i=this.tapEndShape,n=!1;a.inDblClickWindow?(n=!0,clearTimeout(this.dblTimeout)):k.justDragged||(a.inDblClickWindow=!0,clearTimeout(this.dblTimeout)),this.dblTimeout=setTimeout((function(){a.inDblClickWindow=!1}),a.dblClickWindow);var r=!1,o={},s=!1,h=!1;this._changedPointerPositions.forEach((function(c){var l=J(c.id)||e.getIntersection(c);
12l&&l.releaseCapture(c.id),l&&l.isListening()&&(o[l._id]||(o[l._id]=!0,e.tapEndShape=l,l._fireAndBubble("touchend",{evt:t,pointerId:c.id}),r=!0,a.listenClickTap&&l===e.tapStartShape&&(s=!0,l._fireAndBubble("tap",{evt:t,pointerId:c.id}),n&&i&&i===l&&(h=!0,l._fireAndBubble("dbltap",{evt:t,pointerId:c.id}))),l.isListening()&&l.preventDefault()&&t.cancelable&&t.preventDefault()))})),r||this._fire("touchend",{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.listenClickTap&&!s&&(this.tapEndShape=null,this._fire("tap",{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})),n&&!h&&this._fire("dbltap",{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),this._fire("contentTouchend",{evt:t}),a.listenClickTap&&(this._fire("contentTap",{evt:t}),n&&this._fire("contentDbltap",{evt:t})),this.preventDefault()&&t.cancelable&&t.preventDefault(),a.listenClickTap=!1},e.prototype._wheel=function(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble("wheel",{evt:t}):this._fire("wheel",{evt:t,target:this,currentTarget:this}),this._fire("contentWheel",{evt:t})},e.prototype._pointerdown=function(t){if(a._pointerEventsEnabled){this.setPointersPositions(t);var e=J(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble("pointerdown",K(t))}},e.prototype._pointermove=function(t){if(a._pointerEventsEnabled){this.setPointersPositions(t);var e=J(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble("pointermove",K(t))}},e.prototype._pointerup=function(t){if(a._pointerEventsEnabled){this.setPointersPositions(t);var e=J(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble("pointerup",K(t)),tt(t.pointerId)}},e.prototype._pointercancel=function(t){if(a._pointerEventsEnabled){this.setPointersPositions(t);var e=J(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble("pointerup",K(t)),tt(t.pointerId)}},e.prototype._lostpointercapture=function(t){tt(t.pointerId)},e.prototype.setPointersPositions=function(t){var e=this,i=this._getContentPosition(),n=null,r=null;void 0!==(t=t||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],h.prototype.each.call(t.touches,(function(t){e._pointerPositions.push({id:t.identifier,x:(t.clientX-i.left)/i.scaleX,y:(t.clientY-i.top)/i.scaleY})})),h.prototype.each.call(t.changedTouches||t.touches,(function(t){e._changedPointerPositions.push({id:t.identifier,x:(t.clientX-i.left)/i.scaleX,y:(t.clientY-i.top)/i.scaleY})}))):(n=(t.clientX-i.left)/i.scaleX,r=(t.clientY-i.top)/i.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:m._getFirstPointerId(t)}],this._changedPointerPositions=[{x:n,y:r,id:m._getFirstPointerId(t)}])},e.prototype._setPointerPosition=function(t){m.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)},e.prototype._getContentPosition=function(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}},e.prototype._buildDOM=function(){if(this.bufferCanvas=new D({width:this.width(),height:this.height()}),this.bufferHitCanvas=new N({pixelRatio:1,width:this.width(),height:this.height()}),a.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}},e.prototype.cache=function(){return m.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this},e.prototype.clearCache=function(){return this},e.prototype.batchDraw=function(){return this.children.each((function(t){t.batchDraw()})),this},e}(Y);function ht(){return ot||(ot=m.createCanvasElement().getContext("2d"))}st.prototype.nodeType="Stage",s(st),S.addGetterSetter(st,"container");var ct={},lt=function(t){function e(e){for(var i,n=t.call(this,e)||this;!(i=m.getRandomColor())||i in ct;);return n.colorKey=i,ct[i]=n,n}return E(e,t),e.prototype.getContext=function(){return this.getLayer().getContext()},e.prototype.getCanvas=function(){return this.getLayer().getCanvas()},e.prototype.getSceneFunc=function(){return this.attrs.sceneFunc||this._sceneFunc},e.prototype.getHitFunc=function(){return this.attrs.hitFunc||this._hitFunc},e.prototype.hasShadow=function(){return this._getCache("hasShadow",this._hasShadow)},e.prototype._hasShadow=function(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())},e.prototype._getFillPattern=function(){return this._getCache("patternImage",this.__getFillPattern)},e.prototype.__getFillPattern=function(){if(this.fillPatternImage()){var t=ht().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");return t&&t.setTransform&&t.setTransform({a:this.fillPatternScaleX(),b:0,c:0,d:this.fillPatternScaleY(),e:0,f:0}),t}},e.prototype._getLinearGradient=function(){return this._getCache("linearGradient",this.__getLinearGradient)},e.prototype.__getLinearGradient=function(){var t=this.fillLinearGradientColorStops();if(t){for(var e=ht(),i=this.fillLinearGradientStartPoint(),n=this.fillLinearGradientEndPoint(),r=e.createLinearGradient(i.x,i.y,n.x,n.y),a=0;a<t.length;
12a+=2)r.addColorStop(t[a],t[a+1]);return r}},e.prototype._getRadialGradient=function(){return this._getCache("radialGradient",this.__getRadialGradient)},e.prototype.__getRadialGradient=function(){var t=this.fillRadialGradientColorStops();if(t){for(var e=ht(),i=this.fillRadialGradientStartPoint(),n=this.fillRadialGradientEndPoint(),r=e.createRadialGradient(i.x,i.y,this.fillRadialGradientStartRadius(),n.x,n.y,this.fillRadialGradientEndRadius()),a=0;a<t.length;a+=2)r.addColorStop(t[a],t[a+1]);return r}},e.prototype.getShadowRGBA=function(){return this._getCache("shadowRGBA",this._getShadowRGBA)},e.prototype._getShadowRGBA=function(){if(this.hasShadow()){var t=m.colorToRGBA(this.shadowColor());return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}},e.prototype.hasFill=function(){var t=this;return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],(function(){return t.fillEnabled()&&!!(t.fill()||t.fillPatternImage()||t.fillLinearGradientColorStops()||t.fillRadialGradientColorStops())}))},e.prototype.hasStroke=function(){var t=this;return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(function(){return t.strokeEnabled()&&t.strokeWidth()&&!(!t.stroke()&&!t.strokeLinearGradientColorStops())}))},e.prototype.hasHitStroke=function(){var t=this.hitStrokeWidth();return"auto"===t?this.hasStroke():this.strokeEnabled()&&!!t},e.prototype.intersects=function(t){var e=this.getStage().bufferHitCanvas;return e.getContext().clear(),this.drawHit(e),e.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0},e.prototype.destroy=function(){return W.prototype.destroy.call(this),delete ct[this.colorKey],delete this.colorKey,this},e.prototype._useBufferCanvas=function(t){var e;if(!this.getStage())return!1;if(null!==(e=this.attrs.perfectDrawEnabled)&&void 0!==e&&!e)return!1;var i=t||this.hasFill(),n=this.hasStroke(),r=1!==this.getAbsoluteOpacity();if(i&&n&&r)return!0;var a=this.hasShadow(),o=this.shadowForStrokeEnabled();return!!(i&&n&&a&&o)},e.prototype.setStrokeHitEnabled=function(t){m.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)},e.prototype.getStrokeHitEnabled=function(){return 0!==this.hitStrokeWidth()},e.prototype.getSelfRect=function(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}},e.prototype.getClientRect=function(t){void 0===t&&(t={});var e=t.skipTransform,i=t.relativeTo,n=this.getSelfRect(),r=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,a=n.width+r,o=n.height+r,s=!t.skipShadow&&this.hasShadow(),h=s?this.shadowOffsetX():0,c=s?this.shadowOffsetY():0,l=a+Math.abs(h),u=o+Math.abs(c),d=s&&this.shadowBlur()||0,p=l+2*d,f=u+2*d,m=0;Math.round(r/2)!==r/2&&(m=1);var g={width:p+m,height:f+m,x:-Math.round(r/2+d)+Math.min(h,0)+n.x,y:-Math.round(r/2+d)+Math.min(c,0)+n.y};return e?g:this._transformedRect(g,i)},e.prototype.drawScene=function(t,e){var i,n,r=this.getLayer(),a=t||r.getCanvas(),o=a.getContext(),s=this._getCanvasCache(),h=this.getSceneFunc(),c=this.hasShadow(),l=a.isCache,u=a.isCache,d=e===this;if(!this.isVisible()&&!l)return this;if(s){o.save();var p=this.getAbsoluteTransform(e).getMatrix();return o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!h)return this;if(o.save(),this._useBufferCanvas()&&!u){(n=(i=this.getStage().bufferCanvas).getContext()).clear(),n.save(),n._applyLineJoin(this);var f=this.getAbsoluteTransform(e).getMatrix();n.transform(f[0],f[1],f[2],f[3],f[4],f[5]),h.call(this,n,this),n.restore();var m=i.pixelRatio;c&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(i._canvas,0,0,i.width/m,i.height/m)}else o._applyLineJoin(this),d||(f=this.getAbsoluteTransform(e).getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)),c&&o._applyShadow(this),h.call(this,o,this);
12return o.restore(),this},e.prototype.drawHit=function(t,e){if(!this.shouldDrawHit(e))return this;var i=this.getLayer(),n=t||i.hitCanvas,r=n&&n.getContext(),a=this.hitFunc()||this.sceneFunc(),o=this._getCanvasCache(),s=o&&o.hit;if(this.colorKey||(console.log(this),m.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. See the shape in logs above. If you want to reuse shape you should call remove() instead of destroy()")),s){r.save();var h=this.getAbsoluteTransform(e).getMatrix();return r.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(r),r.restore(),this}if(!a)return this;if(r.save(),r._applyLineJoin(this),this!==e){var c=this.getAbsoluteTransform(e).getMatrix();r.transform(c[0],c[1],c[2],c[3],c[4],c[5])}return a.call(this,r,this),r.restore(),this},e.prototype.drawHitFromCache=function(t){void 0===t&&(t=0);var e,i,n,r,a,o=this._getCanvasCache(),s=this._getCachedSceneCanvas(),h=o.hit,c=h.getContext(),l=h.getWidth(),u=h.getHeight();c.clear(),c.drawImage(s._canvas,0,0,l,u);try{for(n=(i=(e=c.getImageData(0,0,l,u)).data).length,r=m._hexToRgb(this.colorKey),a=0;a<n;a+=4)i[a+3]>t?(i[a]=r.r,i[a+1]=r.g,i[a+2]=r.b,i[a+3]=255):i[a+3]=0;c.putImageData(e,0,0)}catch(t){m.error("Unable to draw hit graph from cached scene canvas. "+t.message)}return this},e.prototype.hasPointerCapture=function(t){return Q(t,this)},e.prototype.setPointerCapture=function(t){$(t,this)},e.prototype.releaseCapture=function(t){tt(t)},e}(W);lt.prototype._fillFunc=function(t){t.fill()},lt.prototype._strokeFunc=function(t){t.stroke()},lt.prototype._fillFuncHit=function(t){t.fill()},lt.prototype._strokeFuncHit=function(t){t.stroke()},lt.prototype._centroid=!1,lt.prototype.nodeType="Shape",s(lt),lt.prototype.eventListeners={},lt.prototype.on.call(lt.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache("hasShadow")})),lt.prototype.on.call(lt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache("shadowRGBA")})),lt.prototype.on.call(lt.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva",(function(){this._clearCache("patternImage")})),lt.prototype.on.call(lt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache("linearGradient")})),lt.prototype.on.call(lt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache("radialGradient")})),S.addGetterSetter(lt,"stroke",void 0,w()),S.addGetterSetter(lt,"strokeWidth",2,y()),S.addGetterSetter(lt,"fillAfterStrokeEnabled",!1),S.addGetterSetter(lt,"hitStrokeWidth","auto",b()),S.addGetterSetter(lt,"strokeHitEnabled",!0,M()),S.addGetterSetter(lt,"perfectDrawEnabled",!0,M()),S.addGetterSetter(lt,"shadowForStrokeEnabled",!0,M()),S.addGetterSetter(lt,"lineJoin"),S.addGetterSetter(lt,"lineCap"),S.addGetterSetter(lt,"sceneFunc"),S.addGetterSetter(lt,"hitFunc"),S.addGetterSetter(lt,"dash"),S.addGetterSetter(lt,"dashOffset",0,y()),S.addGetterSetter(lt,"shadowColor",void 0,_()),S.addGetterSetter(lt,"shadowBlur",0,y()),S.addGetterSetter(lt,"shadowOpacity",1,y()),S.addComponentsGetterSetter(lt,"shadowOffset",["x","y"]),S.addGetterSetter(lt,"shadowOffsetX",0,y()),S.addGetterSetter(lt,"shadowOffsetY",0,y()),S.addGetterSetter(lt,"fillPatternImage"),S.addGetterSetter(lt,"fill",void 0,w()),S.addGetterSetter(lt,"fillPatternX",0,y()),S.addGetterSetter(lt,"fillPatternY",0,y()),S.addGetterSetter(lt,"fillLinearGradientColorStops"),S.addGetterSetter(lt,"strokeLinearGradientColorStops"),S.addGetterSetter(lt,"fillRadialGradientStartRadius",0),S.addGetterSetter(lt,"fillRadialGradientEndRadius",0),S.addGetterSetter(lt,"fillRadialGradientColorStops"),S.addGetterSetter(lt,"fillPatternRepeat","repeat"),S.addGetterSetter(lt,"fillEnabled",!0),S.addGetterSetter(lt,"strokeEnabled",!0),S.addGetterSetter(lt,"shadowEnabled",!0),S.addGetterSetter(lt,"dashEnabled",!0),S.addGetterSetter(lt,"strokeScaleEnabled",!0),S.addGetterSetter(lt,"fillPriority","color"),S.addComponentsGetterSetter(lt,"fillPatternOffset",["x","y"]),S.addGetterSetter(lt,"fillPatternOffsetX",0,y()),S.addGetterSetter(lt,"fillPatternOffsetY",0,y()),S.addComponentsGetterSetter(lt,"fillPatternScale",["x","y"]),S.addGetterSetter(lt,"fillPatternScaleX",1,y()),S.addGetterSetter(lt,"fillPatternScaleY",1,y()),S.addComponentsGetterSetter(lt,"fillLinearGradientStartPoint",["x","y"]),S.addComponentsGetterSetter(lt,"strokeLinearGradientStartPoint",["x","y"]),S.addGetterSetter(lt,"fillLinearGradientStartPointX",0),S.addGetterSetter(lt,"strokeLinearGradientStartPointX",0),S.addGetterSetter(lt,"fillLinearGradientStartPointY",0),S.addGetterSetter(lt,"strokeLinearGradientStartPointY",0),S.addComponentsGetterSetter(lt,"fillLinearGradientEndPoint",["x","y"]),S.addComponentsGetterSetter(lt,"strokeLinearGradientEndPoint",["x","y"]),S.addGetterSetter(lt,"fillLinearGradientEndPointX",0),S.addGetterSetter(lt,"strokeLinearGradientEndPointX",0),S.addGetterSetter(lt,"fillLinearGradientEndPointY",0),S.addGetterSetter(lt,"strokeLinearGradientEndPointY",0),S.addComponentsGetterSetter(lt,"fillRadialGradientStartPoint",["x","y"]),S.addGetterSetter(lt,"fillRadialGradientStartPointX",0),S.addGetterSetter(lt,"fillRadialGradientStartPointY",0),S.addComponentsGetterSetter(lt,"fillRadialGradientEndPoint",["x","y"]),S.addGetterSetter(lt,"fillRadialGradientEndPointX",0),S.addGetterSetter(lt,"fillRadialGradientEndPointY",0),S.addGetterSetter(lt,"fillPatternRotation",0),S.backCompat(lt,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"}),h.mapMethods(lt);var ut=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],dt=ut.length,pt=function(t){function e(e){var i=t.call(this,e)||this;return i.canvas=new D,i.hitCanvas=new N({pixelRatio:1}),i._waitingForDraw=!1,i.on("visibleChange.konva",i._checkVisibility),i._checkVisibility(),i.on("imageSmoothingEnabledChange.konva",i._setSmoothEnabled),i._setSmoothEnabled(),i}return E(e,t),e.prototype.createPNGStream=function(){return this.canvas._canvas.createPNGStream()},e.prototype.getCanvas=function(){return this.canvas},e.prototype.getHitCanvas=function(){return this.hitCanvas},e.prototype.getContext=function(){return this.getCanvas().getContext()},e.prototype.clear=function(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this},e.prototype.setZIndex=function(e){t.prototype.setZIndex.call(this,e);var i=this.getStage();return i&&(i.content.removeChild(this.getCanvas()._canvas),e<i.children.length-1?i.content.insertBefore(this.getCanvas()._canvas,i.children[e+1].getCanvas()._canvas):i.content.appendChild(this.getCanvas()._canvas)),this},e.prototype.moveToTop=function(){W.prototype.moveToTop.call(this);var t=this.getStage();return t&&(t.content.removeChild(this.getCanvas()._canvas),t.content.appendChild(this.getCanvas()._canvas)),!0},e.prototype.moveUp=function(){if(!W.prototype.moveUp.call(this))return!1;var t=this.getStage();return!!t&&(t.content.removeChild(this.getCanvas()._canvas),this.index<t.children.length-1?t.content.insertBefore(this.getCanvas()._canvas,t.children[this.index+1].getCanvas()._canvas):t.content.appendChild(this.getCanvas()._canvas),!0)},e.prototype.moveDown=function(){if(W.prototype.moveDown.call(this)){var t=this.getStage();if(t){var e=t.children;t.content.removeChild(this.getCanvas()._canvas),t.content.insertBefore(this.getCanvas()._canvas,e[this.index+1].getCanvas()._canvas)}return!0}return!1},e.prototype.moveToBottom=function(){if(W.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var e=t.children;t.content.removeChild(this.getCanvas()._canvas),t.content.insertBefore(this.getCanvas()._canvas,e[1].getCanvas()._canvas)}return!0}return!1},e.prototype.getLayer=function(){return this},e.prototype.remove=function(){var t=this.getCanvas()._canvas;return W.prototype.remove.call(this),t&&t.parentNode&&m._isInDocument(t)&&t.parentNode.removeChild(t),this},e.prototype.getStage=function(){return this.parent},e.prototype.setSize=function(t){var e=t.width,i=t.height;return this.canvas.setSize(e,i),this.hitCanvas.setSize(e,i),this._setSmoothEnabled(),this},e.prototype._validateAdd=function(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&m.throw("You may only add groups and shapes to a layer.")},e.prototype._toKonvaCanvas=function(t){return(t=t||{}).width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=void 0!==t.x?t.x:this.x(),t.y=void 0!==t.y?t.y:this.y(),W.prototype._toKonvaCanvas.call(this,t)},e.prototype._checkVisibility=function(){var t=this.visible();this.canvas._canvas.style.display=t?"block":"none"},e.prototype._setSmoothEnabled=function(){this.getContext()._context.
12imageSmoothingEnabled=this.imageSmoothingEnabled()},e.prototype.getWidth=function(){if(this.parent)return this.parent.width()},e.prototype.setWidth=function(){m.warn('Can not change width of layer. Use "stage.width(value)" function instead.')},e.prototype.getHeight=function(){if(this.parent)return this.parent.height()},e.prototype.setHeight=function(){m.warn('Can not change height of layer. Use "stage.height(value)" function instead.')},e.prototype.batchDraw=function(){var t=this;return this._waitingForDraw||(this._waitingForDraw=!0,m.requestAnimFrame((function(){t.draw(),t._waitingForDraw=!1}))),this},e.prototype.getIntersection=function(t,e){if(!this.isListening()||!this.isVisible())return null;for(var i=1,n=!1;;){for(var r=0;r<dt;r++){var a=ut[r],o=this._getIntersection({x:t.x+a.x*i,y:t.y+a.y*i}),s=o.shape;if(s&&e)return s.findAncestor(e,!0);if(s)return s;if(n=!!o.antialiased,!o.antialiased)break}if(!n)return null;i+=1}},e.prototype._getIntersection=function(t){var e=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,n=i[3];if(255===n){var r=m._rgbToHex(i[0],i[1],i[2]),a=ct["#"+r];return a?{shape:a}:{antialiased:!0}}return n>0?{antialiased:!0}:{}},e.prototype.drawScene=function(t,e){var i=this.getLayer(),n=t||i&&i.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&n.getContext().clear(),Y.prototype.drawScene.call(this,n,e),this._fire("draw",{node:this}),this},e.prototype.drawHit=function(t,e){var i=this.getLayer(),n=t||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),Y.prototype.drawHit.call(this,n,e),this},e.prototype.enableHitGraph=function(){return this.hitGraphEnabled(!0),this},e.prototype.disableHitGraph=function(){return this.hitGraphEnabled(!1),this},e.prototype.setHitGraphEnabled=function(t){m.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)},e.prototype.getHitGraphEnabled=function(t){return m.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()},e.prototype.toggleHitCanvas=function(){if(this.parent){var t=this.parent;this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}},e}(Y);pt.prototype.nodeType="Layer",s(pt),S.addGetterSetter(pt,"imageSmoothingEnabled",!0),S.addGetterSetter(pt,"clearBeforeDraw",!0),S.addGetterSetter(pt,"hitGraphEnabled",!0,M()),h.mapMethods(pt);var ft=function(t){function e(e){var i=t.call(this,e)||this;return i.listening(!1),m.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.'),i}return E(e,t),e}(pt);ft.prototype.nodeType="FastLayer",s(ft),h.mapMethods(ft);var mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._validateAdd=function(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&m.throw("You may only add groups and shapes to groups.")},e}(Y);mt.prototype.nodeType="Group",s(mt),h.mapMethods(mt);var gt=r.performance&&r.performance.now?function(){return r.performance.now()}:function(){return(new Date).getTime()},vt=function(){function t(e,i){this.id=t.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:gt(),frameRate:0},this.func=e,this.setLayers(i)}return t.prototype.setLayers=function(t){var e=[];return e=t?t.length>0?t:[t]:[],this.layers=e,this},t.prototype.getLayers=function(){return this.layers},t.prototype.addLayer=function(t){var e,i=this.layers,n=i.length;for(e=0;e<n;e++)if(i[e]._id===t._id)return!1;return this.layers.push(t),!0},t.prototype.isRunning=function(){var e,i=t.animations,n=i.length;for(e=0;e<n;e++)if(i[e].id===this.id)return!0;return!1},t.prototype.start=function(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=gt(),t._addAnimation(this),this},t.prototype.stop=function(){return t._removeAnimation(this),this},t.prototype._updateFrameObject=function(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff},t._addAnimation=function(t){this.animations.push(t),this._handleAnimation()},t._removeAnimation=function(t){var e,i=t.id,n=this.animations,r=n.length;for(e=0;e<r;e++)if(n[e].id===i){this.animations.splice(e,1);break}},t._runFrames=function(){var t,e,i,n,r,a,o,s,h={},c=this.animations;for(n=0;n<c.length;n++)if(e=(t=c[n]).layers,i=t.func,t._updateFrameObject(gt()),a=e.length,!i||!1!==i.call(t,t.frame))for(r=0;r<a;r++)void 0!==(o=e[r])._id&&(h[o._id]=o);for(s in h)h.hasOwnProperty(s)&&h[s].draw()},t._animationLoop=function(){var e=t;e.animations.length?(e._runFrames(),requestAnimationFrame(e._animationLoop)):e.animRunning=!1},t._handleAnimation=function(){this.animRunning||(this.animRunning=!0,requestAnimationFrame(this._animationLoop))},t.animations=[],t.animIdCounter=0,t.animRunning=!1,t}(),yt={node:1,duration:1,easing:1,onFinish:1,yoyo:1},xt=0,bt=["fill","stroke","shadowColor"],_t=function(){function t(t,e,i,n,r,a,o){this.prop=t,this.propFunc=e,this.begin=n,this._pos=n,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=o,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=i,this._change=r-this.begin,this.pause()}return t.prototype.fire=function(t){var e=this[t];e&&e()},t.prototype.setTime=function(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())},t.prototype.getTime=function(){return this._time},t.prototype.setPosition=function(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t},t.prototype.getPosition=function(t){return void 0===t&&(t=this._time),this.func(t,this.begin,this._change,this.duration)},t.prototype.play=function(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame
12(),this.fire("onPlay")},t.prototype.reverse=function(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")},t.prototype.seek=function(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")},t.prototype.reset=function(){this.pause(),this._time=0,this.update(),this.fire("onReset")},t.prototype.finish=function(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")},t.prototype.update=function(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")},t.prototype.onEnterFrame=function(){var t=this.getTimer()-this._startTime;2===this.state?this.setTime(t):3===this.state&&this.setTime(this.duration-t)},t.prototype.pause=function(){this.state=1,this.fire("onPause")},t.prototype.getTimer=function(){return(new Date).getTime()},t}(),wt=function(){function t(e){var i,n,r=this,o=e.node,s=o._id,h=e.easing||Mt.Linear,c=!!e.yoyo;i=void 0===e.duration?.3:0===e.duration?.001:e.duration,this.node=o,this._id=xt++;var l=o.getLayer()||(o instanceof a.Stage?o.getLayers():null);for(n in l||m.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new vt((function(){r.tween.onEnterFrame()}),l),this.tween=new _t(n,(function(t){r._tweenFunc(t)}),h,0,1,1e3*i,c),this._addListeners(),t.attrs[s]||(t.attrs[s]={}),t.attrs[s][this._id]||(t.attrs[s][this._id]={}),t.tweens[s]||(t.tweens[s]={}),e)void 0===yt[n]&&this._addAttr(n,e[n]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}return t.prototype._addAttr=function(e,i){var n,r,a,o,s,h,c,l,u=this.node,d=u._id;if((a=t.tweens[d][e])&&delete t.attrs[d][a][e],n=u.getAttr(e),m._isArray(i))if(r=[],s=Math.max(i.length,n.length),"points"===e&&i.length!==n.length&&(i.length>n.length?(c=n,n=m._prepareArrayForTween(n,i,u.closed())):(h=i,i=m._prepareArrayForTween(i,n,u.closed()))),0===e.indexOf("fill"))for(o=0;o<s;o++)if(o%2==0)r.push(i[o]-n[o]);else{var p=m.colorToRGBA(n[o]);l=m.colorToRGBA(i[o]),n[o]=p,r.push({r:l.r-p.r,g:l.g-p.g,b:l.b-p.b,a:l.a-p.a})}else for(o=0;o<s;o++)r.push(i[o]-n[o]);else-1!==bt.indexOf(e)?(n=m.colorToRGBA(n),r={r:(l=m.colorToRGBA(i)).r-n.r,g:l.g-n.g,b:l.b-n.b,a:l.a-n.a}):r=i-n;t.attrs[d][this._id][e]={start:n,diff:r,end:i,trueEnd:h,trueStart:c},t.tweens[d][e]=this._id},t.prototype._tweenFunc=function(e){var i,n,r,a,o,s,h,c,l=this.node,u=t.attrs[l._id][this._id];for(i in u){if(r=(n=u[i]).start,a=n.diff,c=n.end,m._isArray(r))if(o=[],h=Math.max(r.length,c.length),0===i.indexOf("fill"))for(s=0;s<h;s++)s%2==0?o.push((r[s]||0)+a[s]*e):o.push("rgba("+Math.round(r[s].r+a[s].r*e)+","+Math.round(r[s].g+a[s].g*e)+","+Math.round(r[s].b+a[s].b*e)+","+(r[s].a+a[s].a*e)+")");else for(s=0;s<h;s++)o.push((r[s]||0)+a[s]*e);else o=-1!==bt.indexOf(i)?"rgba("+Math.round(r.r+a.r*e)+","+Math.round(r.g+a.g*e)+","+Math.round(r.b+a.b*e)+","+(r.a+a.a*e)+")":r+a*e;l.setAttr(i,o)}},t.prototype._addListeners=function(){var e=this;this.tween.onPlay=function(){e.anim.start()},this.tween.onReverse=function(){e.anim.start()},this.tween.onPause=function(){e.anim.stop()},this.tween.onFinish=function(){var i=e.node,n=t.attrs[i._id][e._id];n.points&&n.points.trueEnd&&i.setAttr("points",n.points.trueEnd),e.onFinish&&e.onFinish.call(e)},this.tween.onReset=function(){var i=e.node,n=t.attrs[i._id][e._id];n.points&&n.points.trueStart&&i.points(n.points.trueStart),e.onReset&&e.onReset()},this.tween.onUpdate=function(){e.onUpdate&&e.onUpdate.call(e)}},t.prototype.play=function(){return this.tween.play(),this},t.prototype.reverse=function(){return this.tween.reverse(),this},t.prototype.reset=function(){return this.tween.reset(),this},t.prototype.seek=function(t){return this.tween.seek(1e3*t),this},t.prototype.pause=function(){return this.tween.pause(),this},t.prototype.finish=function(){return this.tween.finish(),this},t.prototype.destroy=function(){var e,i=this.node._id,n=this._id,r=t.tweens[i];for(e in this.pause(),r)delete t.tweens[i][e];delete t.attrs[i][n]},t.attrs={},t.tweens={},t}();W.prototype.to=function(t){var e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new wt(t).play()};
12var Mt={BackEaseIn:function(t,e,i,n){var r=1.70158;return i*(t/=n)*t*((r+1)*t-r)+e},BackEaseOut:function(t,e,i,n){var r=1.70158;return i*((t=t/n-1)*t*((r+1)*t+r)+1)+e},BackEaseInOut:function(t,e,i,n){var r=1.70158;return(t/=n/2)<1?i/2*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},ElasticEaseIn:function(t,e,i,n,r,a){var o=0;return 0===t?e:1==(t/=n)?e+i:(a||(a=.3*n),!r||r<Math.abs(i)?(r=i,o=a/4):o=a/(2*Math.PI)*Math.asin(i/r),-r*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)+e)},ElasticEaseOut:function(t,e,i,n,r,a){var o=0;return 0===t?e:1==(t/=n)?e+i:(a||(a=.3*n),!r||r<Math.abs(i)?(r=i,o=a/4):o=a/(2*Math.PI)*Math.asin(i/r),r*Math.pow(2,-10*t)*Math.sin((t*n-o)*(2*Math.PI)/a)+i+e)},ElasticEaseInOut:function(t,e,i,n,r,a){var o=0;return 0===t?e:2==(t/=n/2)?e+i:(a||(a=n*(.3*1.5)),!r||r<Math.abs(i)?(r=i,o=a/4):o=a/(2*Math.PI)*Math.asin(i/r),t<1?r*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)*-.5+e:r*Math.pow(2,-10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)*.5+i+e)},BounceEaseOut:function(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn:function(t,e,i,n){return i-Mt.BounceEaseOut(n-t,0,i,n)+e},BounceEaseInOut:function(t,e,i,n){return t<n/2?.5*Mt.BounceEaseIn(2*t,0,i,n)+e:.5*Mt.BounceEaseOut(2*t-n,0,i,n)+.5*i+e},EaseIn:function(t,e,i,n){return i*(t/=n)*t+e},EaseOut:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},EaseInOut:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},StrongEaseIn:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},StrongEaseOut:function(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e},StrongEaseInOut:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},Linear:function(t,e,i,n){return i*t/n+e}},St=m._assign(a,{Collection:h,Util:m,Transform:c,Node:W,ids:F,names:G,Container:Y,Stage:st,stages:rt,Layer:pt,FastLayer:ft,Group:mt,DD:k,Shape:lt,shapes:ct,Animation:vt,Tween:wt,Easings:Mt,Context:C,Canvas:O}),Tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){var e=a.getAngle(this.angle()),i=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,e,i),t.arc(0,0,this.innerRadius(),e,0,!i),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.outerRadius()},e.prototype.getHeight=function(){return 2*this.outerRadius()},e.prototype.setWidth=function(t){this.outerRadius(t/2)},e.prototype.setHeight=function(t){this.outerRadius(t/2)},e}(lt);Tt.prototype._centroid=!0,Tt.prototype.className="Arc",Tt.prototype._attrsAffectingSize=["innerRadius","outerRadius"],s(Tt),S.addGetterSetter(Tt,"innerRadius",0,y()),S.addGetterSetter(Tt,"outerRadius",0,y()),S.addGetterSetter(Tt,"angle",0,y()),S.addGetterSetter(Tt,"clockwise",!1,M()),h.mapMethods(Tt);var Et=function(t){function e(e){var i=t.call(this,e)||this;return i.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",(function(){this._clearCache("tensionPoints")})),i}return E(e,t),e.prototype._sceneFunc=function(t){var e,i,n,r=this.points(),a=r.length,o=this.tension(),s=this.closed(),h=this.bezier();if(a){if(t.beginPath(),t.moveTo(r[0],r[1]),0!==o&&a>4){for(i=(e=this.getTensionPoints()).length,n=s?0:4,s||t.quadraticCurveTo(e[0],e[1],e[2],e[3]);n<i-2;)t.bezierCurveTo(e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]);s||t.quadraticCurveTo(e[i-2],e[i-1],r[a-2],r[a-1])}else if(h)for(n=2;n<a;)t.bezierCurveTo(r[n++],r[n++],r[n++],r[n++],r[n++],r[n++]);else for(n=2;n<a;n+=2)t.lineTo(r[n],r[n+1]);s?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}},e.prototype.getTensionPoints=function(){return this._getCache("tensionPoints",this._getTensionPoints)},e.prototype._getTensionPoints=function(){return this.closed()?this._getTensionPointsClosed():m._expandPoints(this.points(),this.tension())},e.prototype._getTensionPointsClosed=function(){var t=this.points(),e=t.length,i=this.tension(),n=m._getControlPoints(t[e-2],t[e-1],t[0],t[1],t[2],t[3],i),r=m._getControlPoints(t[e-4],t[e-3],t[e-2],t[e-1],t[0],t[1],i),a=m._expandPoints(t,i);return[n[2],n[3]].concat(a).concat([r[0],r[1],t[e-2],t[e-1],r[2],r[3],n[0],n[1],t[0],t[1]])}
12,e.prototype.getWidth=function(){return this.getSelfRect().width},e.prototype.getHeight=function(){return this.getSelfRect().height},e.prototype.getSelfRect=function(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};for(var e,i,n=(t=0!==this.tension()?function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)n[r]=a[o];return n}([t[0],t[1]],this._getTensionPoints(),[t[t.length-2],t[t.length-1]]):this.points())[0],r=t[0],a=t[1],o=t[1],s=0;s<t.length/2;s++)e=t[2*s],i=t[2*s+1],n=Math.min(n,e),r=Math.max(r,e),a=Math.min(a,i),o=Math.max(o,i);return{x:n,y:a,width:r-n,height:o-a}},e}(lt);Et.prototype.className="Line",Et.prototype._attrsAffectingSize=["points","bezier","tension"],s(Et),S.addGetterSetter(Et,"closed",!1),S.addGetterSetter(Et,"bezier",!1),S.addGetterSetter(Et,"tension",0,y()),S.addGetterSetter(Et,"points",[],function(){if(a.isUnminified)return function(t,e){return m._isArray(t)?t.forEach((function(t){m._isNumber(t)||m.warn('"'+e+'" attribute has non numeric element '+t+". Make sure that all elements are numbers.")}
12)):m.warn(g(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.'),t}}()),h.mapMethods(Et);var At=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(e){t.prototype._sceneFunc.call(this,e);var i=2*Math.PI,n=this.points(),r=n,a=0!==this.tension()&&n.length>4;a&&(r=this.getTensionPoints());var o,s,h=n.length;a?(o=n[h-2]-(r[r.length-2]+r[r.length-4])/2,s=n[h-1]-(r[r.length-1]+r[r.length-3])/2):(o=n[h-2]-n[h-4],s=n[h-1]-n[h-3]);var c=(Math.atan2(s,o)+i)%i,l=this.pointerLength(),u=this.pointerWidth();e.save(),e.beginPath(),e.translate(n[h-2],n[h-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore(),this.pointerAtBeginning()&&(e.save(),e.translate(n[0],n[1]),a?(o=(r[0]+r[2])/2-n[0],s=(r[1]+r[3])/2-n[1]):(o=n[2]-n[0],s=n[3]-n[1]),e.rotate((Math.atan2(-s,-o)+i)%i),e.moveTo(0,0),e.lineTo(-l,u/2),e.lineTo(-l,-u/2),e.closePath(),e.restore());var d=this.dashEnabled();d&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),d&&(this.attrs.dashEnabled=!0)},e.prototype.getSelfRect=function(){var e=t.prototype.getSelfRect.call(this),i=this.pointerWidth()/2;return{x:e.x-i,y:e.y-i,width:e.width+2*i,height:e.height+2*i}},e}(Et);At.prototype.className="Arrow",s(At),S.addGetterSetter(At,"pointerLength",10,y()),S.addGetterSetter(At,"pointerWidth",10,y()),S.addGetterSetter(At,"pointerAtBeginning",!1),h.mapMethods(At);var Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius()!==t/2&&this.radius(t/2)},e.prototype.setHeight=function(t){this.radius()!==t/2&&this.radius(t/2)},e}(lt);Pt.prototype._centroid=!0,Pt.prototype.className="Circle",Pt.prototype._attrsAffectingSize=["radius"],s(Pt),S.addGetterSetter(Pt,"radius",0,y()),h.mapMethods(Pt);var Ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.radiusX(),i=this.radiusY();t.beginPath(),t.save(),e!==i&&t.scale(1,i/e),t.arc(0,0,e,0,2*Math.PI,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radiusX()},e.prototype.getHeight=function(){return 2*this.radiusY()},e.prototype.setWidth=function(t){this.radiusX(t/2)},e.prototype.setHeight=function(t){this.radiusY(t/2)},e}(lt);Ct.prototype.className="Ellipse",Ct.prototype._centroid=!0,Ct.prototype._attrsAffectingSize=["radiusX","radiusY"],s(Ct),S.addComponentsGetterSetter(Ct,"radius",["x","y"]),S.addGetterSetter(Ct,"radiusX",0,y()),S.addGetterSetter(Ct,"radiusY",0,y()),h.mapMethods(Ct);var Lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._useBufferCanvas=function(){return t.prototype._useBufferCanvas.call(this,!0)},e.prototype._sceneFunc=function(t){var e,i=this.getWidth(),n=this.getHeight(),r=this.attrs.image;if(r){var a=this.attrs.cropWidth,o=this.attrs.cropHeight;e=a&&o?[r,this.cropX(),this.cropY(),a,o,0,0,i,n]:[r,0,0,i,n]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,i,n),t.closePath(),t.fillStrokeShape(this)),r&&t.drawImage.apply(t,e)},e.prototype._hitFunc=function(t){var e=this.width(),i=this.height();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){var t,e;return null!==(t=this.attrs.width)&&void 0!==t?t:(null===(e=this.image())||void 0===e?void 0:e.width)||0},e.prototype.getHeight=function(){var t,e;return null!==(t=this.attrs.height)&&void 0!==t?t:(null===(e=this.image())||void 0===e?void 0:e.height)||0},e.fromURL=function(t,i){var n=m.createImageElement();n.onload=function(){var t=new e({image:n});i(t)},n.crossOrigin="Anonymous",n.src=t},e}(lt);Lt.prototype.className="Image",s(Lt),S.addGetterSetter(Lt,"image"),S.addComponentsGetterSetter(Lt,"crop",["x","y","width","height"]),S.addGetterSetter(Lt,"cropX",0,y()),S.addGetterSetter(Lt,"cropY",0,y()),S.addGetterSetter(Lt,"cropWidth",0,y()),S.addGetterSetter(Lt,"cropHeight",0,y()),h.mapMethods(Lt);var Rt=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height"],It=Rt.length,Ot=function(t){function e(e){var i=t.call(this,e)||this;return i.on("add.konva",(function(t){this._addListeners(t.child),this._sync()})),i}return E(e,t),e.prototype.getText=function(){return this.find("Text")[0]},e.prototype.getTag=function(){return this.find("Tag")[0]},e.prototype._addListeners=function(t){var e,i=this,n=function(){i._sync()};for(e=0;e<It;e++)t.on(Rt[e]+"Change.konva",n)},e.prototype.getWidth=function(){return this.getText().width()},e.prototype.getHeight=function(){return this.getText().height()},e.prototype._sync=function(){var t,e,i,n,r,a,o,s=this.getText(),h=this.getTag();if(s&&h){switch(t=s.width(),e=s.height(),i=h.pointerDirection(),n=h.pointerWidth(),o=h.pointerHeight(),r=0,a=0,i){case"up":r=t/2,a=-1*o;break;case"right":r=t+n,a=e/2;break;case"down":r=t/2,a=e+o;break;case"left":r=-1*n,a=e/2}h.setAttrs({x:-1*r,y:-1*a,width:t,height:e}),s.setAttrs({x:-1*r,y:-1*a})}},e}(mt);Ot.prototype.className="Label",s(Ot),h.mapMethods(Ot);var Dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.width(),i=this.height(),n=this.pointerDirection(),r=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius(),s=0,h=0,c=0,l=0;
12"number"==typeof o?s=h=c=l=Math.min(o,e/2,i/2):(s=Math.min(o[0]||0,e/2,i/2),h=Math.min(o[1]||0,e/2,i/2),l=Math.min(o[2]||0,e/2,i/2),c=Math.min(o[3]||0,e/2,i/2)),t.beginPath(),t.moveTo(s,0),"up"===n&&(t.lineTo((e-r)/2,0),t.lineTo(e/2,-1*a),t.lineTo((e+r)/2,0)),t.lineTo(e-h,0),t.arc(e-h,h,h,3*Math.PI/2,0,!1),"right"===n&&(t.lineTo(e,(i-a)/2),t.lineTo(e+r,i/2),t.lineTo(e,(i+a)/2)),t.lineTo(e,i-l),t.arc(e-l,i-l,l,0,Math.PI/2,!1),"down"===n&&(t.lineTo((e+r)/2,i),t.lineTo(e/2,i+a),t.lineTo((e-r)/2,i)),t.lineTo(c,i),t.arc(c,i-c,c,Math.PI/2,Math.PI,!1),"left"===n&&(t.lineTo(0,(i+a)/2),t.lineTo(-1*r,i/2),t.lineTo(0,(i-a)/2)),t.lineTo(0,s),t.arc(s,s,s,Math.PI,3*Math.PI/2,!1),t.closePath(),t.fillStrokeShape(this)},e.prototype.getSelfRect=function(){var t=0,e=0,i=this.pointerWidth(),n=this.pointerHeight(),r=this.pointerDirection(),a=this.width(),o=this.height();return"up"===r?(e-=n,o+=n):"down"===r?o+=n:"left"===r?(t-=1.5*i,a+=i):"right"===r&&(a+=1.5*i),{x:t,y:e,width:a,height:o}},e}(lt);Dt.prototype.className="Tag",s(Dt),S.addGetterSetter(Dt,"pointerDirection","none"),S.addGetterSetter(Dt,"pointerWidth",0,y()),S.addGetterSetter(Dt,"pointerHeight",0,y()),S.addGetterSetter(Dt,"cornerRadius",0,x(4)),h.mapMethods(Dt);var Nt=function(t){function e(i){var n=t.call(this,i)||this;n.dataArray=[],n.pathLength=0,n.dataArray=e.parsePathData(n.data()),n.pathLength=0;for(var r=0;r<n.dataArray.length;++r)n.pathLength+=n.dataArray[r].pathLength;return n.on("dataChange.konva",(function(){this.dataArray=e.parsePathData(this.data()),this.pathLength=0;for(var t=0;t<this.dataArray.length;++t)this.pathLength+=this.dataArray[t].pathLength})),n}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.dataArray;t.beginPath();for(var i=!1,n=0;n<e.length;n++){var r=e[n].command,a=e[n].points;switch(r){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var o=a[0],s=a[1],h=a[2],c=a[3],l=a[4],u=a[5],d=a[6],p=a[7],f=h>c?h:c,m=h>c?1:h/c,g=h>c?c/h:1;t.translate(o,s),t.rotate(d),t.scale(m,g),t.arc(0,0,f,l,l+u,1-p),t.scale(1/m,1/g),t.rotate(-d),t.translate(-o,-s);break;case"z":i=!0,t.closePath()}}this.attrs.isPlugin||(i||this.hasFill()?t.fillStrokeShape(this):t.strokeShape(this))},e.prototype.getSelfRect=function(){var t=[];this.dataArray.forEach((function(i){if("A"===i.command){var n=i.points[4],r=i.points[5],a=i.points[4]+r,o=Math.PI/180;if(Math.abs(n-a)<o&&(o=Math.abs(n-a)),r<0)for(var s=n-o;s>a;s-=o){var h=e.getPointOnEllipticalArc(i.points[0],i.points[1],i.points[2],i.points[3],s,0);t.push(h.x,h.y)}else for(s=n+o;s<a;s+=o)h=e.getPointOnEllipticalArc(i.points[0],i.points[1],i.points[2],i.points[3],s,0),t.push(h.x,h.y)}else if("C"===i.command)for(s=0;s<=1;s+=.01)h=e.getPointOnCubicBezier(s,i.start.x,i.start.y,i.points[0],i.points[1],i.points[2],i.points[3],i.points[4],i.points[5]),t.push(h.x,h.y);else t=t.concat(i.points)}));for(var i,n,r=t[0],a=t[0],o=t[1],s=t[1],h=0;h<t.length/2;h++)i=t[2*h],n=t[2*h+1],isNaN(i)||(r=Math.min(r,i),a=Math.max(a,i)),isNaN(n)||(o=Math.min(o,n),s=Math.max(s,n));return{x:Math.round(r),y:Math.round(o),width:Math.round(a-r),height:Math.round(s-o)}},e.prototype.getLength=function(){return this.pathLength},e.prototype.getPointAtLength=function(t){var i,n=0,r=this.dataArray.length;if(!r)return null;for(;n<r&&t>this.dataArray[n].pathLength;)t-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(i=this.dataArray[n-1].points.slice(-2))[0],y:i[1]};if(t<.01)return{x:(i=this.dataArray[n].points.slice(0,2))[0],y:i[1]};var a=this.dataArray[n],o=a.points;switch(a.command){case"L":return e.getPointOnLine(t,a.start.x,a.start.y,o[0],o[1]);case"C":return e.getPointOnCubicBezier(t/a.pathLength,a.start.x,a.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return e.getPointOnQuadraticBezier(t/a.pathLength,a.start.x,a.start.y,o[0],o[1],o[2],o[3]);case"A":var s=o[0],h=o[1],c=o[2],l=o[3],u=o[4],d=o[5],p=o[6];return u+=d*t/a.pathLength,e.getPointOnEllipticalArc(s,h,c,l,u,p)}return null},e.getLineLength=function(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}
12,e.getPointOnLine=function(t,e,i,n,r,a,o){void 0===a&&(a=e),void 0===o&&(o=i);var s=(r-i)/(n-e+1e-8),h=Math.sqrt(t*t/(1+s*s));n<e&&(h*=-1);var c,l=s*h;if(n===e)c={x:a,y:o+l};else if((o-i)/(a-e+1e-8)===s)c={x:a+h,y:o+l};else{var u,d,p=this.getLineLength(e,i,n,r),f=(a-e)*(n-e)+(o-i)*(r-i);u=e+(f/=p*p)*(n-e),d=i+f*(r-i);var m=this.getLineLength(a,o,u,d),g=Math.sqrt(t*t-m*m);h=Math.sqrt(g*g/(1+s*s)),n<e&&(h*=-1),c={x:u+h,y:d+(l=s*h)}}return c},e.getPointOnCubicBezier=function(t,e,i,n,r,a,o,s,h){function c(t){return t*t*t}function l(t){return 3*t*t*(1-t)}function u(t){return 3*t*(1-t)*(1-t)}function d(t){return(1-t)*(1-t)*(1-t)}return{x:s*c(t)+a*l(t)+n*u(t)+e*d(t),y:h*c(t)+o*l(t)+r*u(t)+i*d(t)}},e.getPointOnQuadraticBezier=function(t,e,i,n,r,a,o){function s(t){return t*t}function h(t){return 2*t*(1-t)}function c(t){return(1-t)*(1-t)}return{x:a*s(t)+n*h(t)+e*c(t),y:o*s(t)+r*h(t)+i*c(t)}},e.getPointOnEllipticalArc=function(t,e,i,n,r,a){var o=Math.cos(a),s=Math.sin(a),h=i*Math.cos(r),c=n*Math.sin(r);return{x:t+(h*o-c*s),y:e+(h*s+c*o)}},e.parsePathData=function(t){if(!t)return[];var e=t,i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];e=e.replace(new RegExp(" ","g"),",");for(var n=0;n<i.length;n++)e=e.replace(new RegExp(i[n],"g"),"|"+i[n]);var r,a=e.split("|"),o=[],s=[],h=0,c=0,l=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;for(n=1;n<a.length;n++){var u=a[n],d=u.charAt(0);for(u=u.slice(1),s.length=0;r=l.exec(u);)s.push(r[0]);for(var p=[],f=0,m=s.length;f<m;f++){var g=parseFloat(s[f]);isNaN(g)?p.push(0):p.push(g)}for(;p.length>0&&!isNaN(p[0]);){var v,y,x,b,_,w,M,S,T,E,A=null,P=[],C=h,L=c;switch(d){case"l":h+=p.shift(),c+=p.shift(),A="L",P.push(h,c);break;case"L":h=p.shift(),c=p.shift(),P.push(h,c);break;case"m":var R=p.shift(),I=p.shift();if(h+=R,c+=I,A="M",o.length>2&&"z"===o[o.length-1].command)for(var O=o.length-2;O>=0;O--)if("M"===o[O].command){h=o[O].points[0]+R,c=o[O].points[1]+I;break}P.push(h,c),d="l";break;case"M":h=p.shift(),c=p.shift(),A="M",P.push(h,c),d="L";break;case"h":h+=p.shift(),A="L",P.push(h,c);break;case"H":h=p.shift(),A="L",P.push(h,c);break;case"v":c+=p.shift(),A="L",P.push(h,c);break;case"V":c=p.shift(),A="L",P.push(h,c);break;case"C":P.push(p.shift(),p.shift(),p.shift(),p.shift()),h=p.shift(),c=p.shift(),P.push(h,c);break;case"c":P.push(h+p.shift(),c+p.shift(),h+p.shift(),c+p.shift()),h+=p.shift(),c+=p.shift(),A="C",P.push(h,c);break;case"S":y=h,x=c,"C"===(v=o[o.length-1]).command&&(y=h+(h-v.points[2]),x=c+(c-v.points[3])),P.push(y,x,p.shift(),p.shift()),h=p.shift(),c=p.shift(),A="C",P.push(h,c);break;case"s":y=h,x=c,"C"===(v=o[o.length-1]).command&&(y=h+(h-v.points[2]),x=c+(c-v.points[3])),P.push(y,x,h+p.shift(),c+p.shift()),h+=p.shift(),c+=p.shift(),A="C",P.push(h,c);break;case"Q":P.push(p.shift(),p.shift()),h=p.shift(),c=p.shift(),P.push(h,c);break;case"q":P.push(h+p.shift(),c+p.shift()),h+=p.shift(),c+=p.shift(),A="Q",P.push(h,c);break;case"T":y=h,x=c,"Q"===(v=o[o.length-1]).command&&(y=h+(h-v.points[0]),x=c+(c-v.points[1])),h=p.shift(),c=p.shift(),A="Q",P.push(y,x,h,c);break;case"t":y=h,x=c,"Q"===(v=o[o.length-1]).command&&(y=h+(h-v.points[0]),x=c+(c-v.points[1])),h+=p.shift(),c+=p.shift(),A="Q",P.push(y,x,h,c);break;case"A":b=p.shift(),_=p.shift(),w=p.shift(),M=p.shift(),S=p.shift(),T=h,E=c,h=p.shift(),c=p.shift(),A="A",P=this.convertEndpointToCenterParameterization(T,E,h,c,M,S,b,_,w);break;case"a":b=p.shift(),_=p.shift(),w=p.shift(),M=p.shift(),S=p.shift(),T=h,E=c,h+=p.shift(),c+=p.shift(),A="A",P=this.convertEndpointToCenterParameterization(T,E,h,c,M,S,b,_,w)}o.push({command:A||d,points:P,start:{x:C,y:L},pathLength:this.calcLength(C,L,A||d,P)})}"z"!==d&&"Z"!==d||o.push({command:"z",points:[],start:void 0,pathLength:0})}return o},e.calcLength=function(t,i,n,r){var a,o,s,h,c=e;switch(n){case"L":return c.getLineLength(t,i,r[0],r[1]);case"C":for(a=0,o=c.getPointOnCubicBezier(0,t,i,r[0],r[1],r[2],r[3],r[4],r[5]),h=.01;h<=1;h+=.01)s=c.getPointOnCubicBezier(h,t,i,r[0],r[1],r[2],r[3],r[4],r[5]),a+=c.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case"Q":for(a=0,o=c.getPointOnQuadraticBezier(0,t,i,r[0],r[1],r[2],r[3]),h=.01;h<=1;h+=.01)s=c.getPointOnQuadraticBezier(h,t,i,r[0],r[1],r[2],r[3]),a+=c.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case"A":a=0;var l=r[4],u=r[5],d=r[4]+u,p=Math.PI/180;
12if(Math.abs(l-d)<p&&(p=Math.abs(l-d)),o=c.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),u<0)for(h=l-p;h>d;h-=p)s=c.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],h,0),a+=c.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(h=l+p;h<d;h+=p)s=c.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],h,0),a+=c.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=c.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],d,0),a+=c.getLineLength(o.x,o.y,s.x,s.y)}return 0},e.convertEndpointToCenterParameterization=function(t,e,i,n,r,a,o,s,h){var c=h*(Math.PI/180),l=Math.cos(c)*(t-i)/2+Math.sin(c)*(e-n)/2,u=-1*Math.sin(c)*(t-i)/2+Math.cos(c)*(e-n)/2,d=l*l/(o*o)+u*u/(s*s);d>1&&(o*=Math.sqrt(d),s*=Math.sqrt(d));var p=Math.sqrt((o*o*(s*s)-o*o*(u*u)-s*s*(l*l))/(o*o*(u*u)+s*s*(l*l)));r===a&&(p*=-1),isNaN(p)&&(p=0);var f=p*o*u/s,m=p*-s*l/o,g=(t+i)/2+Math.cos(c)*f-Math.sin(c)*m,v=(e+n)/2+Math.sin(c)*f+Math.cos(c)*m,y=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},x=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(y(t)*y(e))},b=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(x(t,e))},_=b([1,0],[(l-f)/o,(u-m)/s]),w=[(l-f)/o,(u-m)/s],M=[(-1*l-f)/o,(-1*u-m)/s],S=b(w,M);return x(w,M)<=-1&&(S=Math.PI),x(w,M)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),[g,v,o,s,_,S,c,a]},e}(lt);Nt.prototype.className="Path",Nt.prototype._attrsAffectingSize=["data"],s(Nt),S.addGetterSetter(Nt,"data"),h.mapMethods(Nt);var kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.cornerRadius(),i=this.width(),n=this.height();if(t.beginPath(),e){var r=0,a=0,o=0,s=0;"number"==typeof e?r=a=o=s=Math.min(e,i/2,n/2):(r=Math.min(e[0]||0,i/2,n/2),a=Math.min(e[1]||0,i/2,n/2),s=Math.min(e[2]||0,i/2,n/2),o=Math.min(e[3]||0,i/2,n/2)),t.moveTo(r,0),t.lineTo(i-a,0),t.arc(i-a,a,a,3*Math.PI/2,0,!1),t.lineTo(i,n-s),t.arc(i-s,n-s,s,0,Math.PI/2,!1),t.lineTo(o,n),t.arc(o,n-o,o,Math.PI/2,Math.PI,!1),t.lineTo(0,r),t.arc(r,r,r,Math.PI,3*Math.PI/2,!1)}else t.rect(0,0,i,n);t.closePath(),t.fillStrokeShape(this)},e}(lt);kt.prototype.className="Rect",s(kt),S.addGetterSetter(kt,"cornerRadius",0,x(4)),h.mapMethods(kt);var Ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){var e=this._getPoints();t.beginPath(),t.moveTo(e[0].x,e[0].y);for(var i=1;i<e.length;i++)t.lineTo(e[i].x,e[i].y);t.closePath(),t.fillStrokeShape(this)},e.prototype._getPoints=function(){for(var t=this.attrs.sides,e=this.attrs.radius||0,i=[],n=0;n<t;n++)i.push({x:e*Math.sin(2*n*Math.PI/t),y:-1*e*Math.cos(2*n*Math.PI/t)});return i},e.prototype.getSelfRect=function(){var t=this._getPoints(),e=t[0].x,i=t[0].y,n=t[0].x,r=t[0].y;return t.forEach((function(t){e=Math.min(e,t.x),i=Math.max(i,t.x),n=Math.min(n,t.y),r=Math.max(r,t.y)})),{x:e,y:n,width:i-e,height:r-n}},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius(t/2)},e.prototype.setHeight=function(t){this.radius(t/2)},e}(lt);Ft.prototype.className="RegularPolygon",Ft.prototype._centroid=!0,Ft.prototype._attrsAffectingSize=["radius"],s(Ft),S.addGetterSetter(Ft,"radius",0,y()),S.addGetterSetter(Ft,"sides",0,y()),h.mapMethods(
12Ft);var Gt=2*Math.PI,zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,Gt,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),Gt,0,!0),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.outerRadius()},e.prototype.getHeight=function(){return 2*this.outerRadius()},e.prototype.setWidth=function(t){this.outerRadius(t/2)},e.prototype.setHeight=function(t){this.outerRadius(t/2)},e}(lt);zt.prototype.className="Ring",zt.prototype._centroid=!0,zt.prototype._attrsAffectingSize=["innerRadius","outerRadius"],s(zt),S.addGetterSetter(zt,"innerRadius",0,y()),S.addGetterSetter(zt,"outerRadius",0,y()),h.mapMethods(zt);var Ut=function(t){function e(e){var i=t.call(this,e)||this;return i._updated=!0,i.anim=new vt((function(){var t=i._updated;return i._updated=!1,t})),i.on("animationChange.konva",(function(){this.frameIndex(0)})),i.on("frameIndexChange.konva",(function(){this._updated=!0})),i.on("frameRateChange.konva",(function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})),i}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.animation(),i=this.frameIndex(),n=4*i,r=this.animations()[e],a=this.frameOffsets(),o=r[n+0],s=r[n+1],h=r[n+2],c=r[n+3],l=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,h,c),t.closePath(),t.fillStrokeShape(this)),l)if(a){var u=a[e],d=2*i;t.drawImage(l,o,s,h,c,u[d+0],u[d+1],h,c)}else t.drawImage(l,o,s,h,c,0,0,h,c)},e.prototype._hitFunc=function(t){var e=this.animation(),i=this.frameIndex(),n=4*i,r=this.animations()[e],a=this.frameOffsets(),o=r[n+2],s=r[n+3];if(t.beginPath(),a){var h=a[e],c=2*i;t.rect(h[c+0],h[c+1],o,s)}else t.rect(0,0,o,s);t.closePath(),t.fillShape(this)},e.prototype._useBufferCanvas=function(){return t.prototype._useBufferCanvas.call(this,!0)},e.prototype._setInterval=function(){var t=this;this.interval=setInterval((function(){t._updateIndex()}),1e3/this.frameRate())},e.prototype.start=function(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}},e.prototype.stop=function(){this.anim.stop(),clearInterval(this.interval)},e.prototype.isRunning=function(){return this.anim.isRunning()},e.prototype._updateIndex=function(){var t=this.frameIndex(),e=this.animation();t<this.animations()[e].length/4-1?this.frameIndex(t+1):this.frameIndex(0)},e}(lt);Ut.prototype.className="Sprite",s(Ut),S.addGetterSetter(Ut,"animation"),S.addGetterSetter(Ut,"animations"),S.addGetterSetter(Ut,"frameOffsets"),S.addGetterSetter(Ut,"image"),S.addGetterSetter(Ut,"frameIndex",0,y()),S.addGetterSetter(Ut,"frameRate",17,y()),S.backCompat(Ut,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),h.mapMethods(Ut);var Bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.innerRadius(),i=this.outerRadius(),n=this.numPoints();t.beginPath(),t.moveTo(0,0-i);for(var r=1;r<2*n;r++){var a=r%2==0?i:e,o=a*Math.sin(r*Math.PI/n),s=-1*a*Math.cos(r*Math.PI/n);t.lineTo(o,s)}t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.outerRadius()},e.prototype.getHeight=function(){return 2*this.outerRadius()},e.prototype.setWidth=function(t){this.outerRadius(t/2)},e.prototype.setHeight=function(t){this.outerRadius(t/2)},e}(lt);function Ht(t){return Array.from(t)}Bt.prototype.className="Star",Bt.prototype._centroid=!0,Bt.prototype._attrsAffectingSize=["innerRadius","outerRadius"],s(Bt),S.addGetterSetter(Bt,"numPoints",5,y()),S.addGetterSetter(Bt,"innerRadius",0,y()),S.addGetterSetter(Bt,"outerRadius",0,y()),h.mapMethods(Bt);var jt,Vt=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Wt=Vt.length;function Xt(){return jt||(jt=m.createCanvasElement().getContext("2d"))}var Yt=function(t){function e(e){var i=t.call(this,function(t){return(t=t||{}).fillLinearGradientColorStops||t.fillRadialGradientColorStops||t.fillPatternImage||(t.fill=t.fill||"black"),t}(e))||this;i._partialTextX=0,i._partialTextY=0;for(var n=0;n<Wt;n++)i.on(Vt[n]+"Change.konva",i._setTextData);return i._setTextData(),i}return E(e,t),e.prototype._sceneFunc=function(t){var e=this.textArr,i=e.length;if(!this.text())return;var n,r=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,s=this.verticalAlign(),h=0,c=this.align(),l=this.getWidth(),u=this.letterSpacing(),d=this.fill(),p=this.textDecoration(),f=-1!==p.indexOf("underline"),m=-1!==p.indexOf("line-through"),g=0,v=(g=o/2,0),y=0;let x=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline","alphabetic"),t.setAttr("textAlign","left"),"middle"===s?h=(this.getHeight()-i*o-2*r)/2:"bottom"===s&&(h=this.getHeight()-(i-1)*o-2*r),t.translate(r,h),n=0;n<i;n++){v=0,y=0;var b,_,w,M=e[n],S=M.text,T=M.width,E=n!==i-1;if(t.save(),"right"===c?v+=l-T-2*r:"center"===c&&(v+=(l-T-2*r)/2),i>1&&n>0&&(1==n?g=o:g+=o),0==n?x=-a/2+y:x+=o,f&&(t.save(),t.beginPath(),t.moveTo(v,x+Math.round(a/2)),_=0==(b=S.split(" ").length-1),w="justify"===c&&E&&!_?l-2*r:T,t.lineTo(v+Math.round(w),x+Math.round(a/2)),t.lineWidth=a/15,t.strokeStyle=d,t.stroke(),t.restore(
12)),m&&(t.save(),t.beginPath(),t.moveTo(v,x),_=0==(b=S.split(" ").length-1),w="justify"===c&&E&&!_?l-2*r:T,t.lineTo(v+Math.round(w),x),t.lineWidth=a/15,t.strokeStyle=d,t.stroke(),t.restore()),0!==u||"justify"===c){b=S.split(" ").length-1;for(var A=Ht(S),P=0;P<A.length;P++){var C=A[P];" "===C&&n!==i-1&&"justify"===c&&(v+=(l-2*r-T)/b),this._partialTextX=v,this._partialTextY=0==n?y:g+y,this._partialText=C,t.fillStrokeShape(this),v+=this.measureSize(C).width+u}}else this._partialTextX=v,this._partialTextY=0==n?y:g+y,this._partialText=S,t.fillStrokeShape(this);t.restore()}},e.prototype._hitFunc=function(t){var e=this.getWidth(),i=this.getHeight();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)},e.prototype.setText=function(t){var e=m._isString(t)?t:null==t?"":t+"";return this._setAttr("text",e),this},e.prototype.getWidth=function(){return"auto"===this.attrs.width||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width},e.prototype.getHeight=function(){return"auto"===this.attrs.height||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height},e.prototype.getTextWidth=function(){return this.textWidth},e.prototype.getTextHeight=function(){return m.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight},e.prototype.measureSize=function(t){var e,i=Xt(),n=this.fontSize();return i.save(),i.font=this._getContextFont(),e=i.measureText(t),i.restore(),{width:e.width,height:n}},e.prototype._getContextFont=function(){return a.UA.isIE?this.fontStyle()+" "+this.fontSize()+"px "+this.fontFamily():this.fontStyle()+" "+this.fontVariant()+" "+this.fontSize()+"px "+this.fontFamily().split(",").map((function(t){var e=(t=t.trim()).indexOf(" ")>=0,i=t.indexOf('"')>=0||t.indexOf("'")>=0;return e&&!i&&(t='"'+t+'"'),t})).join(", ")},e.prototype._addTextLine=function(t){"justify"===this.align()&&(t=t.trim());var e=this._getTextWidth(t);return this.textArr.push({text:t,width:e})},e.prototype._getTextWidth=function(t){var e=this.letterSpacing(),i=t.length;return Xt().measureText(t).width+(i?e*(i-1):0)},e.prototype._setTextData=function(){var t=this.text().split("\n"),e=+this.fontSize(),i=0,n=this.lineHeight()*e,r=this.attrs.width,a=this.attrs.height,o="auto"!==r&&void 0!==r,s="auto"!==a&&void 0!==a,h=this.padding(),c=r-2*h,l=a-2*h,u=0,d=this.wrap(),p="none"!==d,f="char"!==d&&p,m=this.ellipsis();this.textArr=[],Xt().font=this._getContextFont();for(var g=m?this._getTextWidth("…"):0,v=0,y=t.length;v<y;++v){var x=t[v],b=this._getTextWidth(x);if(o&&b>c)for(;x.length>0;){for(var _=0,w=x.length,M="",S=0;_<w;){var T=_+w>>>1,E=x.slice(0,T+1),A=this._getTextWidth(E)+g;A<=c?(_=T+1,M=E+(m?"…":""),S=A):w=T}if(!M)break;if(f){var P,C=x[M.length];(P=(" "===C||"-"===C)&&S<=c?M.length:Math.max(M.lastIndexOf(" "),M.lastIndexOf("-"))+1)>0&&(_=P,M=M.slice(0,_),S=this._getTextWidth(M))}if(M=M.trimRight(),this._addTextLine(M),i=Math.max(i,S),u+=n,!p||s&&u+n>l){var L=this.textArr[this.textArr.length-1];L&&m&&(this._getTextWidth(L.text+"…")<c||(L.text=L.text.slice(0,L.text.length-3)),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(L.text+"…"));break}if((x=(x=x.slice(_)).trimLeft()).length>0&&(b=this._getTextWidth(x))<=c){this._addTextLine(x),u+=n,i=Math.max(i,b);break}}else this._addTextLine(x),u+=n,i=Math.max(i,b);if(s&&u+n>l)break}this.textHeight=e,this.textWidth=i},e.prototype.getStrokeScaleEnabled=function(){return!0},e}(lt);function qt(t){t.fillText(this.partialText,0,0)}function Zt(t){t.strokeText(this.partialText,0,0)}Yt.prototype._fillFunc=function(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)},Yt.prototype._strokeFunc=function(t){t.strokeText(this._partialText,this._partialTextX,this._partialTextY)},Yt.prototype.className="Text",Yt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight"],s(Yt),S.overWriteSetter(Yt,"width",b()),S.overWriteSetter(Yt,"height",b()),S.addGetterSetter(Yt,"fontFamily","Arial"),S.addGetterSetter(Yt,"fontSize",12,y()),S.addGetterSetter(Yt,"fontStyle","normal"),S.addGetterSetter(Yt,"fontVariant","normal"),S.addGetterSetter(Yt,"padding",0,y()),S.addGetterSetter(Yt,"align","left"),S.addGetterSetter(Yt,"verticalAlign","top"),S.addGetterSetter(Yt,"lineHeight",1,y()),S.addGetterSetter(Yt,"wrap","word"),S.addGetterSetter(Yt,"ellipsis",!1,M()),S.addGetterSetter(Yt,"letterSpacing",0,y()),S.addGetterSetter(Yt,"text","",_()),S.addGetterSetter(Yt,"textDecoration",""),h.mapMethods(Yt);var Jt=function(t){function e(e){var i=t.call(this,e)||this;return i.dummyCanvas=m.createCanvasElement(),i.dataArray=[],i.dataArray=Nt.parsePathData(i.attrs.data),i.on("dataChange.konva",(function(){this.dataArray=Nt.parsePathData(this.attrs.data),this._setTextData()})),i.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncCh
12ange.konva",i._setTextData),e&&e.getKerning&&(m.warn('getKerning TextPath API is deprecated. Please use "kerningFunc" instead.'),i.kerningFunc(e.getKerning)),i._setTextData(),i}return E(e,t),e.prototype._sceneFunc=function(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var e=this.textDecoration(),i=this.fill(),n=this.fontSize(),r=this.glyphInfo;"underline"===e&&t.beginPath();for(var a=0;a<r.length;a++){t.save();var o=r[a].p0;t.translate(o.x,o.y),t.rotate(r[a].rotation),this.partialText=r[a].text,t.fillStrokeShape(this),"underline"===e&&(0===a&&t.moveTo(0,n/2+1),t.lineTo(n,n/2+1)),t.restore()}"underline"===e&&(t.strokeStyle=i,t.lineWidth=n/20,t.stroke()),t.restore()},e.prototype._hitFunc=function(t){t.beginPath();var e=this.glyphInfo;if(e.length>=1){var i=e[0].p0;t.moveTo(i.x,i.y)}for(var n=0;n<e.length;n++){var r=e[n].p1;t.lineTo(r.x,r.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()},e.prototype.getTextWidth=function(){return this.textWidth},e.prototype.getTextHeight=function(){return m.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight},e.prototype.setText=function(t){return Yt.prototype.setText.call(this,t)},e.prototype._getContextFont=function(){return Yt.prototype._getContextFont.call(this)},e.prototype._getTextSize=function(t){var e=this.dummyCanvas.getContext("2d");e.save(),e.font=this._getContextFont();var i=e.measureText(t);return e.restore(),{width:i.width,height:parseInt(this.attrs.fontSize,10)}},e.prototype._setTextData=function(){var t=this,e=this._getTextSize(this.attrs.text),i=this.letterSpacing(),n=this.align(),r=this.kerningFunc();this.textWidth=e.width,this.textHeight=e.height;var a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*i,0);this.glyphInfo=[];for(var o=0,s=0;s<t.dataArray.length;s++)t.dataArray[s].pathLength>0&&(o+=t.dataArray[s].pathLength);var h=0;"center"===n&&(h=Math.max(0,o/2-a/2)),"right"===n&&(h=Math.max(0,o-a));for(var c,l,u,d=Ht(this.text()),p=this.text().split(" ").length-1,f=-1,m=0,g=function(){m=0;for(var e=t.dataArray,i=f+1;i<e.length;i++){if(e[i].pathLength>0)return f=i,e[i];"M"===e[i].command&&(c={x:e[i].points[0],y:e[i].points[1]})}return{}},v=function(e){var r=t._getTextSize(e).width+i;" "===e&&"justify"===n&&(r+=(o-a)/p);var s=0,h=0;for(l=void 0;Math.abs(r-s)/r>.01&&h<20;){h++;for(var d=s;void 0===u;)(u=g())&&d+u.pathLength<r&&(d+=u.pathLength,u=void 0);if(u==={}||void 0===c)return;var f=!1;switch(u.command){case"L":Nt.getLineLength(c.x,c.y,u.points[0],u.points[1])>r?l=Nt.getPointOnLine(r,c.x,c.y,u.points[0],u.points[1],c.x,c.y):u=void 0;break;case"A":var v=u.points[4],y=u.points[5],x=u.points[4]+y;0===m?m=v+1e-8:r>s?m+=Math.PI/180*y/Math.abs(y):m-=Math.PI/360*y/Math.abs(y),(y<0&&m<x||y>=0&&m>x)&&(m=x,f=!0),l=Nt.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],m,u.points[6]);break;case"C":0===m?m=r>u.pathLength?1e-8:r/u.pathLength:r>s?m+=(r-s)/u.pathLength/2:m=Math.max(m-(s-r)/u.pathLength/2,0),m>1&&(m=1,f=!0),l=Nt.getPointOnCubicBezier(m,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);break;case"Q":0===m?m=r/u.pathLength:r>s?m+=(r-s)/u.pathLength:m-=(s-r)/u.pathLength,m>1&&(m=1,f=!0),l=Nt.getPointOnQuadraticBezier(m,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3])}void 0!==l&&(s=Nt.getLineLength(c.x,c.y,l.x,l.y)),f&&(f=!1,u=void 0)}},y=h/(t._getTextSize("C").width+i)-1,x=0;x<y&&(v("C"),void 0!==c&&void 0!==l);x++)c=l;for(var b=0;b<d.length&&(v(d[b]),void 0!==c&&void 0!==l);b++){var _=Nt.getLineLength(c.x,c.y,l.x,l.y),w=0;if(r)try{w=r(d[b-1],d[b])*this.fontSize()}catch(t){w=0}c.x+=w,l.x+=w,this.textWidth+=w;var M=Nt.getPointOnLine(w+_/2,c.x,c.y,l.x,l.y),S=Math.atan2(l.y-c.y,l.x-c.x);this.glyphInfo.push({transposeX:M.x,transposeY:M.y,text:d[b],rotation:S,p0:c,p1:l}),c=l}},e.prototype.getSelfRect=function(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach((function(e){t.push(e.p0.x),t.push(e.p0.y),t.push(e.p1.x),t.push(e.p1.y)}));for(var e,i,n=t[0]||0,r=t[0]||0,a=t[1]||0,o=t[1]||0,s=0;s<t.length/2;s++)e=t[2*s],i=t[2*s+1],n=Math.min(n,e),r=Math.max(r,e),a=Math.min(a,i),o=Math.max(o,i);var h=this.fontSize();return{x:n-h/2,y:a-h/2,width:r-n+h,height:o-a+h}},e}(lt);
12Jt.prototype._fillFunc=qt,Jt.prototype._strokeFunc=Zt,Jt.prototype._fillFuncHit=qt,Jt.prototype._strokeFuncHit=Zt,Jt.prototype.className="TextPath",Jt.prototype._attrsAffectingSize=["text","fontSize","data"],s(Jt),S.addGetterSetter(Jt,"data"),S.addGetterSetter(Jt,"fontFamily","Arial"),S.addGetterSetter(Jt,"fontSize",12,y()),S.addGetterSetter(Jt,"fontStyle","normal"),S.addGetterSetter(Jt,"align","left"),S.addGetterSetter(Jt,"letterSpacing",0,y()),S.addGetterSetter(Jt,"textBaseline","middle"),S.addGetterSetter(Jt,"fontVariant","normal"),S.addGetterSetter(Jt,"text",""),S.addGetterSetter(Jt,"textDecoration",null),S.addGetterSetter(Jt,"kerningFunc",null),h.mapMethods(Jt);var Kt=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange"].map((function(t){return t+".tr-konva"})).join(" "),Qt=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"].map((function(t){return t+".tr-konva"})).join(" "),$t={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},te="ontouchstart"in a._global,ee=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function ie(t,e,i){var n=i.x+(t.x-i.x)*Math.cos(e)-(t.y-i.y)*Math.sin(e),r=i.y+(t.x-i.x)*Math.sin(e)+(t.y-i.y)*Math.cos(e);return A(A({},t),{rotation:t.rotation+e,x:n,y:r})}function ne(t,e){return ie(t,e,function(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}(t))}var re=function(t){function e(e){var i=t.call(this,e)||this;return i._transforming=!1,i._createElements(),i._handleMouseMove=i._handleMouseMove.bind(i),i._handleMouseUp=i._handleMouseUp.bind(i),i.update=i.update.bind(i),i.on(Kt,i.update),i.getNode()&&i.update(),i}return E(e,t),e.prototype.attachTo=function(t){return this.setNode(t),this},e.prototype.setNode=function(t){return m.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])},e.prototype.getNode=function(){return this._nodes&&this._nodes[0]},e.prototype.setNodes=function(t){var e=this;return void 0===t&&(t=[]),this._nodes&&this._nodes.length&&this.detach(),this._nodes=t,1===t.length?this.rotation(t[0].rotation()):this.rotation(0),this._nodes.forEach((function(t){var i=t._attrsAffectingSize.map((function(t){return t+"Change.tr-konva"})).join(" "),n=function(){1===e.nodes().length&&e.rotation(e.nodes()[0].rotation()),e._resetTransformCache(),e._transforming||e.isDragging()||e.update()};t.on(i,n),t.on(Qt,n),t.on("_clearTransformCache.tr-konva",n),t.on("xChange.tr-konva yChange.tr-konva",n),e._proxyDrag(t)})),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this},e.prototype._proxyDrag=function(t){var e,i=this;t.on("dragstart.tr-konva",(function(n){e=t.getAbsolutePosition(),i.isDragging()||t===i.findOne(".back")||i.startDrag(n,!1)})),t.on("dragmove.tr-konva",(function(n){if(e){var r=t.getAbsolutePosition(),a=r.x-e.x,o=r.y-e.y;i.nodes().forEach((function(e){if(e!==t&&!e.isDragging()){var i=e.getAbsolutePosition();e.setAbsolutePosition({x:i.x+a,y:i.y+o}),e.startDrag(n)}})),e=null}}))},e.prototype.getNodes=function(){return this._nodes||[]},e.prototype.getActiveAnchor=function(){return this._movingAnchorName},e.prototype.detach=function(){this._nodes&&this._nodes.forEach((function(t){t.off(".tr-konva")})),this._nodes=[],this._resetTransformCache()},e.prototype._resetTransformCache=function(){this._clearCache("nodesRect"),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")},e.prototype._getNodeRect=function(){return this._getCache("nodesRect",this.__getNodeRect)}
12,e.prototype.__getNodeShape=function(t,e,i){void 0===e&&(e=this.rotation());var n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=t.getAbsoluteScale(i),o=t.getAbsolutePosition(i),s=n.x*r.x-t.offsetX()*r.x,h=n.y*r.y-t.offsetY()*r.y,c=(a.getAngle(t.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return ie({x:o.x+s*Math.cos(c)+h*Math.sin(-c),y:o.y+h*Math.cos(c)+s*Math.sin(c),width:n.width*r.x,height:n.height*r.y,rotation:c},-a.getAngle(e),{x:0,y:0})},e.prototype.__getNodeRect=function(){var t=this;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};var e=[];this.nodes().map((function(i){var n=i.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:t.ignoreStroke()}),r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],a=i.getAbsoluteTransform();r.forEach((function(t){var i=a.point(t);e.push(i)}))}));var i,n,r,o,s=new c;s.rotate(-a.getAngle(this.rotation())),e.forEach((function(t){var e=s.point(t);void 0===i&&(i=r=e.x,n=o=e.y),i=Math.min(i,e.x),n=Math.min(n,e.y),r=Math.max(r,e.x),o=Math.max(o,e.y)})),s.invert();var h=s.point({x:i,y:n});return{x:h.x,y:h.y,width:r-i,height:o-n,rotation:a.getAngle(this.rotation())}},e.prototype.getX=function(){return this._getNodeRect().x},e.prototype.getY=function(){return this._getNodeRect().y},e.prototype.getWidth=function(){return this._getNodeRect().width},e.prototype.getHeight=function(){return this._getNodeRect().height},e.prototype._createElements=function(){this._createBack(),ee.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")},e.prototype._createAnchor=function(t){var e=this,i=new kt({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:te?10:"auto"}),n=this;i.on("mousedown touchstart",(function(t){n._handleMouseDown(t)})),i.on("dragstart",(function(t){i.stopDrag(),t.cancelBubble=!0})),i.on("dragend",(function(t){t.cancelBubble=!0})),i.on("mouseenter",(function(){var n=a.getAngle(e.rotation()),r=function(t,e){if("rotater"===t)return"crosshair";e+=m._degToRad($t[t]||0);var i=(m._radToDeg(e)%360+360)%360;return m._inRange(i,337.5,360)||m._inRange(i,0,22.5)?"ns-resize":m._inRange(i,22.5,67.5)?"nesw-resize":m._inRange(i,67.5,112.5)?"ew-resize":m._inRange(i,112.5,157.5)?"nwse-resize":m._inRange(i,157.5,202.5)?"ns-resize":m._inRange(i,202.5,247.5)?"nesw-resize":m._inRange(i,247.5,292.5)?"ew-resize":m._inRange(i,292.5,337.5)?"nwse-resize":(m.error("Transformer has unknown angle for cursor detection: "+i),"pointer")}(t,n);i.getStage().content.style.cursor=r,e._cursorChange=!0})),i.on("mouseout",(function(){i.getStage().content.style.cursor="",e._cursorChange=!1})),this.add(i)},e.prototype._createBack=function(){var t=this,e=new lt({name:"back",width:0,height:0,draggable:!0,sceneFunc:function(t){var e=this.getParent(),i=e.padding();t.beginPath(),t.rect(-i,-i,this.width()+2*i,this.height()+2*i),t.moveTo(this.width()/2,-i),e.rotateEnabled(),t.fillStrokeShape(this)},hitFunc:function(e,i){if(t.shouldOverdrawWholeArea()){var n=t.padding();e.beginPath(),e.rect(-n,-n,i.width()+2*n,i.height()+2*n),e.fillStrokeShape(i)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",(function(t){t.cancelBubble=!0})),e.on("dragmove",(function(t){t.cancelBubble=!0})),e.on("dragend",(function(t){t.cancelBubble=!0}))},e.prototype._handleMouseDown=function(t){this._movingAnchorName=t.target.name().split(" ")[0];var e=this._getNodeRect(),i=e.width,n=e.height,r=Math.sqrt(Math.pow(i,2)+Math.pow(n,2));this.sin=Math.abs(n/r),this.cos=Math.abs(i/r),window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0),this._transforming=!0;var a=t.target.getAbsolutePosition(),o=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},this._fire("transformstart",{evt:t,target:this.getNode()}),this._nodes.forEach((function(e){e._fire("transformstart",{evt:t,target:e})}))},e.prototype._handleMouseMove=function(t){var e,i,n,r=this.findOne("."+this._movingAnchorName),o=r.getStage();o.setPointersPositions(t);var s=o.getPointerPosition(),h={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y},c=r.getAbsolutePosition();r.setAbsolutePosition(h);var l=r.getAbsolutePosition();if(c.x!==l.x||c.y!==l.y)if("rotater"!==this._movingAnchorName){var u=this.keepRatio()||t.shiftKey,d=this.centeredScaling()||t.altKey;if("top-left"===this._movingAnchorName){if(u){var p=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};n=Math.sqrt(Math.pow(p.x-r.x(),2)+Math.pow(p.y-r.y(),2));var f=this.findOne(".top-left").x()>p.x?-1:1,m=this.findOne(".top-left").y()>p.y?-1:1;e=n*this.cos*f,i=n*this.sin*m,this.findOne(".top-left").x(p.x-e),this.findOne(".top-left").y(p.y-i)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(r.y());else if("top-right"===this._movingAnchorName){u&&(p=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()},n=Math.sqrt(Math.pow(r.x()-p.x,2)+Math.pow(p.y-r.y(),2)),f=this.findOne(".top-right").x()<p.x?-1:1,m=this.findOne(".top-right").y()>p.y?-1:1,e=n*this.cos*f,i=n*this.sin*m,this.findOne(".top-right").x(p.x+e),this.findOne(".top-right").y(p.y-i));var g=r.position();this.findOne(".top-left").y(g.y),this.findOne(".bottom-right").x(g.x)}else"middle-left"===this._movingAnchorName?this.findOne(".top-left").x(r.x()):"middle-right"===this._movingAnchorName?this.findOne(".bottom-right").x(r.x()):"bottom-left"===this._movingAnchorName?(u&&(p=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()},n=Math.sqrt(Math.pow(p.x-r.x(),2)+Math.pow(r.y()-p.y,2)),f=p.x<r.x()?-1:1,m=r.y()<p.y?-1:1,e=n*this.cos*f,i=n*this.sin*m,r.x(p.x-e),r.y(p.y+i)),g=r.position(),this.findOne(".top-left").x(g.x),this.findOne(".bottom-right").y(g.y)):"bottom-center"===this._movingAnchorName?this.findOne(".bottom-right").y(r.y()):"bottom-right"===this._movingAnchorName?u&&(p=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()},n=Math.sqrt(Math.pow(r.x()-p.x,2)+Math.pow(r.y()-p.y,2)),f=this.findOne(".bottom-right").x()<p.x?-1:1,m=this.findOne(".bottom-right").y()<p.y?-1:1,e=n*this.cos*f,i=n*this.sin*m,this.findOne(".bottom-right").x(p.x+e),this.findOne(".bottom-right").y(p.y+i)):console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(d=this.centeredScaling()||t.altKey){var v=this.findOne(".top-left"),y=this.findOne(".bottom-right"),x=v.x(),b=v.y(),_=this.getWidth()-y.x(),w=this.getHeight()-y.y();y.move({x:-x,y:-b}),v.move({x:_,y:w}
12)}var M=this.findOne(".top-left").getAbsolutePosition();e=M.x,i=M.y;var S=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),T=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:e,y:i,width:S,height:T,rotation:a.getAngle(this.rotation())},t)}else{var E=this._getNodeRect();e=r.x()-E.width/2,i=-r.y()+E.height/2;var A=Math.atan2(-i,e);E.height<0&&(A-=Math.PI);var P=a.getAngle(this.rotation())+A,C=a.getAngle(this.rotationSnapTolerance()),L=ne(E,function(t,e,i){for(var n=e,r=0;r<t.length;r++){var o=a.getAngle(t[r]),s=Math.abs(o-e)%(2*Math.PI);Math.min(s,2*Math.PI-s)<i&&(n=o)}return n}(this.rotationSnaps(),P,C)-E.rotation);this._fitNodesInto(L,t)}},e.prototype._handleMouseUp=function(t){this._removeEvents(t)},e.prototype.getAbsoluteTransform=function(){return this.getTransform()},e.prototype._removeEvents=function(t){if(this._transforming){this._transforming=!1,window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0);var e=this.getNode();this._fire("transformend",{evt:t,target:e}),e&&this._nodes.forEach((function(e){e._fire("transformend",{evt:t,target:e})})),this._movingAnchorName=null}},e.prototype._fitNodesInto=function(t,e){var i=this,n=this._getNodeRect();if(m._inRange(t.width,2*-this.padding()-1,1))this.update();else if(m._inRange(t.height,2*-this.padding()-1,1))this.update();else{var r=new c;if(r.rotate(a.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){var o=r.point({x:2*-this.padding(),y:0});t.x+=o.x,t.y+=o.y,t.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y}else this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0&&(o=r.point({x:2*this.padding(),y:0}),this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,t.width+=2*this.padding());if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0?(o=r.point({x:0,y:2*-this.padding()}),t.x+=o.x,t.y+=o.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,t.height+=2*this.padding()):this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0&&(o=r.point({x:0,y:2*this.padding()}),this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,t.height+=2*this.padding()),this.boundBoxFunc()){var s=this.boundBoxFunc()(n,t);s?t=s:m.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}var h=new c;h.translate(n.x,n.y),h.rotate(n.rotation),h.scale(n.width/1e7,n.height/1e7);var l=new c;l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(t.width/1e7,t.height/1e7);var u=l.multiply(h.invert());this._nodes.forEach((function(t){var n,r=t.getParent().getAbsoluteTransform(),a=t.getTransform().copy();a.translate(t.offsetX(),t.offsetY());var o=new c;o.multiply(r.copy().invert()).multiply(u).multiply(r).multiply(a);var s=o.decompose();t.setAttrs(s),i._fire("transform",{evt:e,target:t}),t._fire("transform",{evt:e,target:t}),null===(n=t.getLayer())||void 0===n||n.batchDraw()})),this.rotation(m._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}},e.prototype.forceUpdate=function(){this._resetTransformCache(),this.update()},e.prototype._batchChangeChild=function(t,e){this.findOne(t).setAttrs(e)},e.prototype.update=function(){var t,e=this,i=this._getNodeRect();this.rotation(m._getRotation(i.rotation));var n=i.width,r=i.height,a=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),h=this.anchorSize();this.find("._anchor").each((function(t){t.setAttrs({width:h,height:h,offsetX:h/2,offsetY:h/2,stroke:e.anchorStroke(),strokeWidth:e.anchorStrokeWidth(),fill:e.anchorFill(),cornerRadius:e.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:h/2+s,offsetY:h/2+s,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:2.5,height:h-5,offsetY:h/2+s,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:h/2-s,offsetY:h/2+s,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:2.5,y:r/2,width:h-5,offsetX:h/2+s,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n+2.5,y:r/2,width:h-5,offsetX:h/2-s,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:h/2+s,offsetY:h/2-s,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r+2.5,height:h-5,offsetY:h/2-s,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:h/2-s,offsetY:h/2-s,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n+this.rotateAnchorOffset(),y:r/2,offsetX:0,offsetY:12,width:24,height:24,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(t=this.getLayer())||void 0===t||t.batchDraw()},e.prototype.isTransforming=function(){return this._transforming},e.prototype.stopTransform=function(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);
12t&&t.stopDrag()}},e.prototype.destroy=function(){return this.getStage()&&this._cursorChange&&(this.getStage().content.style.cursor=""),mt.prototype.destroy.call(this),this.detach(),this._removeEvents(),this},e.prototype.toObject=function(){return W.prototype.toObject.call(this)},e}(mt);re.prototype.className="Transformer",s(re),S.addGetterSetter(re,"enabledAnchors",ee,(function(t){return t instanceof Array||m.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach((function(t){-1===ee.indexOf(t)&&m.warn("Unknown anchor name: "+t+". Available names are: "+ee.join(", "))})),t||[]})),S.addGetterSetter(re,"resizeEnabled",!0),S.addGetterSetter(re,"anchorSize",10,y()),S.addGetterSetter(re,"rotateEnabled",!0),S.addGetterSetter(re,"rotationSnaps",[]),S.addGetterSetter(re,"rotateAnchorOffset",50,y()),S.addGetterSetter(re,"rotationSnapTolerance",5,y()),S.addGetterSetter(re,"borderEnabled",!0),S.addGetterSetter(re,"anchorStroke","rgb(0, 161, 255)"),S.addGetterSetter(re,"anchorStrokeWidth",1,y()),S.addGetterSetter(re,"anchorFill","white"),S.addGetterSetter(re,"anchorCornerRadius",0,y()),S.addGetterSetter(re,"borderStroke","rgb(0, 161, 255)"),S.addGetterSetter(re,"borderStrokeWidth",1,y()),S.addGetterSetter(re,"borderDash"),S.addGetterSetter(re,"keepRatio",!0),S.addGetterSetter(re,"centeredScaling",!1),S.addGetterSetter(re,"ignoreStroke",!1),S.addGetterSetter(re,"padding",0,y()),S.addGetterSetter(re,"node"),S.addGetterSetter(re,"nodes"),S.addGetterSetter(re,"boundBoxFunc"),S.addGetterSetter(re,"shouldOverdrawWholeArea",!1),S.backCompat(re,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledH
12andlers:"enabledAnchors"}),h.mapMethods(re);var ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.radius(),0,a.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius(t/2)},e.prototype.setHeight=function(t){this.radius(t/2)},e}(lt);function oe(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}ae.prototype.className="Wedge",ae.prototype._centroid=!0,ae.prototype._attrsAffectingSize=["radius"],s(ae),S.addGetterSetter(ae,"radius",0,y()),S.addGetterSetter(ae,"angle",0,y()),S.addGetterSetter(ae,"clockwise",!1),S.backCompat(ae,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),h.mapMethods(ae);var se=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,39
126,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],he=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function ce(t,e,i,n,r){var a=i-e,o=r-n;return 0===a?n+o/2:0===o?n:o*((t-e)/a)+n}function le(t,e,i){var n=4*(i*t.width+e),r=[];return r.push(t.data[n++],t.data[n++],t.data[n++],t.data[n++]),r}function ue(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}return S.addGetterSetter(W,"blurRadius",0,y(),S.afterSetFilter),S.addGetterSetter(W,"brightness",0,y(),S.afterSetFilter),S.addGetterSetter(W,"contrast",0,y(),S.afterSetFilter),S.addGetterSetter(W,"embossStrength",.5,y(),S.afterSetFilter),S.addGetterSetter(W,"embossWhiteLevel",.5,y(),S.afterSetFilter),S.addGetterSetter(W,"embossDirection","top-left",null,S.afterSetFilter),S.addGetterSetter(W,"embossBlend",!1,null,S.afterSetFilter),S.addGetterSetter(W,"enhance",0,y(),S.afterSetFilter),S.addGetterSetter(W,"hue",0,y(),S.afterSetFilter),S.addGetterSetter(W,"saturation",0,y(),S.afterSetFilter),S.addGetterSetter(W,"luminance",0,y(),S.afterSetFilter),S.addGetterSetter(W,"hue",0,y(),S.afterSetFilter),S.addGetterSetter(W,"saturation",0,y(),S.afterSetFilter),S.addGetterSetter(W,"value",0,y(),S.afterSetFilter),S.addGetterSetter(W,"kaleidoscopePower",2,y(),S.afterSetFilter),S.addGetterSetter(W,"kaleidoscopeAngle",0,y(),S.afterSetFilter),S.addGetterSetter(W,"threshold",0,y(),S.afterSetFilter),S.addGetterSetter(W,"noise",.2,y(),S.afterSetFilter),S.addGetterSetter(W,"pixelSize",8,y(),S.afterSetFilter),S.addGetterSetter(W,"levels",.5,y(),S.afterSetFilter),S.addGetterSetter(W,"red",0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),S.addGetterSetter(W,"green",0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),S.addGetterSetter(W,"blue",0,v,S.afterSetFilter),S.addGetterSetter(W,"red",0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),S.addGetterSetter(W,"green",0,(function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)})),S.addGetterSetter(W,"blue",0,v,S.afterSetFilter),S.addGetterSetter(W,"alpha",1,(function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t})),S.addGetterSetter(W,"threshold",.5,y(),S.afterSetFilter),St.Util._assign(St,{Arc:Tt,Arrow:At,Circle:Pt,Ellipse:Ct,Image:Lt,Label:Ot,Tag:Dt,Line:Et,Path:Nt,Rect:kt,RegularPolygon:Ft,Ring:zt,Sprite:Ut,Star:Bt,Text:Yt,TextPath:Jt,Transformer:re,Wedge:ae,Filters:{Blur:function(t){var e=Math.round(this.blurRadius());e>0&&function(t,e){var i,n,r,a,o,s,h,c,l,u,d,p,f,m,g,v,y,x,b,_,w,M,S,T,E=t.data,A=t.width,P=t.height,C=e+e+1,L=A-1,R=P-1,I=e+1,O=I*(I+1)/2,D=new oe,N=null,k=D,F=null,G=null,z=se[e],U=he[e];for(r=1;r<C;r++)k=k.next=new oe,r===I&&(N=k);for(k.next=D,h=s=0,n=0;n<P;n++){for(v=y=x=b=c=l=u=d=0,p=I*(_=E[s]),f=I*(w=E[s+1]),m=I*(M=E[s+2]),g=I*(S=E[s+3]),c+=O*_,l+=O*w,u+=O*M,d+=O*S,k=D,r=0;r<I;r++)k.r=_,k.g=w,k.b=M,k.a=S,k=k.next;for(r=1;r<I;r++)a=s+((L<r?L:r)<<2),c+=(k.r=_=E[a])*(T=I-r),l+=(k.g=w=E[a+1])*T,u+=(k.b=M=E[a+2])*T,d+=(k.a=S=E[a+3])*T,v+=_,y+=w,x+=M,b+=S,k=k.next;for(F=D,G=N,i=0;i<A;i++)E[s+3]=S=d*z>>U,0!==S?(S=255/S,E[s]=(c*z>>U)*S,E[s+1]=(l*z>>U)*S,E[s+2]=(u*z>>U)*S):E[s]=E[s+1]=E[s+2]=0,c-=p,l-=f,u-=m,d-=g,p-=F.r,f-=F.g,m-=F.b,g-=F.a,a=h+((a=i+e+1)<L?a:L)<<2,c+=v+=F.r=E[a],l+=y+=F.g=E[a+1],u+=x+=F.b=E[a+2],d+=b+=F.a=E[a+3],F=F.next,p+=_=G.r,f+=w=G.g,m+=M=G.b,g+=S=G.a,v-=_,y-=w,x-=M,b-=S,G=G.next,s+=4;h+=A}for(i=0;i<A;i++){for(y=x=b=v=l=u=d=c=0,p=I*(_=E[s=i<<2]),f=I*(w=E[s+1]),m=I*(M=E[s+2]),g=I*(S=E[s+3]),c+=O*_,l+=O*w,u+=O*M,d+=O*S,k=D,r=0;r<I;r++)k.r=_,k.g=w,k.b=M,k.a=S,k=k.next;for(o=A,r=1;r<=e;r++)s=o+i<<2,c+=(k.r=_=E[s])*(T=I-r),l+=(k.g=w=E[s+1])*T,u+=(k.b=M=E[s+2])*T,d+=(k.a=S=E[s+3])*T,v+=_,y+=w,x+=M,b+=S,k=k.next,r<R&&(o+=A);for(s=i,F=D,G=N,n=0;n<P;n++)E[3+(a=s<<2)]=S=d*z>>U,S>0?(S=255/S,E[a]=(c*z>>U)*S,E[a+1]=(l*z>>
12U)*S,E[a+2]=(u*z>>U)*S):E[a]=E[a+1]=E[a+2]=0,c-=p,l-=f,u-=m,d-=g,p-=F.r,f-=F.g,m-=F.b,g-=F.a,a=i+((a=n+I)<R?a:R)*A<<2,c+=v+=F.r=E[a],l+=y+=F.g=E[a+1],u+=x+=F.b=E[a+2],d+=b+=F.a=E[a+3],F=F.next,p+=_=G.r,f+=w=G.g,m+=M=G.b,g+=S=G.a,v-=_,y-=w,x-=M,b-=S,G=G.next,s+=A}}(t,e)},Brighten:function(t){var e,i=255*this.brightness(),n=t.data,r=n.length;for(e=0;e<r;e+=4)n[e]+=i,n[e+1]+=i,n[e+2]+=i},Contrast:function(t){var e,i=Math.pow((this.contrast()+100)/100,2),n=t.data,r=n.length,a=150,o=150,s=150;for(e=0;e<r;e+=4)a=n[e],o=n[e+1],s=n[e+2],a/=255,a-=.5,a*=i,a+=.5,o/=255,o-=.5,o*=i,o+=.5,s/=255,s-=.5,s*=i,s+=.5,a=(a*=255)<0?0:a>255?255:a,o=(o*=255)<0?0:o>255?255:o,s=(s*=255)<0?0:s>255?255:s,n[e]=a,n[e+1]=o,n[e+2]=s},Emboss:function(t){var e=10*this.embossStrength(),i=255*this.embossWhiteLevel(),n=this.embossDirection(),r=this.embossBlend(),a=0,o=0,s=t.data,h=t.width,c=t.height,l=4*h,u=c;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:m.error("Unknown emboss direction: "+n)}do{var d=(u-1)*l,p=a;u+p<1&&(p=0),u+p>c&&(p=0);var f=(u-1+p)*h*4,g=h;do{var v=d+4*(g-1),y=o;g+y<1&&(y=0),g+y>h&&(y=0);var x=f+4*(g-1+y),b=s[v]-s[x],_=s[v+1]-s[x+1],w=s[v+2]-s[x+2],M=b,S=M>0?M:-M;if((_>0?_:-_)>S&&(M=_),(w>0?w:-w)>S&&(M=w),M*=e,r){var T=s[v]+M,E=s[v+1]+M,A=s[v+2]+M;s[v]=T>255?255:T<0?0:T,s[v+1]=E>255?255:E<0?0:E,s[v+2]=A>255?255:A<0?0:A}else{var P=i-M;P<0?P=0:P>255&&(P=255),s[v]=s[v+1]=s[v+2]=P}}while(--g)}while(--u)},Enhance:function(t){var e,i,n,r,a=t.data,o=a.length,s=a[0],h=s,c=a[1],l=c,u=a[2],d=u,p=this.enhance();if(0!==p){for(r=0;r<o;r+=4)(e=a[r+0])<s?s=e:e>h&&(h=e),(i=a[r+1])<c?c=i:i>l&&(l=i),(n=a[r+2])<u?u=n:n>d&&(d=n);var f,m,g,v,y,x,b,_,w;for(h===s&&(h=255,s=0),l===c&&(l=255,c=0),d===u&&(d=255,u=0),p>0?(m=h+p*(255-h),g=s-p*(s-0),y=l+p*(255-l),x=c-p*(c-0),_=d+p*(255-d),w=u-p*(u-0)):(m=h+p*(h-(f=.5*(h+s))),g=s+p*(s-f),y=l+p*(l-(v=.5*(l+c))),x=c+p*(c-v),_=d+p*(d-(b=.5*(d+u))),w=u+p*(u-b)),r=0;r<o;r+=4)a[r+0]=ce(a[r+0],s,h,g,m),a[r+1]=ce(a[r+1],c,l,x,y),a[r+2]=ce(a[r+2],u,d,w,_)}},Grayscale:function(t){var e,i,n=t.data,r=n.length;for(e=0;e<r;e+=4)i=.34*n[e]+.5*n[e+1]+.16*n[e+2],n[e]=i,n[e+1]=i,n[e+2]=i},HSL:function(t){var e,i,n,r,a,o=t.data,s=o.length,h=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,l=127*this.luminance(),u=1*h*Math.cos(c*Math.PI/180),d=1*h*Math.sin(c*Math.PI/180),p=.299+.701*u+.167*d,f=.587-.587*u+.33*d,m=.114-.114*u-.497*d,g=.299-.299*u-.328*d,v=.587+.413*u+.035*d,y=.114-.114*u+.293*d,x=.299-.3*u+1.25*d,b=.587-.586*u-1.05*d,_=.114+.886*u-.2*d;for(e=0;e<s;e+=4)i=o[e+0],n=o[e+1],r=o[e+2],a=o[e+3],o[e+0]=p*i+f*n+m*r+l,o[e+1]=g*i+v*n+y*r+l,o[e+2]=x*i+b*n+_*r+l,o[e+3]=a},HSV:function(t){var e,i,n,r,a,o=t.data,s=o.length,h=Math.pow(2,this.value()),c=Math.pow(2,this.saturation()),l=Math.abs(this.hue()+360)%360,u=h*c*Math.cos(l*Math.PI/180),d=h*c*Math.sin(l*Math.PI/180),p=.299*h+.701*u+.167*d,f=.587*h-.587*u+.33*d,m=.114*h-.114*u-.497*d,g=.299*h-.299*u-.328*d,v=.587*h+.413*u+.035*d,y=.114*h-.114*u+.293*d,x=.299*h-.3*u+1.25*d,b=.587*h-.586*u-1.05*d,_=.114*h+.886*u-.2*d;for(e=0;e<s;e+=4)i=o[e+0],n=o[e+1],r=o[e+2],a=o[e+3],o[e+0]=p*i+f*n+m*r,o[e+1]=g*i+v*n+y*r,o[e+2]=x*i+b*n+_*r,o[e+3]=a},Invert:function(t){var e,i=t.data,n=i.length;for(e=0;e<n;e+=4)i[e]=255-i[e],i[e+1]=255-i[e+1],i[e+2]=255-i[e+2]},Kaleidoscope:function(t){var e,i,n,r,a,o,s,h,c,l=t.width,u=t.height,d=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),f=Math.floor(l*(p%360)/360);if(!(d<1)){var g=m.createCanvasElement();g.width=l,g.height=u;var v=g.getContext("2d").getImageData(0,0,l,u);!function(t,e,i){var n,r,a,o,s=t.data,h=e.data,c=t.width,l=t.height,u=i.polarCenterX||c/2,d=i.polarCenterY||l/2,p=0,f=0,m=0,g=0,v=Math.sqrt(u*u+d*d);r=c-u,a=l-d,v=(o=Math.sqrt(r*r+a*a))>v?o:v;var y,x,b,_,w=l,M=c,S=360/M*Math.PI/180;for(x=0;x<M;x+=1)for(b=Math.sin(x*S),_=Math.cos(x*S),y=0;y<w;y+=1)r=Math.floor(u+v*y/w*_),p=s[0+(n=4*((a=Math.floor(d+v*y/w*b))*c+r))],f=s[n+1],m=s[n+2],g=s[n+3],h[0+(n=4*(x+y*c))]=p,h[n+1]=f,h[n+2]=m,h[n+3]=g}(t,v,{polarCenterX:l/2,polarCenterY:u/2});for(var y=l/Math.pow(2,d);y<=8;)y*=2,d-=1;var x=y=Math.ceil(y),b=0,_=x,w=1;for(f+y>l&&(b=x,_=0,w=-1),i=0;i<u;i+=1)for(e=b;e!==_;e+=w)h=4*(l*i+Math.round(e+f)%l),r=v.data[h+0],a=v.data[h+1],o=v.data[h+2],s=v.data[h+3],c=4*(l*i+e),v.data[c+0]=r,v.data[c+1]=a,v.data[c+2]=o,v.data[c+3]=s;for(i=0;i<u;i+=1)for(x=Math.floor(y),n=0;n<d;n+=1){for(e=0;e<x+1;e+=1)h=4*(l*i+e),r=v.data[h+0],a=v.data[h+1],o=v.data[h+2],s=v.data[h+3],c=4*(l*i+2*x-e-1),v.data[c+0]=r,v.data[c+1]=a,v.data[c+2]=o,v.data[c+3]=s;x*=2}
12!function(t,e,i){var n,r,a,o,s,h,c=t.data,l=e.data,u=t.width,d=t.height,p=i.polarCenterX||u/2,f=i.polarCenterY||d/2,m=0,g=0,v=0,y=0,x=Math.sqrt(p*p+f*f);r=u-p,a=d-f,x=(h=Math.sqrt(r*r+a*a))>x?h:x;var b,_,w,M=d,S=u,T=i.polarRotation||0;for(r=0;r<u;r+=1)for(a=0;a<d;a+=1)o=r-p,s=a-f,b=Math.sqrt(o*o+s*s)*M/x,_=(_=(180*Math.atan2(s,o)/Math.PI+360+T)%360)*S/360,w=Math.floor(_),m=c[0+(n=4*(Math.floor(b)*u+w))],g=c[n+1],v=c[n+2],y=c[n+3],l[0+(n=4*(a*u+r))]=m,l[n+1]=g,l[n+2]=v,l[n+3]=y}(v,t,{polarRotation:0})}},Mask:function(t){var e=function(t,e){var i=le(t,0,0),n=le(t,t.width-1,0),r=le(t,0,t.height-1),a=le(t,t.width-1,t.height-1),o=e||10;if(ue(i,n)<o&&ue(n,a)<o&&ue(a,r)<o&&ue(r,i)<o){for(var s=function(t){for(var e=[0,0,0],i=0;i<t.length;i++)e[0]+=t[i][0],e[1]+=t[i][1],e[2]+=t[i][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}([n,i,a,r]),h=[],c=0;c<t.width*t.height;c++){var l=ue(s,[t.data[4*c],t.data[4*c+1],t.data[4*c+2]]);h[c]=l<o?0:255}return h}}(t,this.threshold());return e&&function(t,e){for(var i=0;i<t.width*t.height;i++)t.data[4*i+3]=e[i]}(t,e=function(t,e,i){for(var n=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],r=Math.round(Math.sqrt(n.length)),a=Math.floor(r/2),o=[],s=0;s<i;s++)for(var h=0;h<e;h++){for(var c=s*e+h,l=0,u=0;u<r;u++)for(var d=0;d<r;d++){var p=s+u-a,f=h+d-a;if(p>=0&&p<i&&f>=0&&f<e){var m=n[u*r+d];l+=t[p*e+f]*m}}o[c]=l}return o}
12(e=function(t,e,i){for(var n=[1,1,1,1,1,1,1,1,1],r=Math.round(Math.sqrt(n.length)),a=Math.floor(r/2),o=[],s=0;s<i;s++)for(var h=0;h<e;h++){for(var c=s*e+h,l=0,u=0;u<r;u++)for(var d=0;d<r;d++){var p=s+u-a,f=h+d-a;if(p>=0&&p<i&&f>=0&&f<e){var m=n[u*r+d];l+=t[p*e+f]*m}}o[c]=l>=1020?255:0}return o}(e=function(t,e,i){for(var n=[1,1,1,1,0,1,1,1,1],r=Math.round(Math.sqrt(n.length)),a=Math.floor(r/2),o=[],s=0;s<i;s++)for(var h=0;h<e;h++){for(var c=s*e+h,l=0,u=0;u<r;u++)for(var d=0;d<r;d++){var p=s+u-a,f=h+d-a;if(p>=0&&p<i&&f>=0&&f<e){var m=n[u*r+d];l+=t[p*e+f]*m}}o[c]=2040===l?255:0}return o}(e,t.width,t.height),t.width,t.height),t.width,t.height)),t},Noise:function(t){var e,i=255*this.noise(),n=t.data,r=n.length,a=i/2;for(e=0;e<r;e+=4)n[e+0]+=a-2*a*Math.random(),n[e+1]+=a-2*a*Math.random(),n[e+2]+=a-2*a*Math.random()},Pixelate:function(t){var e,i,n,r,a,o,s,h,c,l,u,d,p,f,g=Math.ceil(this.pixelSize()),v=t.width,y=t.height,x=Math.ceil(v/g),b=Math.ceil(y/g),_=t.data;if(g<=0)m.error("pixelSize value can not be <= 0");else for(d=0;d<x;d+=1)for(p=0;p<b;p+=1){for(r=0,a=0,o=0,s=0,c=(h=d*g)+g,u=(l=p*g)+g,f=0,e=h;e<c;e+=1)if(!(e>=v))for(i=l;i<u;i+=1)i>=y||(r+=_[0+(n=4*(v*i+e))],a+=_[n+1],o+=_[n+2],s+=_[n+3],f+=1);for(r/=f,a/=f,o/=f,s/=f,e=h;e<c;e+=1)if(!(e>=v))for(i=l;i<u;i+=1)i>=y||(_[0+(n=4*(v*i+e))]=r,_[n+1]=a,_[n+2]=o,_[n+3]=s)}},Posterize:function(t){var e,i=Math.round(254*this.levels())+1,n=t.data,r=n.length,a=255/i;for(e=0;e<r;e+=1)n[e]=Math.floor(n[e]/a)*a},RGB:function(t){var e,i,n=t.data,r=n.length,a=this.red(),o=this.green(),s=this.blue();for(e=0;e<r;e+=4)i=(.34*n[e]+.5*n[e+1]+.16*n[e+2])/255,n[e]=i*a,n[e+1]=i*o,n[e+2]=i*s,n[e+3]=n[e+3]},RGBA:function(t){var e,i,n=t.data,r=n.length,a=this.red(),o=this.green(),s=this.blue(),h=this.alpha();for(e=0;e<r;e+=4)i=1-h,n[e]=a*h+n[e]*i,n[e+1]=o*h+n[e+1]*i,n[e+2]=s*h+n[e+2]*i},Sepia:function(t){var e,i,n,r,a=t.data,o=a.length;for(e=0;e<o;e+=4)i=a[e+0],n=a[e+1],r=a[e+2],a[e+0]=Math.min(255,.393*i+.769*n+.189*r),a[e+1]=Math.min(255,.349*i+.686*n+.168*r),a[e+2]=Math.min(255,.272*i+.534*n+.131*r)},Solarize:function(t){var e=t.data,i=t.width,n=4*i,r=t.height;do{var a=(r-1)*n,o=i;do{var s=a+4*(o-1),h=e[s],c=e[s+1],l=e[s+2];h>127&&(h=255-h),c>127&&(c=255-c),l>127&&(l=255-l),e[s]=h,e[s+1]=c,e[s+2]=l}while(--o)}while(--r)},Threshold:function(t){var e,i=255*this.threshold(),n=t.data,r=n.length;for(e=0;e<r;e+=1)n[e]=n[e]<i?0:255}}})},t.exports=i()}).call(this,i(32))},function(t,e,i){"use strict";var n=i(6),r=Object.prototype.toString;function a(t){return"[object Array]"===r.call(t)}function o(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function h(t){if("[object Object]"!==r.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===r.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var i=0,n=t.length;i<n;i++)e.call(null,t[i],i,t);else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.call(null,t[r],r,t)}t.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===r.call(t)},isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:h,isUndefined:o,isDate:function(t){return"[object Date]"===r.call(t)},isFile:function(t){return"[object File]"===r.call(t)},isBlob:function(t){return"[object Blob]"===r.call(t)},isFunction:c,isStream:function(t){return s(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}
12,forEach:l,merge:function t(){var e={};function i(i,n){h(e[n])&&h(i)?e[n]=t(e[n],i):h(i)?e[n]=t({},i):a(i)?e[n]=i.slice():e[n]=i}for(var n=0,r=arguments.length;n<r;n++)l(arguments[n],i);return e},extend:function(t,e,i){return l(e,(function(e,r){t[r]=i&&"function"==typeof e?n(e,i):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,i){t.exports=i(14)},function(t,e,i){"use strict";(function(e){var n=i(1),r=i(19),a=i(8),o={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var h,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(h=i(9)),h),transformRequest:[function(t,e){return r(e,"Accept"),r(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)||e&&"application/json"===e["Content-Type"]?(s(e,"application/json"),function(t,e,i){if(n.isString(t))try{return(e||JSON.parse)(t),n.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(i||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional,i=e&&e.silentJSONParsing,r=e&&e.forcedJSONParsing,o=!i&&"json"===this.responseType;if(o||r&&n.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw a(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){c.headers[t]=n.merge(o)})),t.exports=c}).call(this,i(5))},function(t,e,i){"use strict";(function(t){var i,n={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-n.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*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}},r="undefined"==typeof self&&void 0!==t&&t.hrtime?function(){var e=t.hrtime();return 1e3*e[0]+e[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()},a=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=r()),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 n=0;n<i.length;n++){var a=this._tweens[i[n]],o=!e;a&&!1===a.update(t,o)&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),o={Linear:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),a=o.Utils.Linear;return e<0?a(t[0],t[1],n):e>1?a(t[i],t[i-1],i-n):a(t[r],t[r+1>i?i:r+1],n-r)},Bezier:function(t,e){for(var i=0,n=t.length-1,r=Math.pow,a=o.Utils.Bernstein,s=0;s<=n;s++)i+=r(1-e,n-s)*r(e,s)*t[s]*a(n,s);return i},CatmullRom:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),a=o.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),a(t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i],n-r)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2],n-r)}
12,Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=o.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:(i=[1],function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}),CatmullRom:function(t,e,i,n,r){var a=.5*(i-t),o=.5*(n-e),s=r*r;return(2*e-2*i+a+o)*(r*s)+(-3*e+3*i-2*a-o)*s+a*r+e}}},s=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),h=new a,c=function(){function t(t,e){void 0===e&&(e=h),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=n.Linear.None,this._interpolationFunction=o.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=s.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?r()+parseFloat(t):t:r(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,i,n){for(var r in i){var a=t[r],o=Array.isArray(a),s=o?"array":typeof a,h=!o&&Array.isArray(i[r]);if("undefined"!==s&&"function"!==s){if(h){var c=i[r];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,a)),i[r]=[a].concat(c)}if("object"!==s&&!o||!a||h)void 0===e[r]&&(e[r]=a),o||(e[r]*=1),n[r]=h?i[r].slice().reverse():e[r]||0;else{for(var l in e[r]=o?[]:{},a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],i[r],n[r])}}}},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=r()),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=r()),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=r()),void 0===e&&(e=!0),this._isPaused)return!0;var i,n,a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>a)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),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var o=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){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 s=0,h=this._chainedTweens.length;s<h;s++)this._chainedTweens[s].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0}
12,t.prototype._updateProperties=function(t,e,i,n){for(var r in i)if(void 0!==e[r]){var a=e[r]||0,o=i[r],s=Array.isArray(t[r]),h=Array.isArray(o);!s&&h?t[r]=this._interpolationFunction(o,n):"object"==typeof o&&o?this._updateProperties(t[r],a,o,n):"number"==typeof(o=this._handleRelativeValue(a,o))&&(t[r]=a+(o-a)*n)}},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}(),l=s.nextId,u=h,d=u.getAll.bind(u),p=u.removeAll.bind(u),f=u.add.bind(u),m=u.remove.bind(u),g=u.update.bind(u),v={Easing:n,Group:a,Interpolation:o,now:r,Sequence:s,nextId:l,Tween:c,VERSION:"18.6.4",getAll:d,removeAll:p,add:f,remove:m,update:g};e.a=v}).call(this,i(5))},function(t,e){var i,n,r=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(t){i=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,c=[],l=!1,u=-1;function d(){l&&h&&(l=!1,h.length?c=h.concat(c):u=-1,c.length&&p())}function p(){if(!l){var t=s(d);l=!0;for(var e=c.length;e;){for(h=c,c=[];++u<e;)h&&h[u].run();u=-1,e=c.length}h=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new f(t,e)),1!==c.length||l||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,i){"use strict";t.exports=function(t,e){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return t.apply(e,i)}}},function(t,e,i){"use strict";var n=i(1);function r(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,i){if(!e)return t;var a;if(i)a=i(e);else if(n.isURLSearchParams(e))a=e.toString();else{var o=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),o.push(r(e)+"="+r(t))})))})),a=o.join("&")}if(a){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}},function(t,e,i){"use strict";t.exports=function(t,e,i,n,r){return t.config=e,i&&(t.code=i),t.request=n,t.response=r,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}}
vendor: 1,536 bytes, line 12
12,function(t,e,i){"use strict";var n=i(1),r=i(20),a=i(21),o=i(7),s=i(22),h=i(25),c=i(26),l=i(10);t.exports=function(t){return new Promise((function(e,i){var u=t.data,d=t.headers,p=t.responseType;n.isFormData(u)&&delete d["Content-Type"];var f=new XMLHttpRequest;if(t.auth){var m=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+g)}var v=s(t.baseURL,t.url);function y(){if(f){var n="getAllResponseHeaders"in f?h(f.getAllResponseHeaders()):null,a={data:p&&"text"!==p&&"json"!==p?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:t,request:f};r(e,i,a),f=null}}if(f.open(t.method.toUpperCase(),o(v,t.params,t.paramsSerializer),!0),f.timeout=t.timeout,"onloadend"in f?f.onloadend=y:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(y)},f.onabort=function(){f&&(i(l("Request aborted",t,"ECONNABORTED",f)),f=null)},f.onerror=function(){i(l("Network Error",t,null,f)),f=null},f.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(l(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},n.isStandardBrowserEnv()){var x=(t.withCredentials||c(v))&&t.xsrfCookieName?a.read(t.xsrfCookieName):void 0;x&&(d[t.xsrfHeaderName]=x)}"setRequestHeader"in f&&n.forEach(d,(function(t,e){void 0===u&&"content-type"===e.toLowerCase()?delete d[e]:f.setRequestHeader(e,t)}
12)),n.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),p&&"json"!==p&&(f.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&f.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){f&&(f.abort(),i(t),f=null)})),u||(u=null),f.send(u)}))}},function(t,e,i){"use strict";var n=i(8);t.exports=function(t,e,i,r,a){var o=new Error(t);return n(o,e,i,r,a)}},function(t,e,i){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,i){"use strict";var n=i(1);t.exports=function(t,e){e=e||{};var i={},r=["url","method","data"],a=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function h(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function c(r){n.isUndefined(e[r])?n.isUndefined(t[r])||(i[r]=h(void 0,t[r])):i[r]=h(t[r],e[r])}n.forEach(r,(function(t){n.isUndefined(e[t])||(i[t]=h(void 0,e[t]))})),n.forEach(a,c),n.forEach(o,(function(r){n.isUndefined(e[r])?n.isUndefined(t[r])||(i[r]=h(void 0,t[r])):i[r]=h(void 0,e[r])})),n.forEach(s,(function(n){n in e?i[n]=h(t[n],e[n]):n in t&&(i[n]=h(void 0,t[n]))}));var l=r.concat(a).concat(o).concat(s),u=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===l.indexOf(t)}));return n.forEach(u,c),i}},function(t,e,i){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,i){"use strict";var n=i(1),r=i(6),a=i(15),o=i(12);function s(t){var e=new a(t),i=r(a.prototype.request,e);return n.extend(i,a.prototype,e),n.extend(i,e),i}var h=s(i(3));h.Axios=a,h.create=function(t){return s(o(h.defaults,t))},h.Cancel=i(13),h.CancelToken=i(29),h.isCancel=i(11),h.all=function(t){return Promise.all(t)},h.spread=i(30),h.isAxiosError=i(31),t.exports=h,t.exports.default=h},function(t,e,i){"use strict";var n=i(1),r=i(7),a=i(16),o=i(17),s=i(12),h=i(27),c=h.validators;function l(t){this.defaults=t,this.interceptors={request:new a,response:new a}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&h.assertOptions(e,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var i=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var r,a=[];if(this.interceptors.response.forEach((function(t){a.push(t.fulfilled,t.rejected)})),!n){var l=[o,void 0];for(Array.prototype.unshift.apply(l,i),l=l.concat(a),r=Promise.resolve(t);l.length;)r=r.then(l.shift(),l.shift());return r}for(var u=t;i.length;){var d=i.shift(),p=i.shift();try{u=d(u)}catch(t){p(t);break}}try{r=o(u)}catch(t){return Promise.reject(t)}for(;a.length;)r=r.then(a.shift(),a.shift());return r},l.prototype.getUri=function(t){return t=s(this.defaults,t),r(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,i){return this.request(s(i||{},{method:t,url:e,data:(i||{}).data}))}})),n.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,i,n){return this.request(s(n||{},{method:t,url:e,data:i}))}})),t.exports=l},function(t,e,i){"use strict";var n=i(1);function r(){this.handlers=[]}
12r.prototype.use=function(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=r},function(t,e,i){"use strict";var n=i(1),r=i(18),a=i(11),o=i(3);function s(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return s(t),t.headers=t.headers||{},t.data=r.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return s(t),e.data=r.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return a(e)||(s(t),e&&e.response&&(e.response.data=r.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,i){"use strict";var n=i(1),r=i(3);t.exports=function(t,e,i){var a=this||r;return n.forEach(i,(function(i){t=i.call(a,t,e)})),t}},function(t,e,i){"use strict";var n=i(1);t.exports=function(t,e){n.forEach(t,(function(i,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=i,delete t[n])}))}},function(t,e,i){"use strict";var n=i(10);t.exports=function(t,e,i){var r=i.config.validateStatus;i.status&&r&&!r(i.status)?e(n("Request failed with status code "+i.status,i.config,null,i.request,i)):t(i)}},function(t,e,i){"use strict";var n=i(1);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,i,r,a,o){var s=[];s.push(t+"="+encodeURIComponent(e)),n.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),n.isString(r)&&s.push("path="+r),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,i){"use strict";var n=i(23),r=i(24);t.exports=function(t,e){return t&&!n(e)?r(t,e):e}},function(t,e,i){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,i){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,i){"use strict";var n=i(1),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,i,a,o={};return t?(n.forEach(t.split("\n"),(function(t){if(a=t.indexOf(":"),e=n.trim(t.substr(0,a)).toLowerCase(),i=n.trim(t.substr(a+1)),e){if(o[e]&&r.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([i]):o[e]?o[e]+", "+i:i}})),o):o}},function(t,e,i){"use strict";var n=i(1);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function r(t){var n=t;return e&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return t=r(window.location.href),function(e){var i=n.isString(e)?r(e):e;return i.protocol===t.protocol&&i.host===t.host}}():function(){return!0}},function(t,e,i){"use strict";var n=i(28),r={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){r[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));var a={},o=n.version.split(".");function s(t,e){for(var i=e?e.split("."):o,n=t.split("."),r=0;r<3;r++){if(i[r]>n[r])return!0;if(i[r]<n[r])return!1}return!1}r.transitional=function(t,e,i){var r=e&&s(e);function o(t,e){return"[Axios v"+n.version+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return function(i,n,s){if(!1===t)throw new Error(o(n," has been removed in "+e));return r&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,n,s)}}
12,t.exports={isOlderVersion:s,assertOptions:function(t,e,i){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),r=n.length;r-- >0;){var a=n[r],o=e[a];if(o){var s=t[a],h=void 0===s||o(s,a,t);if(!0!==h)throw new TypeError("option "+a+" must be "+h)}else if(!0!==i)throw Error("Unknown option "+a)}},validators:r}},function(t){t.exports=JSON.parse('{"_from":"axios@^0.21.1","_id":"[email protected]","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"axios@^0.21.1","name":"axios","escapedName":"axios","rawSpec":"^0.21.1","saveSpec":null,"fetchSpec":"^0.21.1"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_shasum":"c67b90dc0568e5c1cf2b0b858c43ba28e2eda575","_spec":"axios@^0.21.1","_where":"/Users/linlaopiao/Downloads/vscodeWorkspace/zwdc3d/new3d","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundleDependencies":false,"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"deprecated":false,"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')},function(t,e,i){"use strict";var n=i(13);function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var i=this;t((function(t){i.reason||(i.reason=new n(t),e(i.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r((function(e){t=e})),cancel:t}},t.exports=r},function(t,e,i){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,i){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";i.r(e),i.d(e,"getHDRPath",(function(){return gl})),i.d(e,"isDef",(function(){return ul})),i.d(e,"json3DTransform",(function(){return dl})),i.d(e,"fullColorHex",(function(){return pl})),i.d(e,"findMaterial",(function(){return ml})),i.d(e,"composeDetail3D",(function(){return Al})),i.d(e,"Zw_previewer",(function(){return _l})),i.d(e,"loadDecoder",(function(){return bl})),i.d(e,"createMatMaps",(function(){return Sl})),i.d(e,"Design",(function(){return Zl})),i.d(e,"preload",(function(){return $l})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");const e=Object(t);for(let t=1;t<arguments.length;t++){const i=arguments[t];if(null!=i)for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}return e});const n=0,r=1,a=2,o=0,s=1,h=2,c=3;function l(){}Object.assign(l.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var n=i.indexOf(e);-1!==n&&i.splice(n,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=e.slice(0),n=0,r=i.length;n<r;n++)i[n].call(this,t)}}}});for(var u=[],d=0;d<256;d++)u[d]=(d<16?"0":"")+d.toString(16);var p,f={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(u[255&t]+u[t>>8&255]+u[t>>16&255]+u[t>>24&255]+"-"+u[255&e]+u[e>>8&255]+"-"+u[e>>16&15|64]+u[e>>24&255]+"-"+u[63&i|128]+u[i>>8&255]+"-"+u[i>>16&255]+u[i>>24&255]+u[255&n]+u[n>>8&255]+u[n>>16&255]+u[n>>24&255]).toUpperCase()}
vendor: 18,092 bytes, line 12
12,clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*f.DEG2RAD},radToDeg:function(t){return t*f.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,n,r){var a=Math.cos,o=Math.sin,s=a(i/2),h=o(i/2),c=a((e+n)/2),l=o((e+n)/2),u=a((e-n)/2),d=o((e-n)/2),p=a((n-e)/2),f=o((n-e)/2);switch(r){case"XYX":t.set(s*l,h*u,h*d,s*c);break;case"YZY":t.set(h*d,s*l,h*u,s*c);break;case"ZXZ":t.set(h*u,h*d,s*l,s*c);break;case"XZX":t.set(s*l,h*f,h*p,s*c);break;case"YXY":t.set(h*p,s*l,h*f,s*c);break;case"ZYZ":t.set(h*f,h*p,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function m(t,e){this.x=t||0,this.y=e||0}function g(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(m.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(m.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*n+t.x,this.y=r*n+a*i+t.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(g.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,a,o,s,h){var c=this.elements;return c[0]=t,c[1]=n,c[2]=o,c[3]=e,c[4]=r,c[5]=s,c[6]=i,c[7]=a,c[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},extractBasis:function(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,a=i[0],o=i[3],s=i[6],h=i[1],c=i[4],l=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],x=n[7],b=n[2],_=n[5],w=n[8];return r[0]=a*f+o*v+s*b,r[3]=a*m+o*y+s*_,r[6]=a*g+o*x+s*w,r[1]=h*f+c*v+l*b,r[4]=h*m+c*y+l*_,r[7]=h*g+c*x+l*w,r[2]=u*f+d*v+p*b,r[5]=u*m+d*y+p*_,r[8]=u*g+d*x+p*w,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],a=t[4],o=t[5],s=t[6],h=t[7],c=t[8];return e*a*c-e*o*h-i*r*c+i*o*s+n*r*h-n*a*s},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var i=t.elements,n=this.elements,r=i[0],a=i[1],o=i[2],s=i[3],h=i[4],c=i[5],l=i[6],u=i[7],d=i[8],p=d*h-c*u,f=c*l-d*s,m=u*s-h*l,g=r*p+a*f+o*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);var v=1/g;return n[0]=p*v,n[1]=(o*u-d*a)*v,n[2]=(c*a-o*h)*v,n[3]=f*v,n[4]=(d*r-o*l)*v,n[5]=(o*s-c*r)*v,n[6]=m*v,n[7]=(a*l-u*r)*v,n[8]=(h*r-a*s)*v,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,i,n,r,a,o){var s=Math.cos(r),h=Math.sin(r);this.set(i*s,i*h,-i*(s*a+h*o)+a+t,-n*h,n*s,-n*(-h*a+s*o)+o+e,0,0,1)},scale:function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],a=n[3],o=n[6],s=n[1],h=n[4],c=n[7];return n[0]=e*r+i*s,n[3]=e*a+i*h,n[6]=e*o+i*c,n[1]=-i*r+e*s,n[4]=-i*a+e*h,n[7]=-i*o+e*c,this},translate:function(t,e){var i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},equals:function(t){for(var e=this.elements,i=t.elements,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}});var v={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===p&&(p=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),p.width=t.width,p.height=t.height;var i=p.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=p}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},y=0;function x(t,e,i,n,r,a,o,s,h,c){Object.defineProperty(this,"id",{value:y++}),this.uuid=f.generateUUID(),this.name="",this.image=void 0!==t?t:x.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:x.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:1001,this.wrapT=void 0!==n?n:1001,this.magFilter=void 0!==r?r:1006,this.minFilter=void 0!==a?a:1008,this.anisotropy=void 0!==h?h:1,this.format=void 0!==o?o:1023,this.internalFormat=null,this.type=void 0!==s?s:1009,this.offset=new m(0,0),this.repeat=new m(1,1),this.center=new m(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new g,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:3e3,this.version=0,this.onUpdate=null}function b(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}function _(t,e,i){this.width=t,this.height=e,this.scissor=new b(0,0,t,e),this.scissorTest=!1,this.viewport=new b(0,0,t,e),i=i||{},this.texture=new x(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:1006,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function w(t,e,i){_.call(this,t,e,i),this.samples=4}function M(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1}x.DEFAULT_IMAGE=void 0,x.DEFAULT_MAPPING=300,x.prototype=Object.assign(Object.create(l.prototype),{constructor:x,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=f.generateUUID()),!e&&void 0===t.images[n.uuid]){var r;if(Array.isArray(n)){r=[];for(var a=0,o=n.length;a<o;a++)r.push(v.getDataURL(n[a]))}else r=v.getDataURL(n);t.images[n.uuid]={uuid:n.uuid,url:r}}i.image=n.uuid}return e||(t.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(x.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(b.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(b.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*n+a[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r,a=t.elements,o=a[0],s=a[4],h=a[8],c=a[1],l=a[5],u=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-c)<.01&&Math.abs(h-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(s+c)<.1&&Math.abs(h+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,g=(l+1)/2,v=(f+1)/2,y=(s+c)/4,x=(h+d)/4,b=(u+p)/4;return m>g&&m>v?m<.01?(i=0,n=.707106781,r=.707106781):(n=y/(i=Math.sqrt(m)),r=x/i):g>v?g<.01?(i=.707106781,n=0,r=.707106781):(i=y/(n=Math.sqrt(g)),r=b/n):v<.01?(i=.707106781,n=.707106781,r=0):(i=x/(r=Math.sqrt(v)),n=b/r),this.set(i,n,r,e),this}var _=Math.sqrt((p-u)*(p-u)+(h-d)*(h-d)+(c-s)*(c-s));return Math.abs(_)<.001&&(_=1),this.x=(p-u)/_,this.y=(h-d)/_,this.z=(c-s)/_,this.w=Math.acos((o+l+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}
12,round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),_.prototype=Object.assign(Object.create(l.prototype),{constructor:_,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),w.prototype=Object.assign(Object.create(_.prototype),{constructor:w,isWebGLMultisampleRenderTarget:!0,copy:function(t){return _.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(M,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,a,o){var s=i[n+0],h=i[n+1],c=i[n+2],l=i[n+3],u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(l!==f||s!==u||h!==d||c!==p){var m=1-o,g=s*u+h*d+c*p+l*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var _=o*v;if(s=s*m+u*_,h=h*m+d*_,c=c*m+p*_,l=l*m+f*_,m===1-o){var w=1/Math.sqrt(s*s+h*h+c*c+l*l);s*=w,h*=w,c*=w,l*=w}}t[e]=s,t[e+1]=h,t[e+2]=c,t[e+3]=l},multiplyQuaternionsFlat:function(t,e,i,n,r,a){var o=i[n],s=i[n+1],h=i[n+2],c=i[n+3],l=r[a],u=r[a+1],d=r[a+2],p=r[a+3];return t[e]=o*p+c*l+s*d-h*u,t[e+1]=s*p+c*u+h*l-o*d,t[e+2]=h*p+c*d+o*u-s*l,t[e+3]=c*p-o*l-s*u-h*d,t}}),Object.defineProperties(M.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(M.prototype,{isQuaternion:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=t._x,n=t._y,r=t._z,a=t.order,o=Math.cos,s=Math.sin,h=o(i/2),c=o(n/2),l=o(r/2),u=s(i/2),d=s(n/2),p=s(r/2);
vendor: 21,871 bytes, line 12
12switch(a){case"XYZ":this._x=u*c*l+h*d*p,this._y=h*d*l-u*c*p,this._z=h*c*p+u*d*l,this._w=h*c*l-u*d*p;break;case"YXZ":this._x=u*c*l+h*d*p,this._y=h*d*l-u*c*p,this._z=h*c*p-u*d*l,this._w=h*c*l+u*d*p;break;case"ZXY":this._x=u*c*l-h*d*p,this._y=h*d*l+u*c*p,this._z=h*c*p+u*d*l,this._w=h*c*l-u*d*p;break;case"ZYX":this._x=u*c*l-h*d*p,this._y=h*d*l+u*c*p,this._z=h*c*p-u*d*l,this._w=h*c*l+u*d*p;break;case"YZX":this._x=u*c*l+h*d*p,this._y=h*d*l+u*c*p,this._z=h*c*p-u*d*l,this._w=h*c*l-u*d*p;break;case"XZY":this._x=u*c*l-h*d*p,this._y=h*d*l-u*c*p,this._z=h*c*p+u*d*l,this._w=h*c*l+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,i=t.elements,n=i[0],r=i[4],a=i[8],o=i[1],s=i[5],h=i[9],c=i[2],l=i[6],u=i[10],d=n+s+u;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(l-h)*e,this._y=(a-c)*e,this._z=(o-r)*e):n>s&&n>u?(e=2*Math.sqrt(1+n-s-u),this._w=(l-h)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(a+c)/e):s>u?(e=2*Math.sqrt(1+s-n-u),this._w=(a-c)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(h+l)/e):(e=2*Math.sqrt(1+u-n-s),this._w=(o-r)/e,this._x=(a+c)/e,this._y=(h+l)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var i=t.dot(e)+1;return i<1e-6?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(f.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,a=t._w,o=e._x,s=e._y,h=e._z,c=e._w;return this._x=i*c+a*o+n*h-r*s,this._y=n*c+a*s+r*o-i*h,this._z=r*c+a*h+i*s-n*o,this._w=a*c-i*o-n*s-r*h,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,a=this._w,o=a*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var h=1-e;return this._w=h*a+e*this._w,this._x=h*i+e*this._x,this._y=h*n+e*this._y,this._z=h*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,o),u=Math.sin((1-e)*l)/c,d=Math.sin(e*l)/c;return this._w=a*u+this._w*d,this._x=i*u+this._x*d,this._y=n*u+this._y*d,this._z=r*u+this._z*d,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var S=new E,T=new M;function E(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}Object.assign(E.prototype,{isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(T.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(T.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*a,this},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,a=t.y,o=t.z,s=t.w,h=s*e+a*n-o*i,c=s*i+o*e-r*n,l=s*n+r*i-a*e,u=-r*e-a*i-o*n;return this.x=h*s+u*-r+c*-o-l*-a,this.y=c*s+u*-a+l*-r-h*-o,this.z=l*s+u*-o+h*-a-c*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=n*s-r*o,this.y=r*a-i*s,this.z=i*o-n*a,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)},projectOnPlane:function(t){return S.copy(this).projectOnVector(t),this.sub(S)},reflect:function(t){return this.sub(S.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var i=this.dot(t)/e;return Math.acos(f.clamp(i,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var A=new E,P=new D,C=new E(0,0,0),L=new E(1,1,1),R=new E,I=new E,O=new E;function D(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(D.prototype,{isMatrix4:!0,set:function(t,e,i,n,r,a,o,s,h,c,l,u,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=h,g[6]=c,g[10]=l,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new D).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,i=t.elements,n=1/A.setFromMatrixColumn(t,0).length(),r=1/A.setFromMatrixColumn(t,1).length(),a=1/A.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,i=t.x,n=t.y,r=t.z,a=Math.cos(i),o=Math.sin(i),s=Math.cos(n),h=Math.sin(n),c=Math.cos(r),l=Math.sin(r);if("XYZ"===t.order){var u=a*c,d=a*l,p=o*c,f=o*l;e[0]=s*c,e[4]=-s*l,e[8]=h,e[1]=d+p*h,e[5]=u-f*h,e[9]=-o*s,e[2]=f-u*h,e[6]=p+d*h,e[10]=a*s}else if("YXZ"===t.order){var m=s*c,g=s*l,v=h*c,y=h*l;e[0]=m+y*o,e[4]=v*o-g,e[8]=a*h,e[1]=a*l,e[5]=a*c,e[9]=-o,e[2]=g*o-v,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){m=s*c,g=s*l,v=h*c,y=h*l;e[0]=m-y*o,e[4]=-a*l,e[8]=v+g*o,e[1]=g+v*o,e[5]=a*c,e[9]=y-m*o,e[2]=-a*h,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){u=a*c,d=a*l,p=o*c,f=o*l;e[0]=s*c,e[4]=p*h-d,e[8]=u*h+f,e[1]=s*l,e[5]=f*h+u,e[9]=d*h-p,e[2]=-h,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,b=a*h,_=o*s,w=o*h;e[0]=s*c,e[4]=w-x*l,e[8]=_*l+b,e[1]=l,e[5]=a*c,e[9]=-o*c,e[2]=-h*c,e[6]=b*l+_,e[10]=x-w*l}else if("XZY"===t.order){x=a*s,b=a*h,_=o*s,w=o*h;e[0]=s*c,e[4]=-l,e[8]=h*c,e[1]=x*l+w,e[5]=a*c,e[9]=b*l-_,e[2]=_*l-b,e[6]=o*c,e[10]=w*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(C,t,L)},lookAt:function(t,e,i){var n=this.elements;return O.subVectors(t,e),0===O.lengthSq()&&(O.z=1),O.normalize(),R.crossVectors(i,O),0===R.lengthSq()&&(1===Math.abs(i.z)?O.x+=1e-4:O.z+=1e-4,O.normalize(),R.crossVectors(i,O)),R.normalize(),I.crossVectors(O,R),n[0]=R.x,n[4]=I.x,n[8]=O.x,n[1]=R.y,n[5]=I.y,n[9]=O.y,n[2]=R.z,n[6]=I.z,n[10]=O.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,a=i[0],o=i[4],s=i[8],h=i[12],c=i[1],l=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],b=i[15],_=n[0],w=n[4],M=n[8],S=n[12],T=n[1],E=n[5],A=n[9],P=n[13],C=n[2],L=n[6],R=n[10],I=n[14],O=n[3],D=n[7],N=n[11],k=n[15];return r[0]=a*_+o*T+s*C+h*O,r[4]=a*w+o*E+s*L+h*D,r[8]=a*M+o*A+s*R+h*N,r[12]=a*S+o*P+s*I+h*k,r[1]=c*_+l*T+u*C+d*O,r[5]=c*w+l*E+u*L+d*D,r[9]=c*M+l*A+u*R+d*N,r[13]=c*S+l*P+u*I+d*k,r[2]=p*_+f*T+m*C+g*O,r[6]=p*w+f*E+m*L+g*D,r[10]=p*M+f*A+m*R+g*N,r[14]=p*S+f*P+m*I+g*k,r[3]=v*_+y*T+x*C+b*O,r[7]=v*w+y*E+x*L+b*D,r[11]=v*M+y*A+x*R+b*N,r[15]=v*S+y*P+x*I+b*k,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],a=t[1],o=t[5],s=t[9],h=t[13],c=t[2],l=t[6],u=t[10],d=t[14];return t[3]*(+r*s*l-n*h*l-r*o*u+i*h*u+n*o*d-i*s*d)+t[7]*(+e*s*d-e*h*u+r*a*u-n*a*d+n*h*c-r*s*c)+t[11]*(+e*h*l-e*o*d-r*a*l+i*a*d+r*o*c-i*h*c)+t[15]*(-n*o*c-e*s*l+e*o*u+n*a*l-i*a*u+i*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,i){var n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var i=this.elements,n=t.elements,r=n[0],a=n[1],o=n[2],s=n[3],h=n[4],c=n[5],l=n[6],u=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],v=n[13],y=n[14],x=n[15],b=p*y*u-v*f*u+v*l*m-c*y*m-p*l*x+c*f*x,_=g*f*u-d*y*u-g*l*m+h*y*m+d*l*x-h*f*x,w=d*v*u-g*p*u+g*c*m-h*v*m-d*c*x+h*p*x,M=g*p*l-d*v*l-g*c*f+h*v*f+d*c*y-h*p*y,S=r*b+a*_+o*w+s*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return i[0]=b*T,i[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*x-a*f*x)*T,i[2]=(c*y*s-v*l*s+v*o*u-a*y*u-c*o*x+a*l*x)*T,i[3]=(p*l*s-c*f*s-p*o*u+a*f*u+c*o*m-a*l*m)*T,i[4]=_*T,i[5]=(d*y*s-g*f*s+g*o*m-r*y*m-d*o*x+r*f*x)*T,i[6]=(g*l*s-h*y*s-g*o*u+r*y*u+h*o*x-r*l*x)*T,i[7]=(h*f*s-d*l*s+d*o*u-r*f*u-h*o*m+r*l*m)*T,i[8]=w*T,i[9]=(g*p*s-d*v*s-g*a*m+r*v*m+d*a*x-r*p*x)*T,i[10]=(h*v*s-g*c*s+g*a*u-r*v*u-h*a*x+r*c*x)*T,i[11]=(d*c*s-h*p*s-d*a*u+r*p*u+h*a*m-r*c*m)*T,i[12]=M*T,i[13]=(d*v*o-g*p*o+g*a*f-r*v*f-d*a*y+r*p*y)*T,i[14]=(g*c*o-h*v*o-g*a*l+r*v*l+h*a*y-r*c*y)*T,i[15]=(h*p*o-d*c*o+d*a*l-r*p*l-h*a*f+r*c*f)*T,this},scale:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,a=t.x,o=t.y,s=t.z,h=r*a,c=r*o;return this.set(h*a+i,h*o-n*s,h*s+n*o,0,h*o+n*s,c*o+i,c*s-n*a,0,h*s-n*o,c*s+n*a,r*s*s+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){var n=this.elements,r=e._x,a=e._y,o=e._z,s=e._w,h=r+r,c=a+a,l=o+o,u=r*h,d=r*c,p=r*l,f=a*c,m=a*l,g=o*l,v=s*h,y=s*c,x=s*l,b=i.x,_=i.y,w=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+x)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-x)*_,n[5]=(1-(u+g))*_,n[6]=(m+v)*_,n[7]=0,n[8]=(p+y)*w,n[9]=(m-v)*w,n[10]=(1-(u+f))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:function(t,e,i){var n=this.elements,r=A.set(n[0],n[1],n[2]).length(),a=A.set(n[4],n[5],n[6]).length(),o=A.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],P.copy(this);var s=1/r,h=1/a,c=1/o;return P.elements[0]*=s,P.elements[1]*=s,P.elements[2]*=s,P.elements[4]*=h,P.elements[5]*=h,P.elements[6]*=h,P.elements[8]*=c,P.elements[9]*=c,P.elements[10]*=c,e.setFromRotationMatrix(P),i.x=r,i.y=a,i.z=o,this},makePerspective:function(t,e,i,n,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(e-t),h=2*r/(i-n),c=(e+t)/(e-t),l=(i+n)/(i-n),u=-(a+r)/(a-r),d=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=h,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,i,n,r,a){var o=this.elements,s=1/(e-t),h=1/(i-n),c=1/(a-r),l=(e+t)*s,u=(i+n)*h,d=(a+r)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*h,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}});var N=new D,k=new M;function F(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._order=n||F.DefaultOrder}function G(){this.mask=1}F.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],F.DefaultOrder="XYZ",Object.defineProperties(F.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}
12),Object.assign(F.prototype,{isEuler:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var n=f.clamp,r=t.elements,a=r[0],o=r[4],s=r[8],h=r[1],c=r[5],l=r[9],u=r[2],d=r[6],p=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-n(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(h,c)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(h,a));break;case"ZYX":this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(n(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-l,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==i&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,i){return N.makeRotationFromQuaternion(t),this.setFromRotationMatrix(N,e,i)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return k.setFromEuler(this),this.setFromQuaternion(k,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new E(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(G.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});let z=0;const U=new E,B=new M,H=new D,j=new E,V=new E,W=new E,X=new M,Y=new E(1,0,0),q=new E(0,1,0),Z=new E(0,0,1),J={type:"added"},K={type:"removed"};function Q(){Object.defineProperty(this,"id",{value:z++}),this.uuid=f.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Q.DefaultUp.clone();var t=new E,e=new F,i=new M,n=new E(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new D},normalMatrix:{value:new g}}),this.matrix=new D,this.matrixWorld=new D,this.matrixAutoUpdate=Q.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new G,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function $(){Q.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Q.DefaultUp=new E(0,1,0),Q.DefaultMatrixAutoUpdate=!0,Q.prototype=Object.assign(Object.create(l.prototype),{constructor:Q,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)}
vendor: 12,516 bytes, line 12
12,setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return B.setFromAxisAngle(t,e),this.quaternion.multiply(B),this},rotateOnWorldAxis:function(t,e){return B.setFromAxisAngle(t,e),this.quaternion.premultiply(B),this},rotateX:function(t){return this.rotateOnAxis(Y,t)},rotateY:function(t){return this.rotateOnAxis(q,t)},rotateZ:function(t){return this.rotateOnAxis(Z,t)},translateOnAxis:function(t,e){return U.copy(t).applyQuaternion(this.quaternion),this.position.add(U.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Y,t)},translateY:function(t){return this.translateOnAxis(q,t)},translateZ:function(t){return this.translateOnAxis(Z,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(H.getInverse(this.matrixWorld))},lookAt:function(t,e,i){t.isVector3?j.copy(t):j.set(t,e,i);var n=this.parent;this.updateWorldMatrix(!0,!1),V.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?H.lookAt(V,j,this.up):H.lookAt(j,V,this.up),this.quaternion.setFromRotationMatrix(H),n&&(H.extractRotation(n.matrixWorld),B.setFromRotationMatrix(H),this.quaternion.premultiply(B.inverse()))},add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(J)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var i=this.children.indexOf(t);return-1!==i&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(K)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),H.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),H.multiply(t.parent.matrixWorld)),t.applyMatrix4(H),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new E),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new M),this.updateMatrixWorld(!0),this.matrixWorld.decompose(V,t,W),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new E),this.updateMatrixWorld(!0),this.matrixWorld.decompose(V,X,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new E),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var n=this.children,r=0,a=n.length;r<a;r++)n[r].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,h=o.length;s<h;s++){var c=o[s];r(t.shapes,c)}else r(t.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var l=[];for(s=0,h=this.material.length;s<h;s++)l.push(r(t.materials,this.material[s]));n.material=l}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(s=0;s<this.children.length;s++)n.children.push(this.children[s].toJSON(t).object)}if(e){var u=m(t.geometries),d=m(t.materials),p=m(t.textures),f=m(t.images);o=m(t.shapes);u.length>0&&(i.geometries=u),d.length>0&&(i.materials=d),p.length>0&&(i.textures=p),f.length>0&&(i.images=f),o.length>0&&(i.shapes=o)}return i.object=n,i;function m(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i<t.children.length;i++){var n=t.children[i];this.add(n.clone())}return this}}),$.prototype=Object.assign(Object.create(Q.prototype),{constructor:$,isScene:!0,copy:function(t,e){return Q.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Q.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var tt=[new E,new E,new E,new E,new E,new E,new E,new E],et=new E,it=new pt,nt=new E,rt=new E,at=new E,ot=new E,st=new E,ht=new E,ct=new E,lt=new E,ut=new E,dt=new E;function pt(t,e){this.min=void 0!==t?t:new E(1/0,1/0,1/0),this.max=void 0!==e?e:new E(-1/0,-1/0,-1/0)}function ft(t,e,i,n,r){var a,o;for(a=0,o=t.length-3;a<=o;a+=3){dt.fromArray(t,a);var s=r.x*Math.abs(dt.x)+r.y*Math.abs(dt.y)+r.z*Math.abs(dt.z),h=e.dot(dt),c=i.dot(dt),l=n.dot(dt);if(Math.max(-Math.max(h,c,l),Math.min(h,c,l))>s)return!1}return!0}Object.assign(pt.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,h=t.length;s<h;s+=3){var c=t[s],l=t[s+1],u=t[s+2];c<e&&(e=c),l<i&&(i=l),u<n&&(n=u),c>r&&(r=c),l>a&&(a=l),u>o&&(o=u)}return this.min.set(e,i,n),this.max.set(r,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,h=t.count;s<h;s++){var c=t.getX(s),l=t.getY(s),u=t.getZ(s);c<e&&(e=c),l<i&&(i=l),u<n&&(n=u),c>r&&(r=c),l>a&&(a=l),u>o&&(o=u)}return this.min.set(e,i,n),this.max.set(r,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var i=et.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new E),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new E),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),it.copy(e.boundingBox),it.applyMatrix4(t.matrixWorld),this.union(it));for(var i=t.children,n=0,r=i.length;n<r;n++)this.expandByObject(i[n]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new E),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,et),et.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(ct),lt.subVectors(this.max,ct),nt.subVectors(t.a,ct),rt.subVectors(t.b,ct),at.subVectors(t.c,ct),ot.subVectors(rt,nt),st.subVectors(at,rt),ht.subVectors(nt,at);var e=[0,-ot.z,ot.y,0,-st.z,st.y,0,-ht.z,ht.y,ot.z,0,-ot.x,st.z,0,-st.x,ht.z,0,-ht.x,-ot.y,ot.x,0,-st.y,st.x,0,-ht.y,ht.x,0];return!!ft(e,nt,rt,at,lt)&&(!!ft(e=[1,0,0,0,1,0,0,0,1],nt,rt,at,lt)&&(ut.crossVectors(ot,st),ft(e=[ut.x,ut.y,ut.z],nt,rt,at,lt)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new E),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return et.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radiu
12s=.5*this.getSize(et).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(tt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),tt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),tt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),tt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),tt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),tt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),tt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),tt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(tt)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var mt=new pt;function gt(t,e){this.center=void 0!==t?t:new E,this.radius=void 0!==e?e:-1}Object.assign(gt.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var i=this.center;void 0!==e?i.copy(e):mt.setFromPoints(t).getCenter(i);for(var n=0,r=0,a=t.length;r<a;r++)n=Math.max(n,i.distanceToSquared(t[r]));return this.radius=Math.sqrt(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new E),e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new pt),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var vt=new E,yt=new E,xt=new E,bt=new E,_t=new E,wt=new E,Mt=new E;function St(t,e){this.origin=void 0!==t?t:new E,this.direction=void 0!==e?e:new E(0,0,-1)}Object.assign(St.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new E),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,vt)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new E),e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=vt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(vt.copy(this.direction).multiplyScalar(e).add(this.origin),vt.distanceToSquared(t))},distanceSqToSegment:function(t,e,i,n){yt.copy(t).add(e).multiplyScalar(.5),xt.copy(e).sub(t).normalize(),bt.copy(this.origin).sub(yt);var r,a,o,s,h=.5*t.distanceTo(e),c=-this.direction.dot(xt),l=bt.dot
vendor: 18,992 bytes, line 12
12(this.direction),u=-bt.dot(xt),d=bt.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(a=c*l-u,s=h*p,(r=c*u-l)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(r*=f)*(r+c*(a*=f)+2*l)+a*(c*r+a+2*u)+d}else a=h,o=-(r=Math.max(0,-(c*a+l)))*r+a*(a+2*u)+d;else a=-h,o=-(r=Math.max(0,-(c*a+l)))*r+a*(a+2*u)+d;else a<=-s?o=-(r=Math.max(0,-(-c*h+l)))*r+(a=r>0?-h:Math.min(Math.max(-h,-u),h))*(a+2*u)+d:a<=s?(r=0,o=(a=Math.min(Math.max(-h,-u),h))*(a+2*u)+d):o=-(r=Math.max(0,-(c*h+l)))*r+(a=r>0?h:Math.min(Math.max(-h,-u),h))*(a+2*u)+d;else a=c>0?-h:h,o=-(r=Math.max(0,-(c*a+l)))*r+a*(a+2*u)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(xt).multiplyScalar(a).add(yt),o},intersectSphere:function(t,e){vt.subVectors(t.center,this.origin);var i=vt.dot(this.direction),n=vt.dot(vt)-i*i,r=t.radius*t.radius;if(n>r)return null;var a=Math.sqrt(r-n),o=i-a,s=i+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var i,n,r,a,o,s,h=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,u=this.origin;return h>=0?(i=(t.min.x-u.x)*h,n=(t.max.x-u.x)*h):(i=(t.max.x-u.x)*h,n=(t.min.x-u.x)*h),c>=0?(r=(t.min.y-u.y)*c,a=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,a=(t.min.y-u.y)*c),i>a||r>n?null:((r>i||i!=i)&&(i=r),(a<n||n!=n)&&(n=a),l>=0?(o=(t.min.z-u.z)*l,s=(t.max.z-u.z)*l):(o=(t.max.z-u.z)*l,s=(t.min.z-u.z)*l),i>s||o>n?null:((o>i||i!=i)&&(i=o),(s<n||n!=n)&&(n=s),n<0?null:this.at(i>=0?i:n,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,vt)},intersectTriangle:function(t,e,i,n,r){_t.subVectors(e,t),wt.subVectors(i,t),Mt.crossVectors(_t,wt);var a,o=this.direction.dot(Mt);if(o>0){if(n)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}bt.subVectors(this.origin,t);var s=a*this.direction.dot(wt.crossVectors(bt,wt));if(s<0)return null;var h=a*this.direction.dot(_t.cross(bt));if(h<0)return null;if(s+h>o)return null;var c=-a*bt.dot(Mt);return c<0?null:this.at(c/o,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var Tt=new E,Et=new E,At=new g;function Pt(t,e){this.normal=void 0!==t?t:new E(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Pt.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,i){var n=Tt.subVectors(i,e).cross(Et.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new E),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new E);var i=t.delta(Tt),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?void 0:e.copy(i).multiplyScalar(r).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new E),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var i=e||At.getNormalMatrix(t),n=this.coplanarPoint(Tt).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Ct=new E,Lt=new E,Rt=new E,It=new E,Ot=new E,Dt=new E,Nt=new E,kt=new E,Ft=new E,Gt=new E;function zt(t,e,i){this.a=void 0!==t?t:new E,this.b=void 0!==e?e:new E,this.c=void 0!==i?i:new E}Object.assign(zt,{getNormal:function(t,e,i,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new E),n.subVectors(i,e),Ct.subVectors(t,e),n.cross(Ct);var r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)},getBarycoord:function(t,e,i,n,r){Ct.subVectors(n,e),Lt.subVectors(i,e),Rt.subVectors(t,e);var a=Ct.dot(Ct),o=Ct.dot(Lt),s=Ct.dot(Rt),h=Lt.dot(Lt),c=Lt.dot(Rt),l=a*h-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new E),0===l)return r.set(-2,-1,-1);var u=1/l,d=(h*s-o*c)*u,p=(a*c-o*s)*u;return r.set(1-d-p,p,d)},containsPoint:function(t,e,i,n){return zt.getBarycoord(t,e,i,n,It),It.x>=0&&It.y>=0&&It.x+It.y<=1},getUV:function(t,e,i,n,r,a,o,s){return this.getBarycoord(t,e,i,n,It),s.set(0,0),s.addScaledVector(r,It.x),s.addScaledVector(a,It.y),s.addScaledVector(o,It.z),s},isFrontFacing:function(t,e,i,n){return Ct.subVectors(i,e),Lt.subVectors(t,e),Ct.cross(Lt).dot(n)<0}}),Object.assign(zt.prototype,{set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Ct.subVectors(this.c,this.b),Lt.subVectors(this.a,this.b),.5*Ct.cross(Lt).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new E),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return zt.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Pt),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return zt.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,i,n,r){return zt.getUV(t,this.a,this.b,this.c,e,i,n,r)},containsPoint:function(t){return zt.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return zt.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new E);var i,n,r=this.a,a=this.b,o=this.c;Ot.subVectors(a,r),Dt.subVectors(o,r),kt.subVectors(t,r);var s=Ot.dot(kt),h=Dt.dot(kt);if(s<=0&&h<=0)return e.copy(r);Ft.subVectors(t,a);var c=Ot.dot(Ft),l=Dt.dot(Ft);if(c>=0&&l<=c)return e.copy(a);var u=s*l-c*h;if(u<=0&&s>=0&&c<=0)return i=s/(s-c),e.copy(r).addScaledVector(Ot,i);Gt.subVectors(t,o);var d=Ot.dot(Gt),p=Dt.dot(Gt);if(p>=0&&d<=p)return e.copy(o);var f=d*h-s*p;if(f<=0&&h>=0&&p<=0)return n=h/(h-p),e.copy(r).addScaledVector(Dt,n);var m=c*p-d*l;if(m<=0&&l-c>=0&&d-p>=0)return Nt.subVectors(o,a),n=(l-c)/(l-c+(d-p)),e.copy(a).addScaledVector(Nt,n);var g=1/(m+f+u);return i=f*g,n=u*g,e.copy(r).addScaledVector(Ot,i).addScaledVector(Dt,n)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Ut={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Bt={h:0,s:0,l:0},Ht={h:0,s:0,l:0};function jt(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function Vt(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Wt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Xt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Yt(t,e,i,n,r,a){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new E,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new jt,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}Object.assign(jt.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(t,e,i){if(t=f.euclideanModulo(t,1),e=f.clamp(e,0,1),i=f.clamp(i,0,1),0===e)this.r=this.g=this.b=i;else{var n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=Vt(r,n,t+1/3),this.g=Vt(r,n,t),this.b=Vt(r,n,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,r=i[1],a=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,h=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(o,s,h)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c=i[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=Ut[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Wt(t.r),this.g=Wt(t.g),this.b=Wt(t.b),this},copyLinearToSRGB:function(t){return this.r=Xt(t.r),this.g=Xt(t.g),this.b=Xt(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,i,n=this.r,r=this.g,a=this.b,o=Math.max(n,r,a),s=Math.min(n,r,a),h=(s+o)/2;if(s===o)e=0,i=0;else{var c=o-s;switch(i=h<=.5?c/(o+s):c/(2-o-s),o){case n:e=(r-a)/c+(r<a?6:0);break;case r:e=(a-n)/c+2;break;case a:e=(n-r)/c+4}e/=6}return t.h=e,t.s=i,t.l=h,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,i){return this.getHSL(Bt),Bt.h+=t,Bt.s+=e,Bt.l+=i,this.setHSL(Bt.h,Bt.s,Bt.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(Bt),t.getHSL(Ht);var i=f.lerp(Bt.h,Ht.h,e),n=f.lerp(Bt.s,Ht.s,e),r=f.lerp(Bt.l,Ht.l,e);return this.setHSL(i,n,r),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),jt.NAMES=Ut,Object.assign(Yt.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var qt=0;function Zt(){Object.defineProperty(this,"id",{value:qt++}),this.uuid=f.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Jt(t){Zt.call(this),this.type="MeshBasicMaterial",this.color=new jt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}Zt.prototype=Object.assign(Object.create(l.prototype),{constructor:Zt,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i)if("shading"!==e){var n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}
vendor: 4,476 bytes, line 12
12if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity,i.refractionRatio=this.refractionRatio,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.morphNormals&&
vendor: 30,518 bytes, line 12
12(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){var r=n(t.textures),a=n(t.images);r.length>0&&(i.textures=r),a.length>0&&(i.images=a)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Zt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Jt.prototype=Object.create(Zt.prototype),Jt.prototype.constructor=Jt,Jt.prototype.isMeshBasicMaterial=!0,Jt.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Kt=new E;function Qt(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function $t(t,e,i){Qt.call(this,new Int8Array(t),e,i)}function te(t,e,i){Qt.call(this,new Uint8Array(t),e,i)}function ee(t,e,i){Qt.call(this,new Uint8ClampedArray(t),e,i)}function ie(t,e,i){Qt.call(this,new Int16Array(t),e,i)}function ne(t,e,i){Qt.call(this,new Uint16Array(t),e,i)}function re(t,e,i){Qt.call(this,new Int32Array(t),e,i)}function ae(t,e,i){Qt.call(this,new Uint32Array(t),e,i)}function oe(t,e,i){Qt.call(this,new Float32Array(t),e,i)}function se(t,e,i){Qt.call(this,new Float64Array(t),e,i)}function he(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ce(t){if(0===t.length)return-1/0;let e=t[0];for(let i=1,n=t.length;i<n;++i)t[i]>e&&(e=t[i]);return e}Object.defineProperty(Qt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Qt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),a=new jt),e[i++]=a.r,e[i++]=a.g,e[i++]=a.b}return this},copyVector2sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),a=new m),e[i++]=a.x,e[i++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),a=new E),e[i++]=a.x,e[i++]=a.y,e[i++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),a=new b),e[i++]=a.x,e[i++]=a.y,e[i++]=a.z,e[i++]=a.w}return this},applyMatrix3:function(t){for(var e=0,i=this.count;e<i;e++)Kt.x=this.getX(e),Kt.y=this.getY(e),Kt.z=this.getZ(e),Kt.applyMatrix3(t),this.setXYZ(e,Kt.x,Kt.y,Kt.z);return this},applyMatrix4:function(t){for(var e=0,i=this.count;e<i;e++)Kt.x=this.getX(e),Kt.y=this.getY(e),Kt.z=this.getZ(e),Kt.applyMatrix4(t),this.setXYZ(e,Kt.x,Kt.y,Kt.z);return this},applyNormalMatrix:function(t){for(var e=0,i=this.count;e<i;e++)Kt.x=this.getX(e),Kt.y=this.getY(e),Kt.z=this.getZ(e),Kt.applyNormalMatrix(t),this.setXYZ(e,Kt.x,Kt.y,Kt.z);return this},transformDirection:function(t){for(var e=0,i=this.count;e<i;e++)Kt.x=this.getX(e),Kt.y=this.getY(e),Kt.z=this.getZ(e),Kt.transformDirection(t),this.setXYZ(e,Kt.x,Kt.y,Kt.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),$t.prototype=Object.create(Qt.prototype),$t.prototype.constructor=$t,te.prototype=Object.create(Qt.prototype),te.prototype.constructor=te,ee.prototype=Object.create(Qt.prototype),ee.prototype.constructor=ee,ie.prototype=Object.create(Qt.prototype),ie.prototype.constructor=ie,ne.prototype=Object.create(Qt.prototype),ne.prototype.constructor=ne,re.prototype=Object.create(Qt.prototype),re.prototype.constructor=re,ae.prototype=Object.create(Qt.prototype),ae.prototype.constructor=ae,oe.prototype=Object.create(Qt.prototype),oe.prototype.constructor=oe,se.prototype=Object.create(Qt.prototype),se.prototype.constructor=se,Object.assign(he.prototype,{computeGroups:function(t){for(var e,i=[],n=void 0,r=t.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==n&&(n=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,i.push(e)),e={start:3*a,materialIndex:n})}void 0!==e&&(e.count=3*a-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,i=t.faces,n=t.vertices,r=t.faceVertexUvs,a=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,s=t.morphTargets,h=s.length;if(h>0){e=[];for(var c=0;c<h;c++)e[c]={name:s[c].name,data:[]};this.morphTargets.position=e}var l,u=t.morphNormals,d=u.length;if(d>0){l=[];for(c=0;c<d;c++)l[c]={name:u[c].name,data:[]};this.morphTargets.normal=l}var p=t.skinIndices,f=t.skinWeights,g=p.length===n.length,v=f.length===n.length;n.length>0&&0===i.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(c=0;c<i.length;c++){var y=i[c];this.vertices.push(n[y.a],n[y.b],n[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var b=y.normal;this.normals.push(b,b,b)}var _,w=y.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var M=y.color;this.colors.push(M,M,M)}if(!0===a)void 0!==(_=r[0][c])?this.uvs.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new m,new m,new m));if(!0===o)void 0!==(_=r[1][c])?this.uvs2.push(_[0],_[1],_[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new m,new m,new m));for(var S=0;S<h;S++){var T=s[S].vertices;e[S].data.push(T[y.a],T[y.b],T[y.c])}for(S=0;S<d;S++){var E=u[S].vertexNormals[c];l[S].data.push(E.a,E.b,E.c)}g&&this.skinIndices.push(p[y.a],p[y.b],p[y.c]),v&&this.skinWeights.push(f[y.a],f[y.b],f[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var le=1,ue=new D,de=new Q,pe=new E,fe=new pt,me=new pt,ge=new E;function ve(){Object.defineProperty(this,"id",{value:le+=2}),this.uuid=f.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}ve.prototype=Object.assign(Object.create(l.prototype),{constructor:ve,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(ce(t)>65535?ae:ne)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new g).getNormalMatrix(t);i.applyNormalMatrix(n),i.needsUpdate=!0}var r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return ue.makeRotationX(t),this.applyMatrix4(ue),this},rotateY:function(t){return ue.makeRotationY(t),this.applyMatrix4(ue),this},rotateZ:function(t){return ue.makeRotationZ(t),this.applyMatrix4(ue),this},translate:function(t,e,i){return ue.makeTranslation(t,e,i),this.applyMatrix4(ue),this},scale:function(t,e,i){return ue.makeScale(t,e,i),this.applyMatrix4(ue),this},lookAt:function(t){return de.lookAt(t),de.updateMatrix(),this.applyMatrix4(de.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(pe).negate(),this.translate(pe.x,pe.y,pe.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var i=new oe(3*e.vertices.length,3),n=new oe(3*e.colors.length,3);if(this.setAttribute("position",i.copyVector3sArray(e.vertices)),this.setAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new oe(e.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new oe(e,3)),this},updateFromObject:function(t){var e,i=t.geometry;if(t.isMesh){var n=i.__directGeometry;if(!0===i.elementsNeedUpdate&&(n=void 0,i.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(i);n.verticesNeedUpdate=i.verticesNeedUpdate,n.normalsNeedUpdate=i.normalsNeedUpdate,n.colorsNeedUpdate=i.colorsNeedUpdate,n.uvsNeedUpdate=i.uvsNeedUpdate,n.groupsNeedUpdate=i.groupsNeedUpdate,i.verticesNeedUpdate=!1,i.normalsNeedUpdate=!1,i.colorsNeedUpdate=!1,i.uvsNeedUpdate=!1,i.groupsNeedUpdate=!1,i=n}return!0===i.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(i.vertices),e.needsUpdate=!0),i.verticesNeedUpdate=!1),!0===i.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(i.normals),e.needsUpdate=!0),i.normalsNeedUpdate=!1),!0===i.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(i.colors),e.needsUpdate=!0),i.colorsNeedUpdate=!1),i.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(i.uvs),e.needsUpdate=!0),i.uvsNeedUpdate=!1),i.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(i.lineDistances),e.needsUpdate=!0),i.lineDistancesNeedUpdate=!1),i.groupsNeedUpdate&&(i.computeGroups(t.geometry),this.groups=i.groups,i.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new he).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new Qt(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var i=new Float32Array(3*t.normals.length);this.setAttribute("normal",new Qt(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.setAttribute("color",new Qt(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new Qt(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new Qt(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],h=t.morphTargets[o],c=0,l=h.length;c<l;c++){var u=h[c],d=new oe(3*u.data.length,3);d.name=u.name,s.push(d.copyVector3sArray(u.data))}this.morphAttributes[o]=s}if(t.skinIndices.length>0){var p=new oe(4*t.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new oe(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new pt);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var i=0,n=e.length;i<n;i++){var r=e[i];fe.setFromBufferAttribute(r),this.morphTargetsRelative?(ge.addVectors(this.boundingBox.min,fe.min),this.boundingBox.expandByPoint(ge),ge.addVectors(this.boundingBox.max,fe.max),this.boundingBox.expandByPoint(ge)):(this.boundingBox.expandByPoint(fe.min),this.boundingBox.expandByPoint(fe.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new gt);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var i=this.boundingSphere.center;if(fe.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n<r;n++){var a=e[n];me.setFromBufferAttribute(a),this.morphTargetsRelative?(ge.addVectors(fe.min,me.min),fe.expandByPoint(ge),ge.addVectors(fe.max,me.max),fe.expandByPoint(ge)):(fe.expandByPoint(me.min),fe.expandByPoint(me.max))}fe.getCenter(i);var o=0;for(n=0,r=t.count;n<r;n++)ge.fromBufferAttribute(t,n),o=Math.max(o,i.distanceToSquared(ge));if(e)for(n=0,r=e.length;n<r;n++){a=e[n];for(var s=this.morphTargetsRelative,h=0,c=a.count;h<c;h++)ge.fromBufferAttribute(a,h),s&&(pe.fromBufferAttribute(t,h),ge.add(pe)),o=Math.max(o,i.distanceToSquared(ge))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var i=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new Qt(new Float32Array(i.length),3));else for(var n=e.normal.array,r=0,a=n.length;r<a;r++)n[r]=0;var o,s,h,c=e.normal.array,l=new E,u=new E,d=new E,p=new E,f=new E;if(t){var m=t.array;for(r=0,a=t.count;r<a;r+=3)o=3*m[r+0],s=3*m[r+1],h=3*m[r+2],l.fromArray(i,o),u.fromArray(i,s),d.fromArray(i,h),p.subVectors(d,u),f.subVectors(l,u),p.cross(f),c[o]+=p.x,c[o+1]+=p.y,c[o+2]+=p.z,c[s]+=p.x,c[s+1]+=p.y,c[s+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(r=0,a=i.length;r<a;r+=9)l.fromArray(i,r),u.fromArray(i,r+3),d.fromArray(i,r+6),p.subVectors(d,u),f.subVectors(l,u),p.cross(f),c[r]=p.x,c[r+1]=p.y,c[r+2]=p.z,c[r+3]=p.x,c[r+4]=p.y,c[r+5]=p.z,c[r+6]=p.x,c[r+7]=p.y,c[r+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var i=this.attributes;for(var n in i)if(void 0!==t.attributes[n])for(var r=i[n].array,a=t.attributes[n],o=a.array,s=a.itemSize*e,h=Math.min(o.length,r.length-s),c=0,l=s;c<h;c++,l++)r[l]=o[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,i=t.count;e<i;e++)ge.x=t.getX(e),ge.y=t.getY(e),ge.z=t.getZ(e),ge.normalize(),t.setXYZ(e,ge.x,ge.y,ge.z)},toNonIndexed:function(){function t(t,e){for(var i=t.array,n=t.itemSize,r=t.normalized,a=new i.constructor(e.length*n),o=0,s=0,h=0,c=e.length;h<c;h++){o=e[h]*n;for(var l=0;l<n;l++)a[s++]=i[o++]}return new Qt(a,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new ve,i=this.index.array,n=this.attributes;for(var r in n){var a=t(n[r],i);e.setAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],h=o[r],c=0,l=h.length;c<l;c++){a=t(h[c],i);s.push(a)}e.morphAttributes[r]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var u=this.groups,d=(c=0,u.length);c<d;c++){var p=u[c];e.addGroup(p.start,p.count,p.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var r=this.attributes;for(var i in r){var a=(d=r[i]).toJSON();""!==d.name&&(a.name=d.name),t.data.attributes[i]=a}var o={},s=!1;for(var i in this.morphAttributes){for(var h=this.morphAttributes[i],c=[],l=0,u=h.length;l<u;l++){var d;a=(d=h[l]).toJSON();""!==d.name&&(a.name=d.name),c.push(a)}c.length>0&&(o[i]=c,s=!0)}s&&(t.data.morphAttributes=o,t.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;p.length>0&&(t.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new ve).copy(this)},copy:function(t){var e,i,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var a=t.attributes;for(e in a){var o=a[e];this.setAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var h=[],c=s[e];for(i=0,n=c.length;i<n;i++)h.push(c[i].clone());this.morphAttributes[e]=h}this.morphTargetsRelative=t.morphTargetsRelative;var l=t.groups;for(i=0,n=l.length;i<n;i++){var u=l[i];this.addGroup(u.start,u.count,u.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ye=new D,xe=new St,be=new gt,_e=new E,we=new E,Me=new E,Se=new E,Te=new E,Ee=new E,Ae=new E,Pe=new E,Ce=new E,Le=new m,Re=new m,Ie=new m,Oe=new E,De=new E;function Ne(t,e){Q.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new ve,this.material=void 0!==e?e:new Jt,this.updateMorphTargets()}function ke(t,e,i,n,r,a,o,s){if(null===(1===e.side?n.intersectTriangle(o,a,r,!0,s):n.intersectTriangle(r,a,o,2!==e.side,s)))return null;De.copy(s),De.applyMatrix4(t.matrixWorld);var h=i.ray.origin.distanceTo(De);return h<i.near||h>i.far?null:{distance:h,point:De.clone(),object:t}}function Fe(t,e,i,n,r,a,o,s,h,c,l,u){_e.fromBufferAttribute(r,c),we.fromBufferAttribute(r,l),Me.fromBufferAttribute(r,u);var d=t.morphTargetInfluences;if(e.morphTargets&&a&&d){Ae.set(0,0,0),Pe.set(0,0,0),Ce.set(0,0,0);for(var p=0,f=a.length;p<f;p++){var g=d[p],v=a[p];0!==g&&(Se.fromBufferAttribute(v,c),Te.fromBufferAttribute(v,l),Ee.fromBufferAttribute(v,u),o?(Ae.addScaledVector(Se,g),Pe.addScaledVector(Te,g),Ce.addScaledVector(Ee,g)):(Ae.addScaledVector(Se.sub(_e),g),Pe.addScaledVector(Te.sub(we),g),Ce.addScaledVector(Ee.sub(Me),g)))}_e.add(Ae),we.add(Pe),Me.add(Ce)}t.isSkinnedMesh&&(t.boneTransform(c,_e),t.boneTransform(l,we),t.boneTransform(u,Me));var y=ke(t,e,i,n,_e,we,Me,Oe);if(y){s&&(Le.fromBufferAttribute(s,c),Re.fromBufferAttribute(s,l),Ie.fromBufferAttribute(s,u),y.uv=zt.getUV(Oe,_e,we,Me,Le,Re,Ie,new m)),h&&(Le.fromBufferAttribute(h,c),Re.fromBufferAttribute(h,l),Ie.fromBufferAttribute(h,u),y.uv2=zt.getUV(Oe,_e,we,Me,Le,Re,Ie,new m));var x=new Yt(c,l,u);zt.getNormal(_e,we,Me,x.normal),y.face=x}return y}Ne.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ne,isMesh:!0,copy:function(t){return Q.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)i=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}else{var s=n.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var i,n=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===n.boundingSphere&&n.computeBoundingSphere(),be.copy(n.boundingSphere),be.applyMatrix4(a),!1!==t.ray.intersectsSphere(be)&&(ye.getInverse(a),xe.copy(t.ray).applyMatrix4(ye),null===n.boundingBox||!1!==xe.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var o,s,h,c,l,u,d,p,f,g=n.index,v=n.attributes.position,y=n.morphAttributes.position,x=n.morphTargetsRelative,b=n.attributes.uv,_=n.attributes.uv2,w=n.groups,M=n.drawRange;if(null!==g)if(Array.isArray(r))for(c=0,u=w.length;c<u;c++)for(f=r[(p=w[c]).materialIndex],l=Math.max(p.start,M.start),d=Math.min(p.start+p.count,M.start+M.count);l<d;l+=3)o=g.getX(l),s=g.getX(l+1),h=g.getX(l+2),(i=Fe(this,f,t,xe,v,y,x,b,_,o,s,h))&&(i.faceIndex=Math.floor(l/3),i.face.materialIndex=p.materialIndex,e.push(i));else for(c=Math.max(0,M.start),u=Math.min(g.count,M.start+M.count);c<u;c+=3)o=g.getX(c),s=g.getX(c+1),h=g.getX(c+2),(i=Fe(this,r,t,xe,v,y,x,b,_,o,s,h))&&(i.faceIndex=Math.floor(c/3),e.push(i));else if(void 0!==v)if(Array.isArray(r))for(c=0,u=w.length;c<u;c++)for(f=r[(p=w[c]).materialIndex],l=Math.max(p.start,M.start),d=Math.min(p.start+p.count,M.start+M.count);l<d;l+=3)(i=Fe(this,f,t,xe,v,y,x,b,_,o=l,s=l+1,h=l+2))&&(i.faceIndex=Math.floor(l/3),i.face.materialIndex=p.materialIndex,e.push(i));else for(c=Math.max(0,M.start),u=Math.min(v.count,M.start+M.count);c<u;c+=3)(i=Fe(this,r,t,xe,v,y,x,b,_,o=c,s=c+1,h=c+2))&&(i.faceIndex=Math.floor(c/3),e.push(i))}else if(n.isGeometry){var S,T,E,A,P=Array.isArray(r),C=n.vertices,L=n.faces,R=n.faceVertexUvs[0];R.length>0&&(A=R);for(var I=0,O=L.length;I<O;I++){var D=L[I],N=P?r[D.materialIndex]:r;if(void 0!==N&&(S=C[D.a],T=C[D.b],E=C[D.c],i=ke(this,N,t,xe,S,T,E,Oe))){if(A&&A[I]){var k=A[I];Le.copy(k[0]),Re.copy(k[1]),Ie.copy(k[2]),i.uv=zt.getUV(Oe,S,T,E,Le,Re,Ie,new m)}i.face=D,i.faceIndex=I,e.push(i)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ge=0,ze=new D,Ue=new Q,Be=new E;function He(){Object.defineProperty(this,"id",{value:Ge+=2}),this.uuid=f.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}He.prototype=Object.assign(Object.create(l.prototype),{constructor:He,isGeometry:!0,applyMatrix4:function(t){for(var e=(new g).getNormalMatrix(t),i=0,n=this.vertices.length;i<n;i++){this.vertices[i].applyMatrix4(t)}for(i=0,n=this.faces.length;i<n;i++){var r=this.faces[i];r.normal.applyMatrix3(e).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return ze.makeRotationX(t),this.applyMatrix4(ze),this},rotateY:function(t){return ze.makeRotationY(t),this.applyMatrix4(ze),this},rotateZ:function(t){return ze.makeRotationZ(t),this.applyMatrix4(ze),this},translate:function(t,e,i){return ze.makeTranslation(t,e,i),this.applyMatrix4(ze),this},scale:function(t,e,i){return ze.makeScale(t,e,i),this.applyMatrix4(ze),this},lookAt:function(t){return Ue.lookAt(t),Ue.updateMatrix(),this.applyMatrix4(Ue.matrix),this},fromBufferGeometry:function(t){var e=this,i=null!==t.index?t.index.array:void 0,n=t.attributes;if(void 0===n.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=n.position.array,a=void 0!==n.normal?n.normal.array:void 0,o=void 0!==n.color?n.color.array:void 0,s=void 0!==n.uv?n.uv.array:void 0,h=void 0!==n.uv2?n.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var c=0;c<r.length;c+=3)e.vertices.push((new E).fromArray(r,c)),void 0!==o&&e.colors.push((new jt).fromArray(o,c));function l(t,i,n,r){var c=void 0===o?[]:[e.colors[t].clone(),e.colors[i].clone(),e.colors[n].clone()],l=new Yt(t,i,n,void 0===a?[]:[(new E).fromArray(a,3*t),(new E).fromArray(a,3*i),(new E).fromArray(a,3*n)],c,r);e.faces.push(l),void 0!==s&&e.faceVertexUvs[0].push([(new m).fromArray(s,2*t),(new m).fromArray(s,2*i),(new m).fromArray(s,2*n)]),void 0!==h&&e.faceVertexUvs[1].push([(new m).fromArray(h,2*t),(new m).fromArray(h,2*i),(new m).fromArray(h,2*n)])}var u=t.groups;if(u.length>0)for(c=0;c<u.length;c++)for(var d=u[c],p=d.start,f=p,g=p+d.count;f<g;f+=3)void 0!==i?l(i[f],i[f+1],i[f+2],d.materialIndex):l(f,f+1,f+2,d.materialIndex);else if(void 0!==i)for(c=0;c<i.length;c+=3)l(i[c],i[c+1],i[c+2]);else for(c=0;c<r.length/3;c+=3)l(c,c+1,c+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Be).negate(),this.translate(Be.x,Be.y,Be.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,n=new D;return n.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(n),this},computeFaceNormals:function(){for(var t=new E,e=new E,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,i,n,r,a,o;for(void 0===t&&(t=!0),o=new Array(this.vertices.length),e=0,i=this.vertices.length;e<i;e++)o[e]=new E;if(t){var s,h,c,l=new E,u=new E;for(n=0,r=this.faces.length;n<r;n++)a=this.faces[n],s=this.vertices[a.a],h=this.vertices[a.b],c=this.vertices[a.c],l.subVectors(c,h),u.subVectors(s,h),l.cross(u),o[a.a].add(l),o[a.b].add(l),o[a.c].add(l)}else for(this.computeFaceNormals(),n=0,r=this.faces.length;n<r;n++)o[(a=this.faces[n]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,i=this.vertices.length;e<i;e++)o[e].normalize();for(n=0,r=this.faces.length;n<r;n++){var d=(a=this.faces[n]).vertexNormals;
vendor: 8,330 bytes, line 12
123===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,i;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var n=(i=this.faces[t]).vertexNormals;3===n.length?(n[0].copy(i.normal),n[1].copy(i.normal),n[2].copy(i.normal)):(n[0]=i.normal.clone(),n[1]=i.normal.clone(),n[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for((r=this.faces[i]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var a=new He;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)h=new E,c={a:new E,b:new E,c:new E},o.push(h),s.push(c)}var h,c,l=this.morphNormals[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),i=0,n=this.faces.length;i<n;i++)r=this.faces[i],h=l.faceNormals[i],c=l.vertexNormals[i],h.copy(r.normal),c.a.copy(r.vertexNormals[0]),c.b.copy(r.vertexNormals[1]),c.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)(r=this.faces[i]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new pt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new gt),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(t&&t.isGeometry){var n,r=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,h=t.faces,c=this.colors,l=t.colors;void 0===i&&(i=0),void 0!==e&&(n=(new g).getNormalMatrix(e));for(var u=0,d=o.length;u<d;u++){var p=o[u].clone();void 0!==e&&p.applyMatrix4(e),a.push(p)}for(u=0,d=l.length;u<d;u++)c.push(l[u].clone());for(u=0,d=h.length;u<d;u++){var f,m,v,y=h[u],x=y.vertexNormals,b=y.vertexColors;(f=new Yt(y.a+r,y.b+r,y.c+r)).normal.copy(y.normal),void 0!==n&&f.normal.applyMatrix3(n).normalize();for(var _=0,w=x.length;_<w;_++)m=x[_].clone(),void 0!==n&&m.applyMatrix3(n).normalize(),f.vertexNormals.push(m);f.color.copy(y.color);for(_=0,w=b.length;_<w;_++)v=b[_],f.vertexColors.push(v.clone());f.materialIndex=y.materialIndex+i,s.push(f)}for(u=0,d=t.faceVertexUvs.length;u<d;u++){var M=t.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(_=0,w=M.length;_<w;_++){for(var S=M[_],T=[],E=0,A=S.length;E<A;E++)T.push(S[E].clone());this.faceVertexUvs[u].push(T)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,i,n,r,a,o,s,h={},c=[],l=[],u=Math.pow(10,4);for(i=0,n=this.vertices.length;i<n;i++)t=this.vertices[i],void 0===h[e=Math.round(t.x*u)+"_"+Math.round(t.y*u)+"_"+Math.round(t.z*u)]?(h[e]=i,c.push(this.vertices[i]),l[i]=c.length-1):l[i]=l[h[e]];var d=[];for(i=0,n=this.faces.length;i<n;i++){(r=this.faces[i]).a=l[r.a],r.b=l[r.b],r.c=l[r.c],a=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(i);break}}for(i=d.length-1;i>=0;i--){var f=d[i];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},setFromPoints:function(t){this.vertices=[];for(var e=0,i=t.length;e<i;e++){var n=t[e];this.vertices.push(new E(n.x,n.y,n.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,i=0;i<e;i++)t[i]._id=i;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));var n,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===e&&(n=[]),o&&o.length===e&&(r=[]);for(i=0;i<e;i++){var s=t[i]._id;n&&n.push(a[s]),r&&r.push(o[s])}n&&(this.faceVertexUvs[0]=n),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}for(var n=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];n.push(a.x,a.y,a.z)}var o=[],s=[],h={},c=[],l={},u=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=p.normal.length()>0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),o.push(x),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var b=this.faceVertexUvs[0][r];o.push(E(b[0]),E(b[1]),E(b[2]))}if(m&&o.push(S(p.normal)),g){var _=p.vertexNormals;o.push(S(_[0]),S(_[1]),S(_[2]))}if(v&&o.push(T(p.color)),y){var w=p.vertexColors;o.push(T(w[0]),T(w[1]),T(w[2]))}}function M(t,e,i){return i?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==h[e]||(h[e]=s.length/3,s.push(t.x,t.y,t.z)),h[e]}function T(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==l[e]||(l[e]=c.length,c.push(t.getHex())),l[e]}function E(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=u.length/2,u.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=n,t.data.normals=s,c.length>0&&(t.data.colors=c),u.length>0&&(t.data.uvs=[u]),t.data.faces=o,t},clone:function(){return(new He).copy(this)},copy:function(t){var e,i,n,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,i=s.length;e<i;e++)this.vertices.push(s[e].clone());var h=t.colors;for(e=0,i=h.length;e<i;e++)this.colors.push(h[e].clone());var c=t.faces;for(e=0,i=c.length;e<i;e++)this.faces.push(c[e].clone());for(e=0,i=t.faceVertexUvs.length;e<i;e++){var l=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),n=0,r=l.length;n<r;n++){var u=l[n],d=[];for(a=0,o=u.length;a<o;a++){var p=u[a];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,i=f.length;e<i;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],n=0,r=f[e].vertices.length;n<r;n++)m.vertices.push(f[e].vertices[n].clone());if(void 0!==f[e].normals)for(m.normals=[],n=0,r=f[e].normals.length;n<r;n++)m.normals.push(f[e].normals[n].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,i=g.length;e<i;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],n=0,r=g[e].vertexNormals.length;n<r;n++){var y=g[e].vertexNormals[n],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],n=0,r=g[e].faceNormals.length;n<r;n++)v.faceNormals.push(g[e].faceNormals[n].clone());this.morphNormals.push(v)}var b=t.skinWeights;for(e=0,i=b.length;e<i;e++)this.skinWeights.push(b[e].clone());var _=t.skinIndices;for(e=0,i=_.length;e<i;e++)this.skinIndices.push(_[e].clone());var w=t.lineDistances;for(e=0,i=w.length;e<i;e++)this.lineDistances.push(w[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});
vendor: 5,556 bytes, line 12
12class je extends ve{constructor(t,e,i,n,r,a){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};const o=this;t=t||1,e=e||1,i=i||1,n=Math.floor(n)||1,r=Math.floor(r)||1,a=Math.floor(a)||1;const s=[],h=[],c=[],l=[];let u=0,d=0;function p(t,e,i,n,r,a,p,f,m,g,v){const y=a/m,x=p/g,b=a/2,_=p/2,w=f/2,M=m+1,S=g+1;let T=0,A=0;const P=new E;for(let a=0;a<S;a++){const o=a*x-_;for(let s=0;s<M;s++){const u=s*y-b;P[t]=u*n,P[e]=o*r,P[i]=w,h.push(P.x,P.y,P.z),P[t]=0,P[e]=0,P[i]=f>0?1:-1,c.push(P.x,P.y,P.z),l.push(s/m),l.push(1-a/g),T+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const i=u+e+M*t,n=u+e+M*(t+1),r=u+(e+1)+M*(t+1),a=u+(e+1)+M*t;s.push(i,n,a),s.push(n,r,a),A+=6}o.addGroup(d,A,v),d+=A,u+=T}p("z","y","x",-1,-1,i,e,t,a,r,0),p("z","y","x",1,-1,i,e,-t,a,r,1),p("x","z","y",1,1,t,i,e,n,a,2),p("x","z","y",1,-1,t,i,-e,n,a,3),p("x","y","z",1,-1,t,e,i,n,r,4),p("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(s),this.setAttribute("position",new oe(h,3)),this.setAttribute("normal",new oe(c,3)),this.setAttribute("uv",new oe(l,2))}}function Ve(t){var e={};for(var i in t)for(var n in e[i]={},t[i]){var r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}return e}function We(t){for(var e={},i=0;i<t.length;i++){var n=Ve(t[i]);for(var r in n)e[r]=n[r]}return e}var Xe={clone:Ve,merge:We};function Ye(t){Zt.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function qe(){Q.call(this),this.type="Camera",this.matrixWorldInverse=new D,this.projectionMatrix=new D,this.projectionMatrixInverse=new D}function Ze(t,e,i,n){qe.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Ye.prototype=Object.create(Zt.prototype),Ye.prototype.constructor=Ye,Ye.prototype.isShaderMaterial=!0,Ye.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ve(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this},Ye.prototype.toJSON=function(t){var e=Zt.prototype.toJSON.call(this,t);for(var i in e.uniforms={},this.uniforms){var n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return Object.keys(r).length>0&&(e.extensions=r),e},qe.prototype=Object.assign(Object.create(Q.prototype),{constructor:qe,isCamera:!0,copy:function(t,e){return Q.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new E),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Q.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){Q.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Ze.prototype=Object.assign(Object.create(qe.prototype),{constructor:Ze,isPerspectiveCamera:!0,copy:function(t,e){return qe.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*f.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*f.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t}
12,getEffectiveFOV:function(){return 2*f.RAD2DEG*Math.atan(Math.tan(.5*f.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*f.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/o,e-=a.offsetY*i/s,n*=a.width/o,i*=a.height/s}var h=this.filmOffset;0!==h&&(r+=t*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Q.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function Je(t,e,i){if(Q.call(this),this.type="CubeCamera",!0===i.isWebGLCubeRenderTarget){this.renderTarget=i;var n=new Ze(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new E(1,0,0)),this.add(n);var r=new Ze(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new E(-1,0,0)),this.add(r);var a=new Ze(90,1,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new E(0,1,0)),this.add(a);var o=new Ze(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new E(0,-1,0)),this.add(o);var s=new Ze(90,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new E(0,0,1)),this.add(s);var h=new Ze(90,1,t,e);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new E(0,0,-1)),this.add(h),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var c=t.xr.enabled,l=t.getRenderTarget();t.xr.enabled=!1;var u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,a),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,s),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,h),t.setRenderTarget(l),t.xr.enabled=c},this.clear=function(t,e,n,r){for(var a=t.getRenderTarget(),o=0;o<6;o++)t.setRenderTarget(i,o),t.clear(e,n,r);t.setRenderTarget(a)}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function Ke(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),_.call(this,t,t,e)}function Qe(t,e,i,n,r,a,o,s,h,c,l,u){x.call(this,null,a,o,s,h,c,n,r,l,u),this.image={data:t||null,width:e||1,height:i||1},this.magFilter=void 0!==h?h:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Je.prototype=Object.create(Q.prototype),Je.prototype.constructor=Je,Ke.prototype=Object.create(_.prototype),Ke.prototype.constructor=Ke,Ke.prototype.isWebGLCubeRenderTarget=!0,Ke.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var i=new $,n={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include <common>","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new Ye({type:"CubemapFromEquirect",uniforms:Ve(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;var a=new Ne(new je(5,5,5),r);return i.add(a),new Je(1,10,this).update(t,i),a.geometry.dispose(),a.material.dispose(),this},Qe.prototype=Object.create(x.prototype),Qe.prototype.constructor=Qe,Qe.prototype.isDataTexture=!0;var $e=new gt,ti=new E;function ei(t,e,i,n,r,a){this.planes=[void 0!==t?t:new Pt,void 0!==e?e:new Pt,void 0!==i?i:new Pt,void 0!==n?n:new Pt,void 0!==r?r:new Pt,void 0!==a?a:new Pt]}
vendor: 5,781 bytes, line 12
12Object.assign(ei.prototype,{set:function(t,e,i,n,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromProjectionMatrix:function(t){var e=this.planes,i=t.elements,n=i[0],r=i[1],a=i[2],o=i[3],s=i[4],h=i[5],c=i[6],l=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,l-s,f-u,y-m).normalize(),e[1].setComponents(o+n,l+s,f+u,y+m).normalize(),e[2].setComponents(o+r,l+h,f+d,y+g).normalize(),e[3].setComponents(o-r,l-h,f-d,y-g).normalize(),e[4].setComponents(o-a,l-c,f-p,y-v).normalize(),e[5].setComponents(o+a,l+c,f+p,y+v).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),$e.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere($e)},intersectsSprite:function(t){return $e.center.set(0,0,0),$e.radius=.7071067811865476,$e.applyMatrix4(t.matrixWorld),this.intersectsSphere($e)},intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(i)<n)return!1}return!0},intersectsBox:function(t){for(var e=this.planes,i=0;i<6;i++){var n=e[i];if(ti.x=n.normal.x>0?t.max.x:t.min.x,ti.y=n.normal.y>0?t.max.y:t.min.y,ti.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(ti)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});var ii={common:{diffuse:{value:new jt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new g},uv2Transform:{value:new g},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new m(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new jt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new jt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new g}},sprite:{diffuse:{value:new jt(15658734)},opacity:{value:1},center:{value:new m(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new g}}};function ni(){var t=null,e=!1,i=null;function n(r,a){!1!==e&&(i(r,a),t.requestAnimationFrame(n))}return{start:function(){!0!==e&&null!==i&&(t.requestAnimationFrame(n),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function ri(t,e){var i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){e.isInterleavedBufferAttribute&&(e=e.data);var a=n.get(e);void 0===a?n.set(e,function(e,i){var n=e.array,r=e.usage,a=t.createBuffer();t.bindBuffer(i,a),t.bufferData(i,n,r),e.onUploadCallback();var o=5126;return n instanceof Float32Array?o=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?o=5123:n instanceof Int16Array?o=5122:n instanceof Uint32Array?o=5125:n instanceof Int32Array?o=5124:n instanceof Int8Array?o=5120:n instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}(e,r)):a.version<e.version&&(!function(e,n,r){var a=n.array,o=n.updateRange;t.bindBuffer(r,e),-1===o.count?t.bufferSubData(r,0,a):(i?t.bufferSubData(r,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):t.bufferSubData(r,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}(a.buffer,e,r),a.version=e.version)}}}function ai(t,e,i,n){He.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new oi(t,e,i,n)),this.mergeVertices()}function oi(t,e,i,n){ve.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};var r,a,o=(t=t||1)/2,s=(e=e||1)/2,h=Math.floor(i)||1,c=Math.floor(n)||1,l=h+1,u=c+1,d=t/h,p=e/c,f=[],m=[],g=[],v=[];for(a=0;a<u;a++){var y=a*p-s;for(r=0;r<l;r++){var x=r*d-o;
vendor: 444 bytes, line 12
12m.push(x,-y,0),g.push(0,0,1),v.push(r/h),v.push(1-a/c)}}for(a=0;a<c;a++)for(r=0;r<h;r++){var b=r+l*a,_=r+l*(a+1),w=r+1+l*(a+1),M=r+1+l*a;f.push(b,_,M),f.push(_,w,M)}this.setIndex(f),this.setAttribute("position",new oe(m,3)),this.setAttribute("normal",new oe(g,3)),this.setAttribute("uv",new oe(v,2))}ai.prototype=Object.create(He.prototype),ai.prototype.constructor=ai,oi.prototype=Object.create(ve.prototype),oi.prototype.constructor=oi;var si
vendor: 9,944 bytes, line 12
12={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha  = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop
12_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n  return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n    vec3 absDirection = abs(direction);\n    float face = -1.0;\n    if (absDirection.x > absDirection.z) {\n      if (absDirection.x > absDirection.y)\n        face = direction.x > 0.0 ? 0.0 : 3.0;\n      else\n        face = direction.y > 0.0 ? 1.0 : 4.0;\n    } else {\n      if (absDirection.z > absDirection.y)\n        face = direction.z > 0.0 ? 2.0 : 5.0;\n      else\n        face = direction.y > 0.0 ? 1.0 : 4.0;\n    }\n    return face;\n}\nvec2 getUV(vec3 direction, float face) {\n    vec2 uv;\n    if (face == 0.0) {\n      uv = vec2(direction.z, direction.y) / abs(direction.x);    } else if (face == 1.0) {\n      uv = vec2(-direction.x, -direction.z) / abs(direction.y);    } else if (face == 2.0) {\n      uv = vec2(-direction.x, direction.y) / abs(direction.z);    } else if (face == 3.0) {\n      uv = vec2(-direction.z, direction.y) / abs(direction.x);    } else if (face == 4.0) {\n      uv = vec2(-direction.x, direction.z) / abs(direction.y);    } else {\n      uv = vec2(direction.x, direction.y) / abs(direction.z);
vendor: 7,443 bytes, line 12
12    }\n    return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n  float face = getFace(direction);\n  float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n  mipInt = max(mipInt, cubeUV_minMipLevel);\n  float faceSize = exp2(mipInt);\n  float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n  vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n  vec2 f = fract(uv);\n  uv += 0.5 - f;\n  if (face > 2.0) {\n    uv.y += faceSize;\n    face -= 3.0;\n  }\n  uv.x += face * faceSize;\n  if(mipInt < cubeUV_maxMipLevel){\n    uv.y += 2.0 * cubeUV_maxTileSize;\n  }\n  uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n  uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n  uv *= texelSize;\n  vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n  uv.x += texelSize;\n  vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n  uv.y += texelSize;\n  vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n  uv.x -= texelSize;\n  vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n  vec3 tm = mix(tl, tr, f.x);\n  vec3 bm = mix(bl, br, f.x);\n  return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n  float mip = 0.0;\n  if (roughness >= r1) {\n    mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n  } else if (roughness >= r4) {\n    mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n  } else if (roughness >= r5) {\n    mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n  } else if (roughness >= r6) {\n    mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n  } else {\n    mip = -2.0 * log2(1.16 * roughness);  }\n  return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n  float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n  float mipF = fract(mip);\n  float mipInt = floor(mip);\n  vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n  if (mipF == 0.0) {\n    return vec4(color0, 1.0);\n  } else {\n    vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n    return vec4(mix(color0, color1, mipF), 1.0);\n  }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t}  else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t
12reflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t  vec3 reflectVec = reflect( -viewDir, normal );\n\t\t  reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t  vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t}
12 else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end
vendor: 9,106 bytes, line 12
12\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = 
12clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot
12( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\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\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\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\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\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\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );
12\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
12\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );
12\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;
12\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
12\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;
12\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},hi={basic:{uniforms:We([ii.common,ii.specularmap,ii.envmap,ii.aomap,ii.lightmap,ii.fog]),vertexShader:si.meshbasic_vert,fragmentShader:si.meshbasic_frag},lambert:{uniforms:We([ii.common,ii.specularmap,ii.envmap,ii.aomap,ii.lightmap,ii.emissivemap,ii.fog,ii.lights,{emissive:{value:new jt(0)}}]),vertexShader:si.meshlambert_vert,fragmentShader:si.meshlambert_frag},phong:{uniforms:We([ii.common,ii.specularmap,ii.envmap,ii.aomap,ii.lightmap,ii.emissivemap,ii.bumpmap,ii.normalmap,ii.displacementmap,ii.fog,ii.lights,{emissive:{value:new jt(0)},specular:{value:new jt(1118481)},shininess:{value:30}}]),vertexShader:si.meshphong_vert,fragmentShader:si.meshphong_frag},standard:{uniforms:We([ii.common,ii.envmap,ii.aomap,ii.lightmap,ii.emissivemap,ii.bumpmap,ii.normalmap,ii.displacementmap,ii.roughnessmap,ii.metalnessmap,ii.fog,ii.lights,{emissive:{value:new jt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:si.meshphysical_vert,fragmentShader:si.meshphysical_frag},toon:{uniforms:We([ii.common,ii.specularmap,ii.aomap,ii.lightmap,ii.emissivemap,ii.bumpmap,ii.normalmap,ii.displacementmap,ii.gradientmap,ii.fog,ii.lights,{emissive:{value:new jt(0)},specular:{value:new jt(1118481)},shininess:{value:30}}]),vertexShader:si.meshtoon_vert,fragmentShader:si.meshtoon_frag},matcap:{uniforms:We([ii.common,ii.bumpmap,ii.normalmap,ii.displacementmap,ii.fog,{matc
vendor: 14,154 bytes, line 12
12ap:{value:null}}]),vertexShader:si.meshmatcap_vert,fragmentShader:si.meshmatcap_frag},points:{uniforms:We([ii.points,ii.fog]),vertexShader:si.points_vert,fragmentShader:si.points_frag},dashed:{uniforms:We([ii.common,ii.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:si.linedashed_vert,fragmentShader:si.linedashed_frag},depth:{uniforms:We([ii.common,ii.displacementmap]),vertexShader:si.depth_vert,fragmentShader:si.depth_frag},normal:{uniforms:We([ii.common,ii.bumpmap,ii.normalmap,ii.displacementmap,{opacity:{value:1}}]),vertexShader:si.normal_vert,fragmentShader:si.normal_frag},sprite:{uniforms:We([ii.sprite,ii.fog]),vertexShader:si.sprite_vert,fragmentShader:si.sprite_frag},background:{uniforms:{uvTransform:{value:new g},t2D:{value:null}},vertexShader:si.background_vert,fragmentShader:si.background_frag},cube:{uniforms:We([ii.envmap,{opacity:{value:1}}]),vertexShader:si.cube_vert,fragmentShader:si.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:si.equirect_vert,fragmentShader:si.equirect_frag},distanceRGBA:{uniforms:We([ii.common,ii.displacementmap,{referencePosition:{value:new E},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:si.distanceRGBA_vert,fragmentShader:si.distanceRGBA_frag},shadow:{uniforms:We([ii.lights,ii.fog,{color:{value:new jt(0)},opacity:{value:1}}]),vertexShader:si.shadow_vert,fragmentShader:si.shadow_frag}};function ci(t,e,i,n){var r,a,o=new jt(0),s=0,h=null,c=0,l=null;function u(t,i){e.buffers.color.setClear(t.r,t.g,t.b,i,n)}return{getClearColor:function(){return o},setClearColor:function(t,e){o.set(t),u(o,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){u(o,s=t)},render:function(e,n,d,p){var f=n.background,m=t.xr,g=m.getSession&&m.getSession();if(g&&"additive"===g.environmentBlendMode&&(f=null),null===f?u(o,s):f&&f.isColor&&(u(f,1),p=!0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===a&&((a=new Ne(new je(1,1,1),new Ye({type:"BackgroundCubeMaterial",uniforms:Ve(hi.cube.uniforms),vertexShader:hi.cube.vertexShader,fragmentShader:hi.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(a));var v=f.isWebGLCubeRenderTarget?f.texture:f;a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture?-1:1,h===f&&c===v.version&&l===t.toneMapping||(a.material.needsUpdate=!0,h=f,c=v.version,l=t.toneMapping),e.unshift(a,a.geometry,a.material,0,0,null)}else f&&f.isTexture&&(void 0===r&&((r=new Ne(new oi(2,2),new Ye({type:"BackgroundMaterial",uniforms:Ve(hi.background.uniforms),vertexShader:hi.background.vertexShader,fragmentShader:hi.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(r)),r.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),r.material.uniforms.uvTransform.value.copy(f.matrix),h===f&&c===f.version&&l===t.toneMapping||(r.material.needsUpdate=!0,h=f,c=f.version,l=t.toneMapping),e.unshift(r,r.geometry,r.material,0,0,null))}}}function li(t,e,i,n){var r,a=n.isWebGL2;this.setMode=function(t){r=t},this.render=function(e,n){t.drawArrays(r,e,n),i.update(n,r)},this.renderInstances=function(n,o,s,h){if(0!==h){var c,l;if(a)c=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](r,o,s,h),i.update(s,r,h)}}}function ui(t,e,i){var n;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==i.precision?i.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var h=!0===i.logarithmicDepthBuffer,c=t.getParameter(34930),l=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=l>0,y=a||!!e.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==n)return n;var i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?t.getParameter(36183):0}}function di(){var t=this,e=null,i=0,n=!1,r=!1,a=new Pt,o=new g,s={value:null,needsUpdate:!1};function h(){s.value!==e&&(s.value=e,s.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function c(e,i,n,r){var h=null!==e?e.length:0,c=null;if(0!==h){if(c=s.value,!0!==r||null===c){var l=n+4*h,u=i.matrixWorldInverse;o.getNormalMatrix(u),(null===c||c.length<l)&&(c=new Float32Array(l));for(var d=0,p=n;d!==h;++d,p+=4)a.copy(e[d]).applyMatrix4(u,o),a.normal.toArray(c,p),c[p+3]=a.constant}s.value=c,s.needsUpdate=!0}return t.numPlanes=h,t.numIntersection=0,c}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,a){var o=0!==t.length||r||0!==i||n;return n=r,e=c(t,a,0),i=t.length,o},this.beginShadows=function(){r=!0,c(null)},this.endShadows=function(){r=!1,h()},this.setState=function(t,a,o,l,u,d){if(!n||null===t||0===t.length||r&&!o)r?c(null):h();else{var p=r?0:i,f=4*p,m=u.clippingState||null;s.value=m,m=c(t,l,f,d);for(var g=0;g!==f;++g)m[g]=e[g];u.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function pi(t){var e={};return{get:function(i){if(void 0!==e[i])return e[i];var n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return null===n&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),e[i]=n,n}}}function fi(t,e,i){var n=new WeakMap,r=new WeakMap;function a(t){var o=t.target,s=n.get(o);for(var h in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[h]);o.removeEventListener("dispose",a),n.delete(o);var c=r.get(s);c&&(e.remove(c),r.delete(s)),i.memory.geometries--}function o(t){var i=[],n=t.index,a=t.attributes.position,o=0;if(null!==n){var s=n.array;o=n.version;for(var h=0,c=s.length;h<c;h+=3){var l=s[h+0],u=s[h+1],d=s[h+2];i.push(l,u,u,d,d,l)}}else{s=a.array;o=a.version;for(h=0,c=s.length/3-1;h<c;h+=3){l=h+0,u=h+1,d=h+2;i.push(l,u,u,d,d,l)}}var p=new(ce(i)>65535?ae:ne)(i,1);p.version=o,e.update(p,34963);var f=r.get(t);f&&e.remove(f),r.set(t,p)}return{get:function(t,e){var r=n.get(e);return r||(e.addEventListener("dispose",a),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new ve).setFromObject(t)),r=e._bufferGeometry),n.set(e,r),i.memory.geometries++,r)},update:function(t){var i=t.index,n=t.attributes;for(var r in null!==i&&e.update(i,34963),n)e.update(n[r],34962);var a=t.morphAttributes;for(var r in a)for(var o=a[r],s=0,h=o.length;s<h;s++)e.update(o[s],34962)},getWireframeAttribute:function(t){var e=r.get(t);if(e){var i=t.index;null!==i&&e.version<i.version&&o(t)}else o(t);return r.get(t)}}}function mi(t,e,i,n){var r,a,o,s=n.isWebGL2;this.setMode=function(t){r=t},this.setIndex=function(t){a=t.type,o=t.bytesPerElement},this.render=function(e,n){t.drawElements(r,n,a,e*o),i.update(n,r)},this.renderInstances=function(n,h,c,l){if(0!==l){var u,d;if(s)u=t,d="drawElementsInstanced";else if(d="drawElementsInstancedANGLE",null===(u=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[d](r,c,a,h*o,l),i.update(c,r,l)}}}function gi(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,i,n){switch(n=n||1,e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function vi(t,e){return Math.abs(e[1])-Math.abs(t[1])}function yi(t){var e={},i=new Float32Array(8);return{update:function(n,r,a,o){var s=n.morphTargetInfluences,h=void 0===s?0:s.length,c=e[r.id];if(void 0===c){c=[];for(var l=0;l<h;l++)c[l]=[l,0];e[r.id]=c}var u=a.morphTargets&&r.morphAttributes.position,d=a.morphNormals&&r.morphAttributes.normal;for(l=0;l<h;l++){0!==(f=c[l])[1]&&(u&&r.deleteAttribute("morphTarget"+l),d&&r.deleteAttribute("morphNormal"+l))}for(l=0;l<h;l++){(f=c[l])[0]=l,f[1]=s[l]}c.sort(vi);var p=0;for(l=0;l<8;l++){var f;if(f=c[l]){var m=f[0],g=f[1];if(g){u&&r.setAttribute("morphTarget"+l,u[m]),d&&r.setAttribute("morphNormal"+l,d[m]),i[l]=g,p+=g;continue}}i[l]=0}var v=r.morphTargetsRelative?1:1-p;o.getUniforms().setValue(t,"morphTargetBaseInfluence",v),o.getUniforms().setValue(t,"morphTargetInfluences",i)}}}function xi(t,e,i,n){var r=new WeakMap;return{update:function(t){var a=n.render.frame,o=t.geometry,s=e.get(t,o);return r.get(s)!==a&&(o.isGeometry&&s.updateFromObject(t),e.update(s),r.set(s,a)),t.isInstancedMesh&&i.update(t.instanceMatrix,34962),s},dispose:function(){r=new WeakMap}}}function bi(t,e,i,n,r,a,o,s,h,c){t=void 0!==t?t:[],e=void 0!==e?e:301,o=void 0!==o?o:1022,x.call(this,t,e,i,n,r,a,o,s,h,c),this.flipY=!1}function _i(t,e,i,n){x.call(this,null),this.image={data:t||null,width:e||1,height:i||1,depth:n||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function wi(t,e,i,n){x.call(this,null),this.image={data:t||null,width:e||1,height:i||1,depth:n||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}hi.physical={uniforms:We([hi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new m(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new jt(0)},transparency:{value:0}}]),vertexShader:si.meshphysical_vert,fragmentShader:si.meshphysical_frag},bi.prototype=Object.create(x.prototype),bi.prototype.constructor=bi,bi.prototype.isCubeTexture=!0,Object.defineProperty(bi.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),_i.prototype=Object.create(x.prototype),_i.prototype.constructor=_i,_i.prototype.isDataTexture2DArray=!0,wi.prototype=Object.create(x.prototype),wi.prototype.constructor=wi,wi.prototype.isDataTexture3D=!0;var Mi=new x,Si=new _i,Ti=new wi,Ei=new bi,Ai=[],Pi=[],Ci=new Float32Array(16),Li=new Float32Array(9),Ri=new Float32Array(4);function Ii(t,e,i){var n=t[0];if(n<=0||n>0)return t;var r=e*i,a=Ai[r];if(void 0===a&&(a=new Float32Array(r),Ai[r]=a),0!==e){n.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=i,t[o].toArray(a,s)}return a}function Oi(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function Di(t,e){for(var i=0,n=e.length;i<n;i++)t[i]=e[i]}function Ni(t,e){var i=Pi[e];void 0===i&&(i=new Int32Array(e),Pi[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function ki(t,e){var i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function Fi(t,e){var i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(Oi(i,e))return;t.uniform2fv(this.addr,e),Di(i,e)}}function Gi(t,e){var i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(Oi(i,e))return;t.uniform3fv(this.addr,e),Di(i,e)}}function zi(t,e){var i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(Oi(i,e))return;t.uniform4fv(this.addr,e),Di(i,e)}}function Ui(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(Oi(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),Di(i,e)}else{if(Oi(i,n))return;Ri.set(n),t.uniformMatrix2fv(this.addr,!1,Ri),Di(i,n)}}function Bi(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(Oi(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),Di(i,e)}else{if(Oi(i,n))return;Li.set(n),t.uniformMatrix3fv(this.addr,!1,Li),Di(i,n)}}function Hi(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(Oi(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),Di(i,e)}else{if(Oi(i,n))return;Ci.set(n),t.uniformMatrix4fv(this.addr,!1,Ci),Di(i,n)}}
vendor: 4,717 bytes, line 12
12function ji(t,e,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(e||Mi,r)}function Vi(t,e,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||Si,r)}function Wi(t,e,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||Ti,r)}function Xi(t,e,i){var n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(e||Ei,r)}function Yi(t,e){var i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function qi(t,e){var i=this.cache;Oi(i,e)||(t.uniform2iv(this.addr,e),Di(i,e))}function Zi(t,e){var i=this.cache;Oi(i,e)||(t.uniform3iv(this.addr,e),Di(i,e))}function Ji(t,e){var i=this.cache;Oi(i,e)||(t.uniform4iv(this.addr,e),Di(i,e))}function Ki(t,e){var i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function Qi(t,e){t.uniform1fv(this.addr,e)}function $i(t,e){t.uniform1iv(this.addr,e)}function tn(t,e){t.uniform2iv(this.addr,e)}function en(t,e){t.uniform3iv(this.addr,e)}function nn(t,e){t.uniform4iv(this.addr,e)}function rn(t,e){var i=Ii(e,this.size,2);t.uniform2fv(this.addr,i)}function an(t,e){var i=Ii(e,this.size,3);t.uniform3fv(this.addr,i)}function on(t,e){var i=Ii(e,this.size,4);t.uniform4fv(this.addr,i)}function sn(t,e){var i=Ii(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function hn(t,e){var i=Ii(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function cn(t,e){var i=Ii(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function ln(t,e,i){var n=e.length,r=Ni(i,n);t.uniform1iv(this.addr,r);for(var a=0;a!==n;++a)i.safeSetTexture2D(e[a]||Mi,r[a])}function un(t,e,i){var n=e.length,r=Ni(i,n);t.uniform1iv(this.addr,r);for(var a=0;a!==n;++a)i.safeSetTextureCube(e[a]||Ei,r[a])}function dn(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return ki;case 35664:return Fi;case 35665:return Gi;case 35666:return zi;case 35674:return Ui;case 35675:return Bi;case 35676:return Hi;case 5124:case 35670:return Yi;case 35667:case 35671:return qi;case 35668:case 35672:return Zi;case 35669:case 35673:return Ji;case 5125:return Ki;case 35678:case 36198:case 36298:case 36306:case 35682:return ji;case 35679:case 36299:case 36307:return Wi;case 35680:case 36300:case 36308:case 36293:return Xi;case 36289:case 36303:case 36311:case 36292:return Vi}}(e.type)}function pn(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Qi;case 35664:return rn;case 35665:return an;case 35666:return on;case 35674:return sn;case 35675:return hn;case 35676:return cn;case 5124:case 35670:return $i;case 35667:case 35671:return tn;case 35668:case 35672:return en;case 35669:case 35673:return nn;case 35678:case 36198:case 36298:case 36306:case 35682:return ln;case 35680:case 36300:case 36308:case 36293:return un}}(e.type)}function fn(t){this.id=t,this.seq=[],this.map={}}pn.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Di(e,t)},fn.prototype.setValue=function(t,e,i){for(var n=this.seq,r=0,a=n.length;r!==a;++r){var o=n[r];o.setValue(t,e[o.id],i)}};var mn=/([\w\d_]+)(\])?(\[|\.)?/g;function gn(t,e){t.seq.push(e),t.map[e.id]=e}function vn(t,e,i){var n=t.name,r=n.length;for(mn.lastIndex=0;;){var a=mn.exec(n),o=mn.lastIndex,s=a[1],h="]"===a[2],c=a[3];if(h&&(s|=0),void 0===c||"["===c&&o+2===r){gn(i,void 0===c?new dn(s,t,e):new pn(s,t,e));break}var l=i.map[s];void 0===l&&gn(i,l=new fn(s)),i=l}}function yn(t,e){this.seq=[],this.map={};for(var i=t.getProgramParameter(e,35718),n=0;n<i;++n){var r=t.getActiveUniform(e,n);vn(r,t.getUniformLocation(e,r.name),this)}}function xn(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}yn.prototype.setValue=function(t,e,i,n){var r=this.map[e];void 0!==r&&r.setValue(t,i,n)},yn.prototype.setOptional=function(t,e,i){var n=e[i];void 0!==n&&this.setValue(t,i,n)},yn.upload=function(t,e,i,n){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=i[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,n)}},yn.seqWithValue=function(t,e){for(var i=[],n=0,r=t.length;n!==r;++n){var a=t[n];a.id in e&&i.push(a)}return i};var bn=0;function _n(t){switch(t){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}
12function wn(t,e,i){var n=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return n&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+i+"\n"+r+function(t){for(var e=t.split("\n"),i=0;i<e.length;i++)e[i]=i+1+": "+e[i];return e.join("\n")}(t.getShaderSource(e))}function Mn(t,e){var i=_n(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function Sn(t,e){var i;switch(e){case 1:i="Linear";break;case 2:i="Reinhard";break;case 3:i="Uncharted2";break;case 4:i="OptimizedCineon";break;case 5:i="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Tn(t){return""!==t}function En(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function An(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var Pn=/^[ \t]*#include +<([\w\d./]+)>/gm;function Cn(t){return t.replace(Pn,Ln)}function Ln(t,e){var i=si[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Cn(i)}var Rn=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,In=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function On(t){return t.replace(In,Nn).replace(Rn,Dn)}function Dn(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Nn(t,e,i,n)}function Nn(t,e,i,n){for(var r="",a=parseInt(e);a<parseInt(i);a++)r+=n.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function kn(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Fn(t,e,i){var n,r,a,o,s,h=t.getContext(),c=i.defines,l=i.vertexShader,u=i.fragmentShader,d=function(t){var e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(i),p=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:case 307:e="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:e="ENVMAP_TYPE_EQUIREC";break;case 305:e="ENVMAP_TYPE_SPHERE"}return e}(i),f=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 304:e="ENVMAP_MODE_REFRACTION"}return e}(i),m=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(i),g=t.gammaFactor>0?t.gammaFactor:1,v=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Tn).join("\n")}(i),y=function(t){var e=[];for(var i in t){var n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(c),x=h.createProgram();if(i.isRawShaderMaterial?((n=[y].filter(Tn).join("\n")).length>0&&(n+="\n"),(r=[v,y].filter(Tn).join("\n")).length>0&&(r+="\n")):(n=[kn(i),"#define SHADER_NAME "+i.shaderName,y,i.instancing?"#define USE_INSTANCING":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alph
vendor: 22,794 bytes, line 12
12aMap?"#define USE_ALPHAMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Tn).join("\n"),r=[v,kn(i),"#define SHADER_NAME "+i.shaderName,y,i.alphaTest?"#define ALPHATEST "+i.alphaTest+(i.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.envMap?"#define "+f:"",i.envMap?"#define "+m:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.sheen?"#define USE_SHEEN":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?si.tonemapping_pars_fragment:"",0!==i.toneMapping?Sn("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.outputEncoding||i.mapEncoding||i.matcapEncoding||i.envMapEncoding||i.emissiveMapEncoding||i.lightMapEncoding?si.encodings_pars_fragment:"",i.mapEncoding?Mn("mapTexelToLinear",i.mapEncoding):"",i.matcapEncoding?Mn("matcapTexelToLinear",i.matcapEncoding):"",i.envMapEncoding?Mn("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?Mn("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.lightMapEncoding?Mn("lightMapTexelToLinear",i.lightMapEncoding):"",i.outputEncoding?(a="linearToOutputTexel",o=i.outputEncoding,s=_n(o),"vec4 "+a+"( vec4 value ) { return LinearTo"+s[0]+s[1]+"; }"):"",i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Tn).join("\n")),l=An(l=En(l=Cn(l),i),i),u=An(u=En(u=Cn(u),i),i),l=On(l),u=On(u),i.isWebGL2&&!i.isRawShaderMaterial){var b=!1,_=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==l.match(_)&&null!==u.match(_)&&(b=!0,l=l.replace(_,""),u=u.replace(_,"")),n=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+n,r=["#version 300 es\n","#define varying in",b?"":"out highp vec4 pc_fragColor;",b?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+r}var w,M,S=r+u,T=xn(h,35633,n+l),E=xn(h,35632,S);if(h.attachShader(x,T),h.attachShader(x,E),void 0!==i.index0AttributeName?h.bindAttribLocation(x,0,i.index0AttributeName):!0===i.morphTargets&&h.bindAttribLocation(x,0,"position"),h.linkProgram(x),t.debug.checkShaderErrors){var A=h.getProgramInfoLog(x).trim(),P=h.getShaderInfoLog(T).trim(),C=h.getShaderInfoLog(E).trim(),L=!0,R=!0;if(!1===h.getProgramParameter(x,35714)){L=!1;var I=wn(h,T,"vertex"),O=wn(h,E,"fragment");console.error("THREE.WebGLProgram: shader error: ",h.getError(),"35715",h.getProgramParameter(x,35715),"gl.getProgramInfoLog",A,I,O)}else""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==P&&""!==C||(R=!1);R&&(this.diagnostics={runnable:L,programLog:A,vertexShader:{log:P,prefix:n},fragmentShader:{log:C,prefix:r}})}return h.deleteShader(T),h.deleteShader(E),this.getUniforms=function(){return void 0===w&&(w=new yn(h,x)),w},this.getAttributes=function(){return void 0===M&&(M=function(t,e){for(var i={},n=t.getProgramParameter(e,35721),r=0;r<n;r++){var a=t.getActiveAttrib(e,r).name;i[a]=t.getAttribLocation(e,a)}return i}(h,x)),M},this.destroy=function(){h.deleteProgram(x),this.program=void 0},this.name=i.shaderName,this.id=bn++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=T,this.fragmentShader=E,this}function Gn(t,e,i){var n=[],r=i.isWebGL2,a=i.logarithmicDepthBuffer,o=i.floatVertexTextures,s=i.precision,h=i.maxVertexUniforms,c=i.vertexTextures,l={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},u=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function d(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=3e3,e}this.getParameters=function(n,u,p,f,m,g,v){var y=f.fog,x=n.isMeshStandardMaterial?f.environment:null,b=n.envMap||x,_=l[n.type],w=v.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(o)return 1024;var i=h,n=Math.floor((i-20)/4),r=Math.min(n,e.length);return r<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+r+"."),0):r}(v):0;null!==n.precision&&(s=i.getMaxPrecision(n.precision))!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",s,"instead.");var M=function(t,e){var i;if(e){var n=hi[e];i={name:t.type,uniforms:Xe.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else i={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return i}(n,_);n.onBeforeCompile(M,t);var S=t.getRenderTarget();return{isWebGL2:r,shaderID:_,shaderName:M.name,uniforms:M.uniforms,vertexShader:M.vertexShader,fragmentShader:M.fragmentShader,defines:n.defines,isRawShaderMaterial:n.isRawShaderMaterial,isShaderMaterial:n.isShaderMaterial,precision:s,instancing:!0===v.isInstancedMesh,supportsVertexTextures:c,outputEncoding:null!==S?d(S.texture):t.outputEncoding,map:!!n.map,mapEncoding:d(n.map),matcap:!!n.matcap,matcapEncoding:d(n.matcap),envMap:!!b,envMapMode:b&&b.mapping,envMapEncoding:d(b),envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!n.lightMap,lightMapEncoding:d(n.lightMap),aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:d(n.emissiveMap),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,objectSpaceNormalMap:1===n.normalMapType,tangentSpaceNormalMap:0===n.normalMapType,clearcoatMap:!!n.clearcoatMap,clearcoatRoughnessMap:!!n.clearcoatRoughnessMap,clearcoatNormalMap:!!n.clearcoatNormalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,gradientMap:!!n.gradientMap,sheen:!!n.sheen,combine:n.combine,vertexTangents:n.normalMap&&n.vertexTangents,vertexColors:n.vertexColors,vertexUvs:!!(n.map||n.bumpMap||n.normalMap||n.specularMap||n.alphaMap||n.emissiveMap||n.roughnessMap||n.metalnessMap||n.clearcoatMap||n.clearcoatRoughnessMap||n.clearcoatNormalMap||n.displacementMap),uvsVertexOnly:!(n.map||n.bumpMap||n.normalMap||n.specularMap||n.alphaMap||n.emissiveMap||n.roughnessMap||n.metalnessMap||n.clearcoatNormalMap||!n.displacementMap),fog:!!y,useFog:n.fog,fogExp2:y&&y.isFogExp2,flatShading:n.flatShading,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:a,skinning:n.skinning&&w>0,maxBones:w,useVertexTexture:o,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:u.directional.length,numPointLights:u.point.length,numSpotLights:u.spot.length,numRectAreaLights:u.rectArea.length,numHemiLights:u.hemi.length,numDirLightShadows:u.directionalShadowMap.length,numPointLightShadows:u.pointShadowMap.length,numSpotLightShadows:u.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:g,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&p.length>0,shadowMapType:t.shadowMap.type,toneMapping:n.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:2===n.side,flipSided:1===n.side,depthPacking:void 0!==n.depthPacking&&n.depthPacking,index0AttributeName:n.index0AttributeName,extensionDerivatives:n.extensions&&n.extensions.derivatives,extensionFragDepth:n.extensions&&n.extensions.fragDepth,extensionDrawBuffers:n.extensions&&n.extensions.drawBuffers,extensionShaderTextureLOD:n.extensions&&n.extensions.shaderTextureLOD,rendererExtensionFragDepth:r||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:r||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:r||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:n.onBeforeCompile}},this.getProgramCacheKey=function(e){var i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)i.push(n),i.push(e.defines[n]);if(void 0===e.isRawShaderMaterial){for(var r=0;r<u.length;r++)i.push(e[u[r]]);i.push(t.outputEncoding),i.push(t.gammaFactor)}return i.push(e.onBeforeCompile.toString()),i.join()},this.acquireProgram=function(e,i){for(var r,a=0,o=n.length;a<o;a++){var s=n[a];if(s.cacheKey===i){++(r=s).usedTimes;break}}return void 0===r&&(r=new Fn(t,i,e),n.push(r)),r},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=n.indexOf(t);n[e]=n[n.length-1],n.pop(),t.destroy()}},this.programs=n}function zn(){var t=new WeakMap;return{get:function(e){var i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i},remove:function(e){t.delete(e)},update:function(e,i,n){t.get(e)[i]=n},dispose:function(){t=new WeakMap}}}function Un(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Bn(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Hn(){var t=[],e=0,i=[],n=[],r={id:-1};function a(i,n,a,o,s,h){var c=t[e];return void 0===c?(c={id:i.id,object:i,geometry:n,material:a,program:a.program||r,groupOrder:o,renderOrder:i.renderOrder,z:s,group:h},t[e]=c):(c.id=i.id,c.object=i,c.geometry=n,c.material=a,c.program=a.program||r,c.groupOrder=o,c.renderOrder=i.renderOrder,c.z=s,c.group=h),e++,c}return{opaque:i,transparent:n,init:function(){e=0,i.length=0,n.length=0},push:function(t,e,r,o,s,h){var c=a(t,e,r,o,s,h);(!0===r.transparent?n:i).push(c)},unshift:function(t,e,r,o,s,h){var c=a(t,e,r,o,s,h);(!0===r.transparent?n:i).unshift(c)},finish:function(){for(var i=e,n=t.length;i<n;i++){var r=t[i];if(null===r.id)break;r.id=null,r.object=null,r.geometry=null,r.material=null,r.program=null,r.group=null}},sort:function(t,e){i.length>1&&i.sort(t||Un),n.length>1&&n.sort(e||Bn)}}}function jn(){var t=new WeakMap;function e(i){var n=i.target;n.removeEventListener("dispose",e),t.delete(n)}return{get:function(i,n){var r,a=t.get(i);return void 0===a?(r=new Hn,t.set(i,new WeakMap),t.get(i).set(n,r),i.addEventListener("dispose",e)):void 0===(r=a.get(n))&&(r=new Hn,a.set(n,r)),r},dispose:function(){t=new WeakMap}}}function Vn(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var i;switch(e.type){case"DirectionalLight":i={direction:new E,color:new jt};break;case"SpotLight":i={position:new E,direction:new E,color:new jt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new E,color:new jt,distance:0,decay:0};break;case"HemisphereLight":i={direction:new E,skyColor:new jt,groundColor:new jt};break;case"RectAreaLight":i={color:new jt,position:new E,halfWidth:new E,halfHeight:new E}}return t[e.id]=i,i}}}var Wn=0;function Xn(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Yn(){for(var t,e=new Vn,i=(t={},{get:function(e){if(void 0!==t[e.id])return t[e.id];var i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowRadius:1,shadowMapSize:new m};break;case"PointLight":i={shadowBias:0,shadowRadius:1,shadowMapSize:new m,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=0;r<9;r++)n.probe.push(new E);var a=new E,o=new D,s=new D;return{setup:function(t,r,h){for(var c=0,l=0,u=0,d=0;d<9;d++)n.probe[d].set(0,0,0);var p=0,f=0,m=0,g=0,v=0,y=0,x=0,b=0,_=h.matrixWorldInverse;t.sort(Xn),d=0;for(var w=t.length;d<w;d++){var M=t[d],S=M.color,T=M.intensity,E=M.distance,A=M.shadow&&M.shadow.map?M.shadow.map.texture:null;if(M.isAmbientLight)c+=S.r*T,l+=S.g*T,u+=S.b*T;else if(M.isLightProbe)for(var P=0;P<9;P++)n.probe[P].addScaledVector(M.sh.coefficients[P],T);else if(M.isDirectionalLight){if((R=e.get(M)).color.copy(M.color).multiplyScalar(M.intensity),R.direction.setFromMatrixPosition(M.matrixWorld),a.setFromMatrixPosition(M.target.matrixWorld),R.direction.sub(a),R.direction.transformDirection(_),M.castShadow){var C=M.shadow;(L=i.get(M)).shadowBias=C.bias,L.shadowRadius=C.radius,L.shadowMapSize=C.mapSize,n.directionalShadow[p]=L,n.directionalShadowMap[p]=A,n.directionalShadowMatrix[p]=M.shadow.matrix,y++}n.directional[p]=R,p++}else if(M.isSpotLight){if((R=e.get(M)).position.setFromMatrixPosition(M.matrixWorld),R.position.applyMatrix4(_),R.color.copy(S).multiplyScalar(T),R.distance=E,R.direction.setFromMatrixPosition(M.matrixWorld),a.setFromMatrixPosition(M.target.matrixWorld),R.direction.sub(a),R.direction.transformDirection(_),R.coneCos=Math.cos(M.angle),R.penumbraCos=Math.cos(M.angle*(1-M.penumbra)),R.decay=M.decay,M.castShadow){C=M.shadow;(L=i.get(M)).shadowBias=C.bias,L.shadowRadius=C.radius,L.shadowMapSize=C.mapSize,n.spotShadow[m]=L,n.spotShadowMap[m]=A,n.spotShadowMatrix[m]=M.shadow.matrix,b++}n.spot[m]=R,m++}else if(M.isRectAreaLight){(R=e.get(M)).color.copy(S).multiplyScalar(T),R.position.setFromMatrixPosition(M.matrixWorld),R.position.applyMatrix4(_),s.identity(),o.copy(M.matrixWorld),o.premultiply(_),s.extractRotation(o),R.halfWidth.set(.5*M.width,0,0),R.halfHeight.set(0,.5*M.height,0),R.halfWidth.applyMatrix4(s),R.halfHeight.applyMatrix4(s),n.rectArea[g]=R,g++}else if(M.isPointLight){if((R=e.get(M)).position.setFromMatrixPosition(M.matrixWorld),R.position.applyMatrix4(_),R.color.copy(M.color).multiplyScalar(M.intensity),R.distance=M.distance,R.decay=M.decay,M.castShadow){var L;C=M.shadow;(L=i.get(M)).shadowBias=C.bias,L.shadowRadius=C.radius,L.shadowMapSize=C.mapSize,L.shadowCameraNear=C.camera.near,L.shadowCameraFar=C.camera.far,n.pointShadow[f]=L,n.pointShadowMap[f]=A,n.pointShadowMatrix[f]=M.shadow.matrix,x++}n.point[f]=R,f++}else if(M.isHemisphereLight){var R;(R=e.get(M)).direction.setFromMatrixPosition(M.matrixWorld),R.direction.transformDirection(_),R.direction.normalize(),R.skyColor.copy(M.color).multiplyScalar(T),R.groundColor.copy(M.groundColor).multiplyScalar(T),n.hemi[v]=R,v++}}n.ambient[0]=c,n.ambient[1]=l,n.ambient[2]=u;var I=n.hash;I.directionalLength===p&&I.pointLength===f&&I.spotLength===m&&I.rectAreaLength===g&&I.hemiLength===v&&I.numDirectionalShadows===y&&I.numPointShadows===x&&I.numSpotShadows===b||(n.directional.length=p,n.spot.length=m,n.rectArea.length=g,n.point.length=f,n.hemi.length=v,n.directionalShadow.length=y,n.directionalShadowMap.length=y,n.pointShadow.length=x,n.pointShadowMap.length=x,n.spotShadow.length=b,n.spotShadowMap.length=b,n.directionalShadowMatrix.length=y,n.pointShadowMatrix.length=x,n.spotShadowMatrix.length=b,I.directionalLength=p,I.pointLength=f,I.spotLength=m,I.rectAreaLength=g,I.hemiLength=v,I.numDirectionalShadows=y,I.numPointShadows=x,I.numSpotShadows=b,n.version=Wn++)},state:n}}function qn(){var t=new Yn,e=[],i=[];return{init:function(){e.length=0,i.length=0},state:{lightsArray:e,shadowsArray:i,lights:t},setupLights:function(n){t.setup(e,i,n)},pushLight:function(t){e.push(t)},pushShadow:function(t){i.push(t)}}}function Zn(){var t=new WeakMap;function e(i){var n=i.target;n.removeEventListener("dispose",e),t.delete(n)}return{get:function(i,n){var r;return!1===t.has(i)?(r=new qn,t.set(i,new WeakMap),t.get(i).set(n,r),i.addEventListener("dispose",e)):!1===t.get(i).has(n)?(r=new qn,t.get(i).set(n,r)):r=t.get(i).get(n),r},dispose:function(){t=new WeakMap}}}function Jn(t){Zt.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Kn(t){Zt.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new E,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Jn.prototype=Object.create(Zt.prototype),Jn.prototype.constructor=Jn,Jn.prototype.isMeshDepthMaterial=!0,Jn.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Kn.prototype=Object.create(Zt.prototype),Kn.prototype.constructor=Kn,Kn.prototype.isMeshDistanceMaterial=!0,Kn.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};function Qn(t,e,i){var n=new ei,r=new m,a=new m,o=new b,s=[],h=[],c={},l={0:1,1:0,2:2},u=new Ye({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new m},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n  float mean = 0.0;\n  float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy  ) / resolution ) );
12\n  for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n    #ifdef HORIZONAL_PASS\n      vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n      mean += distribution.x;\n      squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n    #else\n      float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0,  i )  * radius ) / resolution ) );\n      mean += depth;\n      squared_mean += depth * depth;\n    #endif\n  }\n  mean = mean * HALF_SAMPLE_RATE;\n  squared_mean = squared_mean * HALF_SAMPLE_RATE;\n  float std_dev = sqrt( squared_mean - mean * mean );\n  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=u.clone();d.defines.HORIZONAL_PASS=1;var p=new ve;p.setAttribute("position",new Qt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Ne(p,u),g=this;function v(i,n){var r=e.update(f);u.uniforms.shadow_pass.value=i.map.texture,u.uniforms.resolution.value=i.mapSize,u.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,u,f,null),d.uniforms.shadow_pass.value=i.mapPass.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,d,f,null)}function y(t,e,i){var n=t<<0|e<<1|i<<2,r=s[n];return void 0===r&&(r=new Jn({depthPacking:3201,morphTargets:t,skinning:e}),s[n]=r),r}function x(t,e,i){var n=t<<0|e<<1|i<<2,r=h[n];return void 0===r&&(r=new Kn({morphTargets:t,skinning:e}),h[n]=r),r}function w(e,i,n,r,a,o,s){var h=null,u=y,d=e.customDepthMaterial;if(!0===r.isPointLight&&(u=x,d=e.customDistanceMaterial),void 0===d){var p=!1;!0===n.morphTargets&&(p=i.morphAttributes&&i.morphAttributes.position&&i.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),h=u(p,f,!0===e.isInstancedMesh)}else h=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=h.uuid,g=n.uuid,v=c[m];void 0===v&&(v={},c[m]=v);var b=v[g];void 0===b&&(b=h.clone(),v[g]=b),h=b}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=3===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:l[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===r.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(r.matrixWorld),h.nearDistance=a,h.farDistance=o),h}function M(i,r,a,o,s){if(!1!==i.visible){if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===s)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,i.matrixWorld);var h=e.update(i),c=i.material;if(Array.isArray(c))for(var l=h.groups,u=0,d=l.length;u<d;u++){var p=l[u],f=c[p.materialIndex];if(f&&f.visible){var m=w(i,h,f,o,a.near,a.far,s);t.renderBufferDirect(a,null,h,m,i,p)}}else if(c.visible){m=w(i,h,c,o,a.near,a.far,s);t.renderBufferDirect(a,null,h,m,i,null)}}for(var g=i.children,v=0,y=g.length;v<y;v++)M(g[v],r,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,h){if(!1!==g.enabled&&(!1!==g.autoUpdate||!1!==g.needsUpdate)&&0!==e.length){var c=t.getRenderTarget(),l=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),d=t.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var p=0,f=e.length;p<f;p++){var m=e[p],y=m.shadow;if(void 0!==y){r.copy(y.mapSize);var x=y.getFrameExtents();if(r.multiply(x),a.copy(y.mapSize),(r.x>i||r.y>i)&&(r.x>i&&(a.x=Math.floor(i/x.x),r.x=a.x*x.x,y.mapSize.x=a.x),r.y>i&&(a.y=Math.floor(i/x.y),r.y=a.y*x.y,y.mapSize.y=a.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new _(r.x,r.y,b),y.map.texture.name=m.name+".shadowMap",y.mapPass=new _(r.x,r.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){b={minFilter:1003,magFilter:1003,format:1023};y.map=new _(r.x,r.y,b),y.map.texture.name=m.name+".shadowMap",y.camera.updateProjectionMatrix()}
12t.setRenderTarget(y.map),t.clear();for(var w=y.getViewportCount(),S=0;S<w;S++){var T=y.getViewport(S);o.set(a.x*T.x,a.y*T.y,a.x*T.z,a.y*T.w),d.viewport(o),y.updateMatrices(m,S),n=y.getFrustum(),M(s,h,y.camera,m,this.type)}y.isPointLightShadow||3!==this.type||v(y,h)}else console.warn("THREE.WebGLShadowMap:",m,"has no shadow.")}g.needsUpdate=!1,t.setRenderTarget(c,l,u)}}}function $n(t,e,i){var n=i.isWebGL2;var r=new function(){var e=!1,i=new b,n=null,r=new b(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,a,o,s){!0===s&&(e*=o,n*=o,a*=o),i.set(e,n,a,o),!1===r.equals(i)&&(t.clearColor(e,n,a,o),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}},a=new function(){var e=!1,i=null,n=null,r=null;return{setTest:function(t){t?z(2929):U(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}},o=new function(){var e=!1,i=null,n=null,r=null,a=null,o=null,s=null,h=null,c=null;return{setTest:function(t){e||(t?z(2960):U(2960))},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,o){n===e&&r===i&&a===o||(t.stencilFunc(e,i,o),n=e,r=i,a=o)},setOp:function(e,i,n){o===e&&s===i&&h===n||(t.stencilOp(e,i,n),o=e,s=i,h=n)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,i=null,n=null,r=null,a=null,o=null,s=null,h=null,c=null}}},s=t.getParameter(34921),h=new Uint8Array(s),c=new Uint8Array(s),l=new Uint8Array(s),u={},d=null,p=null,f=null,m=null,g=null,v=null,y=null,x=null,_=null,w=!1,M=null,S=null,T=null,E=null,A=null,P=t.getParameter(35661),C=!1,L=0,R=t.getParameter(7938);-1!==R.indexOf("WebGL")?(L=parseFloat(/^WebGL\ ([0-9])/.exec(R)[1]),C=L>=1):-1!==R.indexOf("OpenGL ES")&&(L=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),C=L>=2);var I=null,O={},D=new b,N=new b;function k(e,i,n){var r=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var o=0;o<n;o++)t.texImage2D(i+o,0,6408,1,1,0,6408,5121,r);return a}var F={};function G(i,r){(h[i]=1,0===c[i]&&(t.enableVertexAttribArray(i),c[i]=1),l[i]!==r)&&((n?t:e.get("ANGLE_instanced_arrays"))[n?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),l[i]=r)}function z(e){!0!==u[e]&&(t.enable(e),u[e]=!0)}function U(e){!1!==u[e]&&(t.disable(e),u[e]=!1)}F[3553]=k(3553,3553,1),F[34067]=k(34067,34069,6),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),z(2929),a.setFunc(3),W(!1),X(1),z(2884),V(0);var B={100:32774,101:32778,102:32779};if(n)B[103]=32775,B[104]=32776;else{var H=e.get("EXT_blend_minmax");null!==H&&(B[103]=H.MIN_EXT,B[104]=H.MAX_EXT)}var j={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function V(e,i,n,r,a,o,s,h){if(0!==e){if(p||(z(3042),p=!0),5===e)a=a||i,o=o||n,s=s||r,i===m&&a===y||(t.blendEquationSeparate(B[i],B[a]),m=i,y=a),n===g&&r===v&&o===x&&s===_||(t.blendFuncSeparate(j[n],j[r],j[o],j[s]),g=n,v=r,x=o,_=s),f=e,w=null;else if(e!==f||h!==w){if(100===m&&100===y||(t.blendEquation(32774),m=100,y=100),h)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}g=null,v=null,x=null,_=null,f=e,w=h}}else p&&(U(3042),p=!1)}function W(e){M!==e&&(e?t.frontFace(2304):t.frontFace(2305),M=e)}function X(e){0!==e?(z(2884),e!==S&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):U(2884),S=e}function Y(e,i,n){e?(z(32823),E===i&&A===n||(t.polygonOffset(i,n),E=i,A=n)):U(32823)}function q(e){void 0===e&&(e=33984+P-1),I!==e&&(t.activeTexture(e),I=e)}return{buffers:{color:r,depth:a,stencil:o},initAttributes:function(){for(var t=0,e=h.length;t<e;t++)h[t]=0},enableAttribute:function(t){G(t,0)},enableAttributeAndDivisor:G,disableUnusedAttributes:function(){for(var e=0,i=c.length;e!==i;++e)c[e]!==h[e]&&(t.disableVertexAttribArray(e),c[e]=0)},vertexAttribPointer:function(e,i,r,a,o,s){!0!==n||5124!==r&&5125!==r?t.vertexAttribPointer(e,i,r,a,o,s):t.vertexAttribIPointer(e,i,r,a,o,s)},enable:z,disable:U,useProgram:function(e){return d!==e&&(t.useProgram(e),d=e,!0)},setBlending:V,setMaterial:function(t,e){2===t.side?U(2884):z(2884);var i=1===t.side;e&&(i=!i),W(i),1===t.blending&&!1===t.transparent?V(0):V(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),a.setFunc(t.depthFunc),a.setTest(t.depthTest),a.setMask(t.depthWrite),r.setMask(t.colorWrite);var n=t.stencilWrite;o.setTest(n),n&&(o.setMask(t.stencilWriteMask),o.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),o.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Y(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:W,setCullFace:X,setLineWidth:function(e){e!==T&&(C&&t.lineWidth(e),T=e)},setPolygonOffset:Y,setScissorTest:function(t){t?z(3089):U(3089)},activeTexture:q,bindTexture:function(e,i){null===I&&q();var n=O[I];void 0===n&&(n={type:void 0,texture:void 0},O[I]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||F[e]),n.type=e,n.texture=i)},unbindTexture:function(){var e=O[I];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===D.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),D.copy(e))},viewport:function(e){!1===N.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),N.copy(e))},reset:function(){for(var e=0;e<c.length;e++)1===c[e]&&(t.disableVertexAttribArray(e),c[e]=0);u={},I=null,O={},d=null,f=null,M=null,S=null,r.reset(),a.reset(),o.reset()}}}function tr(t,e,i,n,r,a,o){var s,h=r.isWebGL2,c=r.maxTextures,l=r.maxCubemapSize,u=r.maxTextureSize,d=r.maxSamples,p=new WeakMap,m=!1;try{m="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function g(t,e){return m?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(t,e,i,n){var r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?f.floorPowerOfTwo:Math.floor,o=a(r*t.
12width),h=a(r*t.height);void 0===s&&(s=g(o,h));var c=i?g(o,h):s;return c.width=o,c.height=h,c.getContext("2d").drawImage(t,0,0,o,h),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+h+")."),c}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return f.isPowerOfTwo(t.width)&&f.isPowerOfTwo(t.height)}function x(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function b(e,i,r,a){t.generateMipmap(e),n.get(i).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function _(i,n,r){if(!1===h)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}var a=n;return 6403===n&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r&&(a=33321)),6407===n&&(5126===r&&(a=34837),5131===r&&(a=34843),5121===r&&(a=32849)),6408===n&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||e.get("EXT_color_buffer_float"),a}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function M(e){var i=e.target;i.removeEventListener("dispose",M),function(e){var i=n.get(e);if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture),n.remove(e)}(i),i.isVideoTexture&&p.delete(i),o.memory.textures--}function S(e){var i=e.target;i.removeEventListener("dispose",S),function(e){var i=n.get(e),r=n.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(i.__webglFramebuffer[a]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[a]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}(i),o.memory.textures--}var T=0;function E(t,e){var r=n.get(t);if(t.isVideoTexture&&function(t){var e=o.render.frame;p.get(t)!==e&&(p.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){var a=t.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void O(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function A(e,r){if(6===e.image.length){var o=n.get(e);if(e.version>0&&o.__version!==e.version){I(o,e),i.activeTexture(33984+r),i.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),c=e.image[0]&&e.image[0].isDataTexture,u=[],d=0;d<6;d++)u[d]=s||c?c?e.image[d].image:e.image[d]:v(e.image[d],!1,!0,l);var p,f=u[0],m=y(f)||h,g=a.convert(e.format),w=a.convert(e.type),M=_(e.internalFormat,g,w);if(R(34067,e,m),s){for(d=0;d<6;d++){p=u[d].mipmaps;for(var S=0;S<p.length;S++){var T=p[S];1023!==e.format&&1022!==e.format?null!==g?i.compressedTexImage2D(34069+d,S,M,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+d,S,M,T.width,T.height,0,g,w,T.data)}}o.__maxMipLevel=p.length-1}else{p=e.mipmaps;for(d=0;d<6;d++)if(c){i.texImage2D(34069+d,0,M,u[d].width,u[d].height,0,g,w,u[d].data);for(S=0;S<p.length;S++){var E=(T=p[S]).image[d].image;i.texImage2D(34069+d,S+1,M,E.width,E.height,0,g,w,E.data)}}else{i.texImage2D(34069+d,0,M,g,w,u[d]);for(S=0;S<p.length;S++){T=p[S];i.texImage2D(34069+d,S+1,M,g,w,T.image[d])}}o.__maxMipLevel=p.length}x(e,m)&&b(34067,e,f.width,f.height),o.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(33984+r),i.bindTexture(34067,o.__webglTexture)}}function P(t,e){i.activeTexture(33984+e),i.bindTexture(34067,n.get(t).__webglTexture)}var C={1e3:10497,1001:33071,1002:33648},L={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function R(i,a,o){o?(t.texParameteri(i,10242,C[a.wrapS]),t.texParameteri(i,10243,C[a.wrapT]),32879!==i&&35866!==i||t.texParameteri(i,32882,C[a.wrapR]),t.texParameteri(i,10240,L[a.magFilter]),t.texParameteri(i,10241,L[a.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),32879!==i&&35866!==i||t.texParameteri(i,32882,33071),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,w(a.magFilter)),t.texParameteri(i,10241,w(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(1015===a.type&&null===e.get("OES_texture_float_linear"))return;if(1016===a.type&&null===(h||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(t.texParameterf(i,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function I(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",M),e.__webglTexture=t.createTexture(),o.memory.textures++)}function O(e,n,r){var o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),I(e,n),i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);var s=function(t){return!h&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(n)&&!1===y(n.image),c=v(n.image,s,!1,u),l=y(c)||h,d=a.convert(n.format),p=a.convert(n.type),f=_(n.internalFormat,d,p);R(o,n,l);var m,g=n.mipmaps;if(n.isDepthTexture)f=6402,h?f=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===f&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,p=a.convert(n.type)),1027===n.format&&6402===f&&(f=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,p=a.convert(n.type))),i.texImage2D(3553,0,f,c.width,c.height,0,d,p,null);else if(n.isDataTexture)if(g.length>0&&l){for(var w=0,M=g.length;w<M;w++)m=g[w],i.texImage2D(3553,w,f,m.width,m.height,0,d,p,m.data);n.generateMipmaps=!1,e.__maxMipLevel=g.length-1}else i.texImage2D(3553,0,f,c.width,c.height,0,d,p,c.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(w=0,M=g.length;w<M;w++)m=g[w],1023!==n.format&&1022!==n.format?null!==d?i.compressedTexImage2D(3553,w,f,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,w,f,m.width,m.height,0,d,p,m.data);e.__maxMipLevel=g.length-1}else if(n.isDataTexture2DArray)i.texImage3D(35866,0,f,c.width,c.height,c.depth,0,d,p,c.data),e.__maxMipLevel=0;else if(n.isDataTexture3D)i.texImage3D(32879,0,f,c.width,c.height,c.depth,0,d,p,c.data),e.__maxMipLevel=0;else if(g.length>0&&l){for(w=0,M=g.length;w<M;w++)m=g[w],i.texImage2D(3553,w,f,d,p,m);n.generateMipmaps=!1,e.__maxMipLevel=g.length-1}else i.texImage2D(3553,0,f,d,p,c),e.__maxMipLevel=0;
12x(n,l)&&b(o,n,c.width,c.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function D(e,r,o,s){var h=a.convert(r.texture.format),c=a.convert(r.texture.type),l=_(r.texture.internalFormat,h,c);i.texImage2D(s,0,l,r.width,r.height,0,h,c,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,o,s,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function N(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){var r=33189;if(n){var o=i.depthTexture;o&&o.isDepthTexture&&(1015===o.type?r=36012:1014===o.type&&(r=33190));var s=F(i);t.renderbufferStorageMultisample(36161,s,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){if(n){s=F(i);t.renderbufferStorageMultisample(36161,s,35056,i.width,i.height)}else t.renderbufferStorage(36161,34041,i.width,i.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var h=a.convert(i.texture.format),c=a.convert(i.texture.type);r=_(i.texture.internalFormat,h,c);if(n){s=F(i);t.renderbufferStorageMultisample(36161,s,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height)}t.bindRenderbuffer(36161,null)}function k(e){var i=n.get(e),r=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),E(i.depthTexture,0);var r=n.get(i.depthTexture).__webglTexture;if(1026===i.depthTexture.format)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(1027!==i.depthTexture.format)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(36160,i.__webglFramebuffer[a]),i.__webglDepthbuffer[a]=t.createRenderbuffer(),N(i.__webglDepthbuffer[a],e,!1)}else t.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),N(i.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function F(t){return h&&t.isWebGLMultisampleRenderTarget?Math.min(d,t.samples):0}var G=!1,z=!1;this.allocateTextureUnit=function(){var t=T;return t>=c&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+c),T+=1,t},this.resetTextureUnits=function(){T=0},this.setTexture2D=E,this.setTexture2DArray=function(t,e){var r=n.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){var r=n.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=A,this.setTextureCubeDynamic=P,this.setupRenderTarget=function(e){var r=n.get(e),s=n.get(e.texture);e.addEventListener("dispose",S),s.__webglTexture=t.createTexture(),o.memory.textures++;var c=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,u=y(e)||h;if(!h||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){r.__webglFramebuffer=[];for(var d=0;d<6;d++)r.__webglFramebuffer[d]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),l)if(h){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);var p=a.convert(e.texture.format),f=a.convert(e.texture.type),m=_(e.texture.internalFormat,p,f),g=F(e);t.renderbufferStorageMultisample(36161,g,m,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRen
12derbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),N(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){i.bindTexture(34067,s.__webglTexture),R(34067,e.texture,u);for(d=0;d<6;d++)D(r.__webglFramebuffer[d],e,36064,34069+d);x(e.texture,u)&&b(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,s.__webglTexture),R(3553,e.texture,u),D(r.__webglFramebuffer,e,36064,3553),x(e.texture,u)&&b(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&k(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(x(e,y(t)||h)){var r=t.isWebGLCubeRenderTarget?34067:3553,a=n.get(e).__webglTexture;i.bindTexture(r,a),b(r,e,t.width,t.height),i.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(h){var i=n.get(e);t.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,i.__webglFramebuffer);var r=e.width,a=e.height,o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===G&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),G=!0),t=t.texture),E(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===z&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),z=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?A(t,e):P(t,e)}}function er(t,e,i){var n=i.isWebGL2;return{convert:function(t){var i;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return n?5131:null!==(i=e.get("OES_texture_half_float"))?i.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(i=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(i=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(i=e.get("WEBGL_compressed_texture_etc1"))?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(i=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return i.COMPRESSED_RGB8_ETC2;if(37496===t)return i.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(i=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(i=e.get("EXT_texture_compression_bptc"))?t:null:1020===t?n?34042:null!==(i=e.get("WEBGL_depth_texture"))?i.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function ir(t){Ze.call(this),this.cameras=t||[]}function nr(){Q.call(this),this.type="Group"}function rr(){this._targetRay=null,this._grip=null}function ar(t,e){var i=this,n=null,r=1,a=null,o="local-floor",s=null,h=[],c=new Map,l=new Ze;l.layers.enable(1),l.viewport=new b;var u=new Ze;u.layers.enable(2),u.viewport=new b;var d=[l,u],p=new ir;p.layers.enable(1),p.layers.enable(2);var f=null,m=null;function g(t){var e=c.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}
12function v(){c.forEach((function(t,e){t.disconnect(e)})),c.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),T.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function y(t){a=t,T.setContext(n),T.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}function x(t){for(var e=n.inputSources,i=0;i<h.length;i++)c.set(e[i],h[i]);for(i=0;i<t.removed.length;i++){var r=t.removed[i];(a=c.get(r))&&(a.dispatchEvent({type:"disconnected",data:r}),c.delete(r))}for(i=0;i<t.added.length;i++){var a;r=t.added[i];(a=c.get(r))&&a.dispatchEvent({type:"connected",data:r})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=h[t];return void 0===e&&(e=new rr,h[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){var e=h[t];return void 0===e&&(e=new rr,h[t]=e),e.getGripSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return a},this.getSession=function(){return n},this.setSession=function(t){if(null!==(n=t)){n.addEventListener("select",g),n.addEventListener("selectstart",g),n.addEventListener("selectend",g),n.addEventListener("squeeze",g),n.addEventListener("squeezestart",g),n.addEventListener("squeezeend",g),n.addEventListener("end",v);var i=e.getContextAttributes();!0!==i.xrCompatible&&e.makeXRCompatible();var a={antialias:i.antialias,alpha:i.alpha,depth:i.depth,stencil:i.stencil,framebufferScaleFactor:r},s=new XRWebGLLayer(n,e,a);n.updateRenderState({baseLayer:s}),n.requestReferenceSpace(o).then(y),n.addEventListener("inputsourceschange",x)}};var _=new E,w=new E;function M(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){p.near=u.near=l.near=t.near,p.far=u.far=l.far=t.far,f===p.near&&m===p.far||(n.updateRenderState({depthNear:p.near,depthFar:p.far}),f=p.near,m=p.far);var e=t.parent,i=p.cameras;M(p,e);for(var r=0;r<i.length;r++)M(i[r],e);t.matrixWorld.copy(p.matrixWorld);for(var a=t.children,o=(r=0,a.length);r<o;r++)a[r].updateMatrixWorld(!0);return 2===i.length?function(t,e,i){_.setFromMatrixPosition(e.matrixWorld),w.setFromMatrixPosition(i.matrixWorld);var n=_.distanceTo(w),r=e.projectionMatrix.elements,a=i.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),h=(r[9]+1)/r[5],c=(r[9]-1)/r[5],l=(r[8]-1)/r[0],u=(a[8]+1)/a[0],d=o*l,p=o*u,f=n/(-l+u),m=f*-l;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=o+f,v=s+f,y=d-m,x=p+(n-m),b=h*s/v*g,M=c*s/v*g;t.projectionMatrix.makePerspective(y,x,b,M,g,v)}(p,l,u):p.projectionMatrix.copy(l.projectionMatrix),p};var S=null;var T=new ni;T.setAnimationLoop((function(e,i){if(null!==(s=i.getViewerPose(a))){var r=s.views,o=n.renderState.baseLayer;t.setFramebuffer(o.framebuffer);var c=!1;r.length!==p.cameras.length&&(p.cameras.length=0,c=!0);for(var l=0;l<r.length;l++){var u=r[l],f=o.getViewport(u),m=d[l];m.matrix.fromArray(u.transform.matrix),m.projectionMatrix.fromArray(u.projectionMatrix),m.viewport.set(f.x,f.y,f.width,f.height),0===l&&p.matrix.copy(m.matrix),!0===c&&p.cameras.push(m)}}var g=n.inputSources;for(l=0;l<h.length;l++){var v=h[l],y=g[l];v.update(y,i,a)}S&&S(e,i)})),this.setAnimationLoop=function(t){S=t},this.dispose=function(){}}function or(t){function e(e,i,n){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.specularMap&&(e.specularMap.value=i.specularMap);var r,a,o=i.envMap||n;o&&(e.envMap.value=o,e.flipEnvMap.value=o.isCubeTexture?-1:1,e.reflectivity.value=i.reflectivity,e.refractionRatio.value=i.refractionRatio,e.maxMipLevel.value=t.get(o).__maxMipLevel),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.ao
12MapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap&&(r=i.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),i.aoMap?a=i.aoMap:i.lightMap&&(a=i.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),e.uv2Transform.value.copy(a.matrix))}function i(t,e,i){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||i)&&(t.envMapIntensity.value=e.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,a,o){n.isMeshBasicMaterial?e(t,n):n.isMeshLambertMaterial?(e(t,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,n)):n.isMeshToonMaterial?(e(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshPhongMaterial?(e(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshStandardMaterial?(e(t,n,r),n.isMeshPhysicalMaterial?function(t,e,n){i(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate());t.transparency.value=e.transparency}(t,n,r):i(t,n,r)):n.isMeshMatcapMaterial?(e(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDepthMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDistanceMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?(e(t,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize
vendor: 7,042 bytes, line 12
12+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,a,o):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function sr(t){var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,h=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",l=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,u=null,d=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,g,v,y,x,_,w,M,S,T,A,P,C,L,R,I,O,N,k,F=this,G=!1,z=null,U=0,B=0,H=null,j=null,V=-1,W={geometry:null,program:null,wireframe:!1},X=null,Y=null,q=new b,Z=new b,J=null,K=e.width,Q=e.height,tt=1,et=null,it=null,nt=new b(0,0,K,Q),rt=new b(0,0,K,Q),at=!1,ot=new ei,st=new di,ht=!1,ct=!1,lt=new D,ut=new E;function dt(){return null===H?tt:1}try{var pt={alpha:n,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:h,powerPreference:c,failIfMajorPerformanceCaveat:l};if(e.addEventListener("webglcontextlost",vt,!1),e.addEventListener("webglcontextrestored",yt,!1),null===(p=i||e.getContext("webgl",pt)||e.getContext("experimental-webgl",pt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ft(){g=new pi(p),!1===(v=new ui(p,g,t)).isWebGL2&&(g.get("WEBGL_depth_texture"),g.get("OES_texture_float"),g.get("OES_texture_half_float"),g.get("OES_texture_half_float_linear"),g.get("OES_standard_derivatives"),g.get("OES_element_index_uint"),g.get("ANGLE_instanced_arrays")),g.get("OES_texture_float_linear"),k=new er(p,g,v),(y=new $n(p,g,v)).scissor(Z.copy(rt).multiplyScalar(tt).floor()),y.viewport(q.copy(nt).multiplyScalar(tt).floor()),x=new gi(p),_=new zn,w=new tr(p,g,y,_,v,k,x),M=new ri(p,v),S=new fi(p,M,x),T=new xi(p,S,M,x),I=new yi(p),A=new Gn(F,g,v),P=new or(_),C=new jn,L=new Zn,R=new ci(F,y,T,s),O=new li(p,g,x,v),N=new mi(p,g,x,v),x.programs=A.programs,F.capabilities=v,F.extensions=g,F.properties=_,F.renderLists=C,F.state=y,F.info=x}ft();var mt=new ar(F,p);this.xr=mt;var gt=new Qn(F,T,v.maxTextureSize);function vt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),G=!0}function yt(){console.log("THREE.WebGLRenderer: Context Restored."),G=!1,ft()}function xt(t){var e=t.target;e.removeEventListener("dispose",xt),function(t){bt(t),_.remove(t)}(e)}function bt(t){var e=_.get(t).program;t.program=void 0,void 0!==e&&A.releaseProgram(e)}this.shadowMap=gt,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var t=g.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=g.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return tt},this.setPixelRatio=function(t){void 0!==t&&(tt=t,this.setSize(K,Q,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new m),t.set(K,Q)},this.setSize=function(t,i,n){mt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(K=t,Q=i,e.width=Math.floor(t*tt),e.height=Math.floor(i*tt),!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new m),t.set(K*tt,Q*tt).floor()},this.setDrawingBufferSize=function(t,i,n){K=t,Q=i,tt=n,e.width=Math.floor(t*n),e.height=Math.floor(i*n),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new b),t.copy(q)},this.getViewport=function(t){return t.copy(nt)},this.setViewport=function(t,e,i,n){t.isVector4?nt.set(t.x,t.y,t.z,t.w):nt.set(t,e,i,n),y.viewport(q.copy(nt).multiplyScalar(tt).floor())},this.getScissor=function(t){return t.copy(rt)},this.setScissor=function(t,e,i,n){t.isVector4?rt.set(t.x,t.y,t.z,t.w):rt.set(t,e,i,n),y.scissor(Z.copy(rt).multiplyScalar(tt).floor())},this.getScissorTest=function(){return at},this.setScissorTest=function(t){y.setScissorTest(at=t)},this.setOpaqueSort=function(t){et=t},this.setTransparentSort=function(t){it=t},this.getClearColor=function(){return R.getClearColor()},this.setClearColor=function(){R.setClearColor.apply(R,arguments)},this.getClearAlpha=function(){return R.getClearAlpha()},this.setClearAlpha=function(){R.setClearAlpha.apply(R,arguments)},this.clear=function(t,e,i){var n=0;(void 0===t||t)&&(n|=16384),(void 0===e||e)&&(n|=256),(void 0===i||i)&&(n|=1024),p.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",vt,!1),e.removeEventListener("webglcontextrestored",yt,!1),C.dispose(),L.dispose(),_.dispose(),T.dispose(),mt.dispose(),Mt.stop()},this.renderBufferImmediate=function(t,e){y.initAttributes();var i=_.get(t);t.hasPositions&&!i.position&&(i.position=p.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=p.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=p.createBuffer()),t.hasColors&&!i.color&&(i.color=p.createBuffer());var n=e.getAttributes();t.hasPositions&&(p.bindBuffer(34962,i.position),p.bufferData(34962,t.positionArray,35048),y.enableAttribute(n.position),p.vertexAttribPointer(n.position,3,5126,!1,0,0)),t.hasNormals&&
12(p.bindBuffer(34962,i.normal),p.bufferData(34962,t.normalArray,35048),y.enableAttribute(n.normal),p.vertexAttribPointer(n.normal,3,5126,!1,0,0)),t.hasUvs&&(p.bindBuffer(34962,i.uv),p.bufferData(34962,t.uvArray,35048),y.enableAttribute(n.uv),p.vertexAttribPointer(n.uv,2,5126,!1,0,0)),t.hasColors&&(p.bindBuffer(34962,i.color),p.bufferData(34962,t.colorArray,35048),y.enableAttribute(n.color),p.vertexAttribPointer(n.color,3,5126,!1,0,0)),y.disableUnusedAttributes(),p.drawArrays(4,0,t.count),t.count=0};var _t=new $;this.renderBufferDirect=function(t,e,i,n,r,a){null===e&&(e=_t);var o=r.isMesh&&r.matrixWorld.determinant()<0,s=Pt(t,e,n,r);y.setMaterial(n,o);var h=!1;W.geometry===i.id&&W.program===s.id&&W.wireframe===(!0===n.wireframe)||(W.geometry=i.id,W.program=s.id,W.wireframe=!0===n.wireframe,h=!0),(n.morphTargets||n.morphNormals)&&(I.update(r,i,n,s),h=!0),!0===r.isInstancedMesh&&(h=!0);var c=i.index,l=i.attributes.position;if(null===c){if(void 0===l||0===l.count)return}else if(0===c.count)return;var u,d=1;!0===n.wireframe&&(c=S.getWireframeAttribute(i),d=2);var f=O;null!==c&&(u=M.get(c),(f=N).setIndex(u)),h&&(!function(t,e,i,n){if(!1===v.isWebGL2&&(t.isInstancedMesh||e.isInstancedBufferGeometry)&&null===g.get("ANGLE_instanced_arrays"))return;y.initAttributes();var r=e.attributes,a=n.getAttributes(),o=i.defaultAttributeValues;for(var s in a){var h=a[s];if(h>=0){var c=r[s];if(void 0!==c){var l=c.normalized,u=c.itemSize;if(void 0===(w=M.get(c)))continue;var d=w.buffer,f=w.type,m=w.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,b=x.stride,_=c.offset;x&&x.isInstancedInterleavedBuffer?(y.enableAttributeAndDivisor(h,x.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=x.meshPerAttribute*x.count)):y.enableAttribute(h),p.bindBuffer(34962,d),y.vertexAttribPointer(h,u,f,l,b*m,_*m)}else c.isInstancedBufferAttribute?(y.enableAttributeAndDivisor(h,c.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=c.meshPerAttribute*c.count)):y.enableAttribute(h),p.bindBuffer(34962,d),y.vertexAttribPointer(h,u,f,l,0,0)}else if("instanceMatrix"===s){var w;if(void 0===(w=M.get(t.instanceMatrix)))continue;d=w.buffer,f=w.type;y.enableAttributeAndDivisor(h+0,1),y.enableAttributeAndDivisor(h+1,1),y.enableAttributeAndDivisor(h+2,1),y.enableAttributeAndDivisor(h+3,1),p.bindBuffer(34962,d),p.vertexAttribPointer(h+0,4,f,!1,64,0),p.vertexAttribPointer(h+1,4,f,!1,64,16),p.vertexAttribPointer(h+2,4,f,!1,64,32),p.vertexAttribPointer(h+3,4,f,!1,64,48)}else if(void 0!==o){var S=o[s];if(void 0!==S)switch(S.length){case 2:p.vertexAttrib2fv(h,S);break;case 3:p.vertexAttrib3fv(h,S);break;case 4:p.vertexAttrib4fv(h,S);break;default:p.vertexAttrib1fv(h,S)}}}}y.disableUnusedAttributes()}(r,i,n,s),null!==c&&p.bindBuffer(34963,u.buffer));var m=null!==c?c.count:l.count,x=i.drawRange.start*d,b=i.drawRange.count*d,_=null!==a?a.start*d:0,w=null!==a?a.count*d:1/0,T=Math.max(x,_),E=Math.min(m,x+b,_+w)-1,A=Math.max(0,E-T+1);if(0!==A){if(r.isMesh)!0===n.wireframe?(y.setLineWidth(n.wireframeLinewidth*dt()),f.setMode(1)):f.setMode(4);else if(r.isLine){var P=n.linewidth;void 0===P&&(P=1),y.setLineWidth(P*dt()),r.isLineSegments?f.setMode(1):r.isLineLoop?f.setMode(2):f.setMode(3)}else r.isPoints?f.setMode(0):r.isSprite&&f.setMode(4);if(r.isInstancedMesh)f.renderInstances(i,T,A,r.count);else if(i.isInstancedBufferGeometry){var C=Math.min(i.instanceCount,i._maxInstanceCount);f.renderInstances(i,T,A,C)}else f.render(T,A)}},this.compile=function(t,e){(d=L.get(t,e)).init(),t.traverse((function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(e);const i={};t.traverse((function(e){let n=e.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++){let a=n[r];a.uuid in i==!1&&(At(a,t,e),i[a.uuid]=!0)}else n.uuid in i==!1&&(At(n,t,e),i[n.uuid]=!0)}))};var wt=null;var Mt=new ni;function St(t,e,i,n){if(!1!==t.visible){if(t.layers.test(e.layers))if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||ot.intersectsSprite(t)){n&&ut.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt);var r=T.update(t);(a=t.material).visible&&u.push(t,r,a,i,ut.z,null)}}else if(t.isImmediateRenderObject)n&&ut.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt),u.push(t,null,t.material,i,ut.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==x.render.frame&&(t.skeleton.update(),t.skeleton.frame=x.render.frame),!t.frustumCulled||ot.intersectsObject(t))){n&&ut.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt);r=T.update(t);var a=t.material;if(Array.isArray(a))for(var o=r.groups,s=0,h=o.length;s<h;s++){var c=o[s],l=a[c.materialIndex];l&&l.visible&&u.push(t,r,l,i,ut.z,c)}else a.visible&&u.push(t,r,a,i,ut.z,null)}var p=t.children;for(s=0,h=p.length;s<h;s++)St(p[s],e,i,n)}}function Tt(t,e,i,n){for(var r=0,a=t.length;r<a;r++){var o=t[r],s=o.object,h=o.geometry,c=void 0===n?o.material:n,l=o.group;if(i.isArrayCamera){Y=i;for(var u=i.cameras,p=0,f=u.length;p<f;p++){var m=u[p];
vendor: 5,203 bytes, line 12
12s.layers.test(m.layers)&&(y.viewport(q.copy(m.viewport)),d.setupLights(m),Et(s,e,m,h,c,l))}}else Y=null,Et(s,e,i,h,c,l)}}function Et(t,e,i,n,r,a){if(t.onBeforeRender(F,e,i,n,r,a),d=L.get(e,Y||i),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=Pt(i,e,r,t);y.setMaterial(r),W.geometry=null,W.program=null,W.wireframe=!1,function(t,e){t.render((function(t){F.renderBufferImmediate(t,e)}))}(t,o)}else F.renderBufferDirect(i,e,n,r,t,a);t.onAfterRender(F,e,i,n,r,a),d=L.get(e,Y||i)}function At(t,e,i){var n=_.get(t),r=d.state.lights,a=d.state.shadowsArray,o=r.state.version,s=A.getParameters(t,r.state,a,e,st.numPlanes,st.numIntersection,i),h=A.getProgramCacheKey(s),c=n.program,l=!0;if(void 0===c)t.addEventListener("dispose",xt);else if(c.cacheKey!==h)bt(t);else if(n.lightsStateVersion!==o)n.lightsStateVersion=o,l=!1;else{if(void 0!==s.shaderID)return;l=!1}l&&(c=A.acquireProgram(s,h),n.program=c,n.uniforms=s.uniforms,n.outputEncoding=s.outputEncoding,t.program=c);var u=c.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var p=0;p<F.maxMorphTargets;p++)u["morphTarget"+p]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(p=0;p<F.maxMorphNormals;p++)u["morphNormal"+p]>=0&&t.numSupportedMorphNormals++}var f=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=st.numPlanes,n.numIntersection=st.numIntersection,f.clippingPlanes=st.uniform),n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=o,n.needsLights&&(f.ambientLightColor.value=r.state.ambient,f.lightProbe.value=r.state.probe,f.directionalLights.value=r.state.directional,f.directionalLightShadows.value=r.state.directionalShadow,f.spotLights.value=r.state.spot,f.spotLightShadows.value=r.state.spotShadow,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.pointLightShadows.value=r.state.pointShadow,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);var m=n.program.getUniforms(),g=yn.seqWithValue(m.seq,f);n.uniformsList=g}function Pt(t,e,i,n){w.resetTextureUnits();var r=e.fog,a=i.isMeshStandardMaterial?e.environment:null,o=null===H?F.outputEncoding:H.texture.encoding,s=_.get(i),h=d.state.lights;if(ht&&(ct||t!==X)){var c=t===X&&i.id===V;st.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,s,c)}i.version===s.__version?void 0===s.program||i.fog&&s.fog!==r||s.environment!==a||s.needsLights&&s.lightsStateVersion!==h.state.version?At(i,e,n):void 0===s.numClippingPlanes||s.numClippingPlanes===st.numPlanes&&s.numIntersection===st.numIntersection?s.outputEncoding!==o&&At(i,e,n):At(i,e,n):(At(i,e,n),s.__version=i.version);var l,u,m=!1,g=!1,x=!1,b=s.program,M=b.getUniforms(),S=s.uniforms;if(y.useProgram(b.program)&&(m=!0,g=!0,x=!0),i.id!==V&&(V=i.id,g=!0),m||X!==t){if(M.setValue(p,"projectionMatrix",t.projectionMatrix),v.logarithmicDepthBuffer&&M.setValue(p,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),X!==t&&(X=t,g=!0,x=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){var T=M.map.cameraPosition;void 0!==T&&T.setValue(p,ut.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&M.setValue(p,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&M.setValue(p,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){M.setOptional(p,n,"bindMatrix"),M.setOptional(p,n,"bindMatrixInverse");var E=n.skeleton;if(E){var A=E.bones;if(v.floatVertexTextures){if(void 0===E.boneTexture){var C=Math.sqrt(4*A.length);C=f.ceilPowerOfTwo(C),C=Math.max(C,4);var L=new Float32Array(C*C*4);L.set(E.boneMatrices);var R=new Qe(L,C,C,1023,1015);E.boneMatrices=L,E.boneTexture=R,E.boneTextureSize=C}M.setValue(p,"boneTexture",E.boneTexture,w),M.setValue(p,"boneTextureSize",E.boneTextureSize)}else M.setOptional(p,E,"boneMatrices")}}return(g||s.receiveShadow!==n.receiveShadow)&&(s.receiveShadow=n.receiveShadow,M.setValue(p,"receiveShadow",n.receiveShadow)),g&&(M.setValue(p,"toneMappingExposure",F.toneMappingExposure),M.setValue(p,"toneMappingWhitePoint",F.toneMappingWhitePoint),s.needsLights&&(u=x,(l=S).ambientLightColor.needsUpdate=u,l.lightProbe.needsUpdate=u,l.directionalLights.needsUpdate=u,l.directionalLightShadows.needsUpdate=u,l.pointLights.needsUpdate=u,l.pointLightShadows.needsUpdate=u,l.spotLights.needsUpdate=u,l.spotLightShadows.needsUpdate=u,l.re
12ctAreaLights.needsUpdate=u,l.hemisphereLights.needsUpdate=u),r&&i.fog&&P.refreshFogUniforms(S,r),P.refreshMaterialUniforms(S,i,a,tt,Q),void 0!==S.ltc_1&&(S.ltc_1.value=ii.LTC_1),void 0!==S.ltc_2&&(S.ltc_2.value=ii.LTC_2),yn.upload(p,s.uniformsList,S,w)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(yn.upload(p,s.uniformsList,S,w),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&M.setValue(p,"center",n.center),M.setValue(p,"modelViewMatrix",n.modelViewMatrix),M.setValue(p,"normalMatrix",n.normalMatrix),M.setValue(p,"modelMatrix",n.matrixWorld),b}Mt.setAnimationLoop((function(t){mt.isPresenting||wt&&wt(t)})),"undefined"!=typeof window&&Mt.setContext(window),this.setAnimationLoop=function(t){wt=t,mt.setAnimationLoop(t),Mt.start()},this.render=function(t,e){var i,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),e&&e.isCamera){if(!G){W.geometry=null,W.program=null,W.wireframe=!1,V=-1,X=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),mt.enabled&&mt.isPresenting&&(e=mt.getCamera(e)),t.onBeforeRender(F,t,e,i||H),(d=L.get(t,e)).init(),lt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),ot.setFromProjectionMatrix(lt),ct=this.localClippingEnabled,ht=st.init(this.clippingPlanes,ct,e),(u=C.get(t,e)).init(),St(t,e,0,F.sortObjects),u.finish(),!0===F.sortObjects&&u.sort(et,it),ht&&st.beginShadows();var r=d.state.shadowsArray;gt.render(r,t,e),d.setupLights(e),ht&&st.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),R.render(u,t,e,n);var a=u.opaque,o=u.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&Tt(a,t,e,s),o.length&&Tt(o,t,e,s)}else a.length&&Tt(a,t,e),o.length&&Tt(o,t,e);t.onAfterRender(F,t,e),null!==H&&(w.updateRenderTargetMipmap(H),w.updateMultisampleRenderTarget(H)),y.buffers.depth.setTest(!0),y.buffers.depth.setMask(!0),y.buffers.color.setMask(!0),y.setPolygonOffset(!1),u=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){z!==t&&null===H&&p.bindFramebuffer(36160,t),z=t},this.getActiveCubeFace=function(){return U},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return H},this.setRenderTarget=function(t,e,i){H=t,U=e,B=i,t&&void 0===_.get(t).__webglFramebuffer&&w.setupRenderTarget(t);var n=z,r=!1;if(t){var a=_.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=a[e||0],r=!0):n=t.isWebGLMultisampleRenderTarget?_.get(t).__webglMultisampledFramebuffer:a,q.copy(t.viewport),Z.copy(t.scissor),J=t.scissorTest}else q.copy(nt).multiplyScalar(tt).floor(),Z.copy(rt).multiplyScalar(tt).floor(),J=at;if(j!==n&&(p.bindFramebuffer(36160,n),j=n),y.viewport(q),y.scissor(Z),y.setScissorTest(J),r){var o=_.get(t.texture);p.framebufferTexture2D(36160,36064,34069+(e||0),o.__webglTexture,i||0)}},this.readRenderTargetPixels=function(t,e,i,n,r,a,o){if(t&&t.isWebGLRenderTarget){var s=_.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var h=!1;s!==j&&(p.bindFramebuffer(36160,s),h=!0);try{var c=t.texture,l=c.format,u=c.type;if(1023!==l&&k.convert(l)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===u||k.convert(u)===p.getParameter(35738)||1015===u&&(v.isWebGL2||g.get("OES_texture_float")||g.get("WEBGL_color_buffer_float"))||1016===u&&(v.isWebGL2?g.get("EXT_color_buffer_float"):g.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&p.readPixels(e,i,n,r,k.convert(l),k.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{h&&p.bindFramebuffer(36160,j)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}
12,this.copyFramebufferToTexture=function(t,e,i){void 0===i&&(i=0);var n=Math.pow(2,-i),r=Math.floor(e.image.width*n),a=Math.floor(e.image.height*n),o=k.convert(e.format);w.setTexture2D(e,0),p.copyTexImage2D(3553,i,o,t.x,t.y,r,a,0),y.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n){void 0===n&&(n=0);var r=e.image.width,a=e.image.height,o=k.convert(i.format),s=k.convert(i.type);w.setTexture2D(i,0),e.isDataTexture?p.texSubImage2D(3553,n,t.x,t.y,r,a,o,s,e.image.data):e.isCompressedTexture?p.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):p.texSubImage2D(3553,n,t.x,t.y,o,s,e.image),0===n&&i.generateMipmaps&&p.generateMipmap(3553),y.unbindTexture()},this.initTexture=function(t){w.setTexture2D(t,0),y.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function hr(t,e){this.name="",this.color=new jt(t),this.density=void 0!==e?e:25e-5}function cr(t,e,i){this.name="",this.color=new jt(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function lr(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}ir.prototype=Object.assign(Object.create(Ze.prototype),{constructor:ir,isArrayCamera:!0}),nr.prototype=Object.assign(Object.create(Q.prototype),{constructor:nr,isGroup:!0}),Object.assign(rr.prototype,{constructor:rr,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new nr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new nr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,i){var n=null,r=null,a=this._targetRay,o=this._grip;return t&&(null!==a&&null!==(n=e.getPose(t.targetRaySpace,i))&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)),null!==o&&t.gripSpace&&null!==(r=e.getPose(t.gripSpace,i))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==a&&(a.visible=null!==n),null!==o&&(o.visible=null!==r),this}}),Object.assign(ar.prototype,l.prototype),Object.assign(hr.prototype,{isFogExp2:!0,clone:function(){return new hr(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(cr.prototype,{isFog:!0,clone:function(){return new cr(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(lr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(lr.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(var n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var ur,dr=new E;function pr(t,e,i,n){this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function fr(t){Zt.call(this),this.type="SpriteMaterial",this.color=new jt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.defineProperties(pr.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(pr.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,i=this.data.count;e<i;
vendor: 14,436 bytes, line 12
12e++)dr.x=this.getX(e),dr.y=this.getY(e),dr.z=this.getZ(e),dr.applyMatrix4(t),this.setXYZ(e,dr.x,dr.y,dr.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this},clone:function(){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],e=0;e<this.count;e++)for(var i=e*this.data.stride+this.offset,n=0;n<this.itemSize;n++)t.push(this.data.array[i+n]);return new Qt(new this.array.constructor(t),this.itemSize,this.normalized)},toJSON:function(){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],e=0;e<this.count;e++)for(var i=e*this.data.stride+this.offset,n=0;n<this.itemSize;n++)t.push(this.data.array[i+n]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}),fr.prototype=Object.create(Zt.prototype),fr.prototype.constructor=fr,fr.prototype.isSpriteMaterial=!0,fr.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var mr=new E,gr=new E,vr=new E,yr=new m,xr=new m,br=new D,_r=new E,wr=new E,Mr=new E,Sr=new m,Tr=new m,Er=new m;function Ar(t){if(Q.call(this),this.type="Sprite",void 0===ur){ur=new ve;var e=new lr(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);ur.setIndex([0,1,2,0,2,3]),ur.setAttribute("position",new pr(e,3,0,!1)),ur.setAttribute("uv",new pr(e,2,3,!1))}this.geometry=ur,this.material=void 0!==t?t:new fr,this.center=new m(.5,.5)}function Pr(t,e,i,n,r,a){yr.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(xr.x=a*yr.x-r*yr.y,xr.y=r*yr.x+a*yr.y):xr.copy(yr),t.copy(e),t.x+=xr.x,t.y+=xr.y,t.applyMatrix4(br)}Ar.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ar,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),gr.setFromMatrixScale(this.matrixWorld),br.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),vr.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&gr.multiplyScalar(-vr.z);var i,n,r=this.material.rotation;0!==r&&(n=Math.cos(r),i=Math.sin(r));var a=this.center;Pr(_r.set(-.5,-.5,0),vr,a,gr,i,n),Pr(wr.set(.5,-.5,0),vr,a,gr,i,n),Pr(Mr.set(.5,.5,0),vr,a,gr,i,n),Sr.set(0,0),Tr.set(1,0),Er.set(1,1);var o=t.ray.intersectTriangle(_r,wr,Mr,!1,mr);if(null!==o||(Pr(wr.set(-.5,.5,0),vr,a,gr,i,n),Tr.set(0,1),null!==(o=t.ray.intersectTriangle(_r,Mr,wr,!1,mr)))){var s=t.ray.origin.distanceTo(mr);s<t.near||s>t.far||e.push({distance:s,point:mr.clone(),uv:zt.getUV(mr,_r,wr,Mr,Sr,Tr,Er,new m),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Q.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Cr,Lr,Rr,Ir,Or,Dr=new E,Nr=new E;function kr(){Q.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Fr(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Ne.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new D,this.bindMatrixInverse=new D}kr.prototype=Object.assign(Object.create(Q.prototype),{constructor:kr,isLOD:!0,copy:function(t){Q.prototype.copy.call(this,t,!1);for(var e=t.levels,i=0,n=e.length;i<n;i++){var r=e[i];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=this.levels,n=0;n<i.length&&!(e<i[n].distance);n++);return i.splice(n,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){var e=this.levels;if(e.length>0){for(var i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object}return null},raycast:function(t,e){if(this.levels.length>0){Dr.setFromMatrixPosition(this.matrixWorld);var i=t.ray.origin.distanceTo(Dr);this.getObjectForDistance(i).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){Dr.setFromMatrixPosition(t.matrixWorld),Nr.setFromMatrixPosition(this.matrixWorld);var i=Dr.distanceTo(Nr)/t.zoom;e[0].object.visible=!0;for(var n=1,r=e.length;n<r&&i>=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}},toJSON:function(t){var e=Q.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var i=this.levels,n=0,r=i.length;n<r;n++){var a=i[n];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Fr.prototype=Object.assign(Object.create(Ne.prototype),{constructor:Fr,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new b,e=this.geometry.attributes.skinWeight,i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);var r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Ne.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)},boneTransform:(Cr=new E,Lr=new b,Rr=new b,Ir=new E,Or=new D,function(t,e){var i=this.skeleton,n=this.geometry;Lr.fromBufferAttribute(n.attributes.skinIndex,t),Rr.fromBufferAttribute(n.attributes.skinWeight,t),Cr.fromBufferAttribute(n.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(var r=0;r<4;r++){var a=Rr.getComponent(r);if(0!==a){var o=Lr.getComponent(r);Or.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),e.addScaledVector(Ir.copy(Cr).applyMatrix4(Or),a)}}return e.applyMatrix4(this.bindMatrixInverse)})});var Gr=new D,zr=new D;function Ur(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var i=0,n=this.bones.length;i<n;i++)this.boneInverses.push(new D)}}function Br(){Q.call(this),this.type="Bone"}Object.assign(Ur.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var i=new D;this.bones[t]&&i.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(i)}},pose:function(){var t,e,i;for(e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture,r=0,a=t.length;r<a;r++){var o=t[r]?t[r].matrixWorld:zr;Gr.multiplyMatrices(o,e[r]),Gr.toArray(i,16*r)}void 0!==n&&(n.needsUpdate=!0)},clone:function(){return new Ur(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,i=this.bones.length;e<i;e++){var n=this.bones[e];if(n.name===t)return n}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Br.prototype=Object.assign(Object.create(Q.prototype),{constructor:Br,isBone:!0});var Hr=new D,jr=new D,Vr=[],Wr=new Ne;function Xr(t,e,i){Ne.call(this,t,e),this.instanceMatrix=new Qt(new Float32Array(16*i),16),this.count=i,this.frustumCulled=!1}function Yr(t){Zt.call(this),this.type="LineBasicMaterial",this.color=new jt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}Xr.prototype=Object.assign(Object.create(Ne.prototype),{constructor:Xr,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var i=this.matrixWorld,n=this.count;if(Wr.geometry=this.geometry,Wr.material=this.material,void 0!==Wr.material)for(var r=0;r<n;r++){this.getMatrixAt(r,Hr),jr.multiplyMatrices(i,Hr),Wr.matrixWorld=jr,Wr.raycast(t,Vr);for(var a=0,o=Vr.length;a<o;a++){var s=Vr[a];s.instanceId=r,s.object=this,e.push(s)}Vr.length=0}},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),Yr.prototype=Object.create(Zt.prototype),Yr.prototype.constructor=Yr,Yr.prototype.isLineBasicMaterial=!0,Yr.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};var qr=new E,Zr=new E,Jr=new D,Kr=new St,Qr=new gt;function $r(t,e,i){1===i&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Q.call(this),this.type="Line",this.geometry=void 0!==t?t:new ve,this.material=void 0!==e?e:new Yr,this.updateMorphTargets()}$r.prototype=Object.assign(Object.create(Q.prototype),{constructor:$r,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,i=[0],n=1,r=e.count;n<r;n++)qr.fromBufferAttribute(e,n-1),Zr.fromBufferAttribute(e,n),i[n]=i[n-1],i[n]+=qr.distanceTo(Zr);t.setAttribute("lineDistance",new oe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;(i=t.lineDistances)[0]=0;for(n=1,r=a.length;n<r;n++)i[n]=i[n-1],i[n]+=a[n-1].distanceTo(a[n])}return this},raycast:function(t,e){var i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),Qr.copy(i.boundingSphere),Qr.applyMatrix4(n),Qr.radius+=r,!1!==t.ray.intersectsSphere(Qr)){Jr.getInverse(n),Kr.copy(t.ray).applyMatrix4(Jr);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new E,h=new E,c=new E,l=new E,u=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var d=i.index,p=i.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length-1;m<g;m+=u){var v=f[m],y=f[m+1];if(s.fromArray(p,3*v),h.fromArray(p,3*y),!(Kr.distanceSqToSegment(s,h,l,c)>o))l.applyMatrix4(this.matrixWorld),(_=t.ray.origin.distanceTo(l))<t.near||_>t.far||e.push({distance:_,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,g=p.length/3-1;m<g;m+=u){if(s.fromArray(p,3*m),h.fromArray(p,3*m+3),!(Kr.distanceSqToSegment(s,h,l,c)>o))l.applyMatrix4(this.matrixWorld),(_=t.ray.origin.distanceTo(l))<t.near||_>t.far||e.push({distance:_,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(i.isGeometry){var x=i.vertices,b=x.length;for(m=0;m<b-1;m+=u){var _;if(!(Kr.distanceSqToSegment(x[m],x[m+1],l,c)>o))l.applyMatrix4(this.matrixWorld),(_=t.ray.origin.distanceTo(l))<t.near||_>t.far||e.push({distance:_,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var t,e,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)i=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}else{var s=n.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ta=new E,ea=new E;function ia(t,e){$r.call(this,t,e),this.type="LineSegments"}function na(t,e){$r.call(this,t,e),this.type="LineLoop"}function ra(t){Zt.call(this),this.type="PointsMaterial",this.color=new jt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}ia.prototype=Object.assign(Object.create($r.prototype),{constructor:ia,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,i=[],n=0,r=e.count;n<r;n+=2)ta.fromBufferAttribute(e,n),ea.fromBufferAttribute(e,n+1),i[n]=0===n?0:i[n-1],i[n+1]=i[n]+ta.distanceTo(ea);t.setAttribute("lineDistance",new oe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var a=t.vertices;for(i=t.lineDistances,n=0,r=a.length;n<r;n+=2)ta.copy(a[n]),ea.copy(a[n+1]),i[n]=0===n?0:i[n-1],i[n+1]=i[n]+ta.distanceTo(ea)}return this}}),na.prototype=Object.assign(Object.create($r.prototype),{constructor:na,isLine
12Loop:!0}),ra.prototype=Object.create(Zt.prototype),ra.prototype.constructor=ra,ra.prototype.isPointsMaterial=!0,ra.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var aa=new D,oa=new St,sa=new gt,ha=new E;function ca(t,e){Q.call(this),this.type="Points",this.geometry=void 0!==t?t:new ve,this.material=void 0!==e?e:new ra,this.updateMorphTargets()}function la(t,e,i,n,r,a,o){var s=oa.distanceSqToPoint(t);if(s<i){var h=new E;oa.closestPointToPoint(t,h),h.applyMatrix4(n);var c=r.ray.origin.distanceTo(h);if(c<r.near||c>r.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:h,index:e,face:null,object:o})}}function ua(t,e,i,n,r,a,o,s,h){x.call(this,t,e,i,n,r,a,o,s,h),this.format=void 0!==o?o:1022,this.minFilter=void 0!==a?a:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1}function da(t,e,i,n,r,a,o,s,h,c,l,u){x.call(this,null,a,o,s,h,c,n,r,l,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function pa(t,e,i,n,r,a,o,s,h){x.call(this,t,e,i,n,r,a,o,s,h),this.needsUpdate=!0}function fa(t,e,i,n,r,a,o,s,h,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===c&&(i=1012),void 0===i&&1027===c&&(i=1020),x.call(this,null,n,r,a,o,s,c,i,h),this.image={width:t,height:e},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function ma(t){ve.call(this),this.type="WireframeGeometry";var e,i,n,r,a,o,s,h,c,l,u=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,n=m.length;e<n;e++){var g=m[e];for(i=0;i<3;i++)s=g[f[i]],h=g[f[(i+1)%3]],d[0]=Math.min(s,h),d[1]=Math.max(s,h),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]})}for(c in p)o=p[c],l=t.vertices[o.index1],u.push(l.x,l.y,l.z),l=t.vertices[o.index2],u.push(l.x,l.y,l.z)}else if(t&&t.isBufferGeometry){var v,y,x,b,_,w,M;if(l=new E,null!==t.index){for(v=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),r=0,a=x.length;r<a;++r)for(e=_=(b=x[r]).start,n=_+b.count;e<n;e+=3)for(i=0;i<3;i++)s=y.getX(e+i),h=y.getX(e+(i+1)%3),d[0]=Math.min(s,h),d[1]=Math.max(s,h),void 0===p[c=d[0]+","+d[1]]&&(p[c]={index1:d[0],index2:d[1]});for(c in p)o=p[c],l.fromBufferAttribute(v,o.index1),u.push(l.x,l.y,l.z),l.fromBufferAttribute(v,o.index2),u.push(l.x,l.y,l.z)}else for(e=0,n=(v=t.attributes.position).count/3;e<n;e++)for(i=0;i<3;i++)w=3*e+i,l.fromBufferAttribute(v,w),u.push(l.x,l.y,l.z),M=3*e+(i+1)%3,l.fromBufferAttribute(v,M),u.push(l.x,l.y,l.z)}this.setAttribute("position",new oe(u,3))}function ga(t,e,i){He.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i},this.fromBufferGeometry(new va(t,e,i)),this.mergeVertices()}function va(t,e,i){ve.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:i};var n,r,a=[],o=[],s=[],h=[],c=1e-5,l=new E,u=new E,d=new E,p=new E,f=new E;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=e+1;for(n=0;n<=i;n++){var g=n/i;for(r=0;r<=e;r++){var v=r/e;t(v,g,u),o.push(u.x,u.y,u.z),v-c>=0?(t(v-c,g,d),p.subVectors(u,d)):(t(v+c,g,d),p.subVectors(d,u)),g-c>=0?(t(v,g-c,d),f.subVectors(u,d)):(t(v,g+c,d),f.subVectors(d,u)),l.crossVectors(p,f).normalize(),s.push(l.x,l.y,l.z),h.push(v,g)}}for(n=0;n<i;n++)for(r=0;r<e;r++){var y=n*m+r,x=n*m+r+1,b=(n+1)*m+r+1,_=(n+1)*m+r;a.push(y,x,_),a.push(x,b,_)}this.setIndex(a),this.setAttribute("position",new oe(o,3)),this.setAttribute("normal",new oe(s,3)),this.setAttribute("uv",new oe(h,2))}function ya(t,e,i,n){He.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},this.fromBufferGeometry(new xa(t,e,i,n)),this.mergeVertices()}function xa(t,e,i,n){ve.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radiu
vendor: 3,575 bytes, line 12
12s:i,detail:n},i=i||1;var r=[],a=[];function o(t,e,i,n){var r,a,o=Math.pow(2,n),h=[];for(r=0;r<=o;r++){h[r]=[];var c=t.clone().lerp(i,r/o),l=e.clone().lerp(i,r/o),u=o-r;for(a=0;a<=u;a++)h[r][a]=0===a&&r===o?c:c.clone().lerp(l,a/u)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var d=Math.floor(a/2);a%2==0?(s(h[r][d+1]),s(h[r+1][d]),s(h[r][d])):(s(h[r][d+1]),s(h[r+1][d+1]),s(h[r+1][d]))}}function s(t){r.push(t.x,t.y,t.z)}function h(e,i){var n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function c(t,e,i,n){n<0&&1===t.x&&(a[e]=t.x-1),0===i.x&&0===i.z&&(a[e]=n/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}function u(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var i=new E,n=new E,r=new E,a=0;a<e.length;a+=3)h(e[a+0],i),h(e[a+1],n),h(e[a+2],r),o(i,n,r,t)}(n=n||0),function(t){for(var e=new E,i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){for(var t=new E,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var i=l(t)/2/Math.PI+.5,n=u(t)/Math.PI+.5;a.push(i,1-n)}(function(){for(var t=new E,e=new E,i=new E,n=new E,o=new m,s=new m,h=new m,u=0,d=0;u<r.length;u+=9,d+=6){t.set(r[u+0],r[u+1],r[u+2]),e.set(r[u+3],r[u+4],r[u+5]),i.set(r[u+6],r[u+7],r[u+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),h.set(a[d+4],a[d+5]),n.copy(t).add(e).add(i).divideScalar(3);var p=l(n);c(o,d+0,t,p),c(s,d+2,e,p),c(h,d+4,i,p)}})(),function(){for(var t=0;t<a.length;t+=6){var e=a[t+0],i=a[t+2],n=a[t+4],r=Math.max(e,i,n),o=Math.min(e,i,n);r>.9&&o<.1&&(e<.2&&(a[t+0]+=1),i<.2&&(a[t+2]+=1),n<.2&&(a[t+4]+=1))}}()}(),this.setAttribute("position",new oe(r,3)),this.setAttribute("normal",new oe(r.slice(),3)),this.setAttribute("uv",new oe(a,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function ba(t,e){He.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new _a(t,e)),this.mergeVertices()}function _a(t,e){xa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function wa(t,e){He.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ma(t,e)),this.mergeVertices()}function Ma(t,e){xa.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Sa(t,e){He.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ta(t,e)),this.mergeVertices()}function Ta(t,e){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];xa.call(this,n,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ea(t,e){He.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Aa(t,e)),this.mergeVertices()}function Aa(t,e){var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n];xa.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 8,762 bytes, line 12
1219,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Pa(t,e,i,n,r,a){He.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Ca(t,e,i,n,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Ca(t,e,i,n,r){ve.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},e=e||64,i=i||1,n=n||8,r=r||!1;var a=t.computeFrenetFrames(e,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,h=new E,c=new E,l=new m,u=new E,d=[],p=[],f=[],g=[];function v(r){u=t.getPointAt(r/e,u);var o=a.normals[r],l=a.binormals[r];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);c.x=g*o.x+m*l.x,c.y=g*o.y+m*l.y,c.z=g*o.z+m*l.z,c.normalize(),p.push(c.x,c.y,c.z),h.x=u.x+i*c.x,h.y=u.y+i*c.y,h.z=u.z+i*c.z,d.push(h.x,h.y,h.z)}}!function(){for(o=0;o<e;o++)v(o);v(!1===r?e:0),function(){for(o=0;o<=e;o++)for(s=0;s<=n;s++)l.x=o/e,l.y=s/n,f.push(l.x,l.y)}(),function(){for(s=1;s<=e;s++)for(o=1;o<=n;o++){var t=(n+1)*(s-1)+(o-1),i=(n+1)*s+(o-1),r=(n+1)*s+o,a=(n+1)*(s-1)+o;g.push(t,i,a),g.push(i,r,a)}}()}(),this.setIndex(g),this.setAttribute("position",new oe(d,3)),this.setAttribute("normal",new oe(p,3)),this.setAttribute("uv",new oe(f,2))}function La(t,e,i,n,r,a,o){He.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ra(t,e,i,n,r,a)),this.mergeVertices()}function Ra(t,e,i,n,r,a){ve.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:a},t=t||1,e=e||.4,i=Math.floor(i)||64,n=Math.floor(n)||8,r=r||2,a=a||3;var o,s,h=[],c=[],l=[],u=[],d=new E,p=new E,f=new E,m=new E,g=new E,v=new E,y=new E;for(o=0;o<=i;++o){var x=o/i*r*Math.PI*2;for(P(x,r,a,t,f),P(x+.01,r,a,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=n;++s){var b=s/n*Math.PI*2,_=-e*Math.cos(b),w=e*Math.sin(b);d.x=f.x+(_*y.x+w*g.x),d.y=f.y+(_*y.y+w*g.y),d.z=f.z+(_*y.z+w*g.z),c.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),l.push(p.x,p.y,p.z),u.push(o/i),u.push(s/n)}}for(s=1;s<=i;s++)for(o=1;o<=n;o++){var M=(n+1)*(s-1)+(o-1),S=(n+1)*s+(o-1),T=(n+1)*s+o,A=(n+1)*(s-1)+o;h.push(M,S,A),h.push(S,T,A)}function P(t,e,i,n,r){var a=Math.cos(t),o=Math.sin(t),s=i/e*t,h=Math.cos(s);r.x=n*(2+h)*.5*a,r.y=n*(2+h)*o*.5,r.z=n*Math.sin(s)*.5}this.setIndex(h),this.setAttribute("position",new oe(c,3)),this.setAttribute("normal",new oe(l,3)),this.setAttribute("uv",new oe(u,2))}function Ia(t,e,i,n,r){He.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new Oa(t,e,i,n,r)),this.mergeVertices()}function Oa(t,e,i,n,r){ve.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||1,e=e||.4,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var a,o,s=[],h=[],c=[],l=[],u=new E,d=new E,p=new E;for(a=0;a<=i;a++)for(o=0;o<=n;o++){var f=o/n*r,m=a/i*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),h.push(d.x,d.y,d.z),u.x=t*Math.cos(f),u.y=t*Math.sin(f),p.subVectors(d,u).normalize(),c.push(p.x,p.y,p.z),l.push(o/n),l.push(a/i)}for(a=1;a<=i;a++)for(o=1;o<=n;o++){var g=(n+1)*a+o-1,v=(n+1)*(a-1)+o-1,y=(n+1)*(a-1)+o,x=(n+1)*a+o;s.push(g,v,x),s.push(v,y,x)}this.setIndex(s),this.setAttribute("position",new oe(h,3)),this.setAttribute("normal",new oe(c,3)),this.setAttribute("uv",new oe(l,2))}ca.prototype=Object.assign(Object.create(Q.prototype),{constructor:ca,isPoints:!0,raycast:function(t,e){var i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),sa.copy(i.boundingSphere),sa.applyMatrix4(n),sa.radius+=r,!1!==t.ray.intersectsSphere(sa)){aa.getInverse(n),oa.copy(t.ray).applyMatrix4(aa);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(i.isBufferGeometry){var s=i.index,h=i.attributes.position.array;if(null!==s)for(var c=s.array,l=0,u=c.length;l<u;l++){var d=c[l];ha.fromArray(h,3*d),la(ha,d,o,n,t,e,this)}else{l=0;for(var p=h.length/3;l<p;l++)ha.fromArray(h,3*l),la(ha,l,o,n,t,e,this)}}else{var f=i.vertices;for(l=0,p=f.length;l<p;l++)la(f[l],l,o,n,t,e,this)}}},updateMorphTargets:function(){var t,e,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)i=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}else{var s=n.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ua.prototype=Object.assign(Object.create(x.prototype),{constructor:ua,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),da.prototype=Object.create(x.prototype),da.prototype.constructor=da,da.prototype.isCompressedTexture=!0,pa.prototype=Object.create(x.prototype),pa.prototype.constructor=pa,pa.prototype.isCanvasTexture=!0,fa.prototype=Object.create(x.prototype),fa.prototype.constructor=fa,fa.prototype.isDepthTexture=!0,ma.prototype=Object.create(ve.prototype),ma.prototype.constructor=ma,ga.prototype=Object.create(He.prototype),ga.prototype.constructor=ga,va.prototype=Object.create(ve.prototype),va.prototype.constructor=va,ya.prototype=Object.create(He.prototype),ya.prototype.constructor=ya,xa.prototype=Object.create(ve.prototype),xa.prototype.constructor=xa,ba.prototype=Object.create(He.prototype),ba.prototype.constructor=ba,_a.prototype=Object.create(xa.prototype),_a.prototype.constructor=_a,wa.prototype=Object.create(He.prototype),wa.prototype.constructor=wa,Ma.prototype=Object.create(xa.prototype),Ma.prototype.constructor=Ma,Sa.prototype=Object.create(He.prototype),Sa.prototype.constructor=Sa,Ta.prototype=Object.create(xa.prototype),Ta.prototype.constructor=Ta,Ea.prototype=Object.create(He.prototype),Ea.prototype.constructor=Ea,Aa.prototype=Object.create(xa.prototype),Aa.prototype.constructor=Aa,Pa.prototype=Object.create(He.prototype),Pa.prototype.constructor=Pa,Ca.prototype=Object.create(ve.prototype),Ca.prototype.constructor=Ca,Ca.prototype.toJSON=function(){var t=ve.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},La.prototype=Object.create(He.prototype),La.prototype.constructor=La,Ra.prototype=Object.create(ve.prototype),Ra.prototype.constructor=Ra,Ia.prototype=Object.create(He.prototype),Ia.prototype.constructor=Ia,Oa.prototype=Object.create(ve.prototype),Oa.prototype.constructor=Oa;var Da=function(t,e,i){i=i||2;var n,r,a,o,s,h,c,l=e&&e.length,u=l?e[0]*i:t.length,d=Na(t,0,u,i,!0),p=[];if(!d||d.next===d.prev)return p;if(l&&(d=function(t,e,i,n){var r,a,o,s,h,c=[];for(r=0,a=e.length;r<a;r++)o=e[r]*n,s=r<a-1?e[r+1]*n:t.length,(h=Na(t,o,s,n,!1))===h.next&&(h.steiner=!0),c.push(Xa(h));for(c.sort(Ha),r=0;r<c.length;r++)ja(c[r],i),i=ka(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=a=t[0],r=o=t[1];for(var f=i;f<u;f+=i)(s=t[f])<n&&(n=s),(h=t[f+1])<r&&(r=h),s>a&&(a=s),h>o&&(o=h);c=0!==(c=Math.max(a-n,o-r))?1/c:0}return Fa(d,p,i,n,r,c),p};function Na(t,e,i,n,r){var a,o;if(r===function(t,e,i,n){for(var r=0,a=e,o=i-n;a<i;a+=n)r+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return r}(t,e,i,n)>0)for(a=e;a<i;a+=n)o=io(a,t[a],t[a+1],o);else for(a=i-n;a>=e;a-=n)o=io(a,t[a],t[a+1],o);return o&&Ja(o,o.next)&&(no(o),o=o.next),o}function ka(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Ja(n,n.next)&&0!==Za(n.prev,n,n.next))n=n.next;else{if(no(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function Fa(t,e,i,n,r,a,o){if(t){!o&&a&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=Wa(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,a,o,s,h,c=1;do{for(i=t,t=null,a=null,o=0;i;){for(o++,n=i,s=0,e=0;e<c&&(s++,n=n.nextZ);e++);for(h=c;s>0||h>0&&n;)0!==s&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,h--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;i=n}a.nextZ=null,c*=2}while(o>1)}(r)}(t,n,r,a);for(var s,h,c=t;t.prev!==t.next;
12)if(s=t.prev,h=t.next,a?za(t,n,r,a):Ga(t))e.push(s.i/i),e.push(t.i/i),e.push(h.i/i),no(t),t=h.next,c=h.next;else if((t=h)===c){o?1===o?Fa(t=Ua(ka(t),e,i),e,i,n,r,a,2):2===o&&Ba(t,e,i,n,r,a):Fa(ka(t),e,i,n,r,a,1);break}}}function Ga(t){var e=t.prev,i=t,n=t.next;if(Za(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Ya(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Za(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function za(t,e,i,n){var r=t.prev,a=t,o=t.next;if(Za(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,h=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,c=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,l=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,u=Wa(s,h,e,i,n),d=Wa(c,l,e,i,n),p=t.prevZ,f=t.nextZ;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&Ya(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Za(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Ya(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Za(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&Ya(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Za(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Ya(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Za(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ua(t,e,i){var n=t;do{var r=n.prev,a=n.next.next;!Ja(r,a)&&Ka(r,n,n.next,a)&&to(r,a)&&to(a,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(a.i/i),no(n),no(n.next),n=t=a),n=n.next}while(n!==t);return ka(n)}function Ba(t,e,i,n,r,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&qa(o,s)){var h=eo(o,s);return o=ka(o,o.next),h=ka(h,h.next),Fa(o,e,i,n,r,a),void Fa(h,e,i,n,r,a)}s=s.next}o=o.next}while(o!==t)}function Ha(t,e){return t.x-e.x}function ja(t,e){if(e=function(t,e){var i,n=e,r=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if(o=s,s===r){if(a===n.y)return n;if(a===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===o)return i;var h,c=i,l=i.x,u=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=l&&r!==n.x&&Ya(a<u?r:o,a,l,u,a<u?o:r,a,n.x,n.y)&&(h=Math.abs(a-n.y)/(r-n.x),to(n,t)&&(h<d||h===d&&(n.x>i.x||n.x===i.x&&Va(i,n)))&&(i=n,d=h)),n=n.next}while(n!==c);return i}(t,e)){var i=eo(e,t);ka(e,e.next),ka(i,i.next)}}function Va(t,e){return Za(t.prev,t,e.prev)<0&&Za(e.next,t,t.next)<0}function Wa(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Xa(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 Ya(t,e,i,n,r,a,o,s){return(r-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(i-o)*(e-s)>=0&&(i-o)*(a-s)-(r-o)*(n-s)>=0}function qa(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&&Ka(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(to(t,e)&&to(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(Za(t.prev,t,e.prev)||Za(t,e.prev,e))||Ja(t,e)&&Za(t.prev,t,t.next)>0&&Za(e.prev,e,e.next)>0)}function Za(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ja(t,e){return t.x===e.x&&t.y===e.y}function Ka(t,e,i,n){var r=$a(Za(t,e,i)),a=$a(Za(t,e,n)),o=$a(Za(i,n,t)),s=$a(Za(i,n,e));return r!==a&&o!==s||(!(0!==r||!Qa(t,i,e))||(!(0!==a||!Qa(t,n,e))||(!(0!==o||!Qa(i,t,n))||!(0!==s||!Qa(i,e,n)))))}function Qa(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 $a(t){return t>0?1:t<0?-1:0}function to(t,e){return Za(t.prev,t,t.next)<0?Za(t,e,t.next)>=0&&Za(t,t.prev,e)>=0:Za(t,e,t.prev)<0||Za(t,t.next,e)<0}function eo(t,e){var i=new ro(t.i,t.x,t.y),n=new ro(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function io(t,e,i,n){var r=new ro(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function no(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 ro(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}var ao={area:function(t){for(var e=t.length,i=0,n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},isClockWise:function(t){return ao.area(t)<0},triangulateShape:function(t,e){var i=[],n=[],r=[];oo(t),so(i,t);var a=t.length;e.forEach(oo);for(var o=0;o<e.length;o++)n.push(a),a+=e[o].length,so(i,e[o]);var s=Da(i,n);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function oo(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function so(t,e){for(var i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}function ho(t,e){He.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new co(t,e)),this.mergeVertices()}function co(t,e){ve.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var i=this,n=[],r=[],a=0,o=t.length;a<o;a++){s(t[a])}function s(t){var a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,h=void 0!==e.depth?e.depth:100,c=void 0===e.bevelEnabled||e.bevelEnabled,l=void 0!==e.bevelThickness?e.bevelThickness:6,u=void 0!==e.bevelSize?e.bevelSize:l-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,g=void 0!==e.UVGenerator?e.UVGenerator:lo;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=e.amount);var v,y,x,b,_,w,M,S,T=!1;f&&(v=f.getSpacedPoints(s),T=!0,c=!1,y=f.computeFrenetFrames(s,!1),x=new E,b=new E,_=new E),c||
vendor: 4,092 bytes, line 12
12(p=0,l=0,u=0,d=0);var A=t.extractPoints(o),P=A.shape,C=A.holes;if(!ao.isClockWise(P))for(P=P.reverse(),M=0,S=C.length;M<S;M++)w=C[M],ao.isClockWise(w)&&(C[M]=w.reverse());var L=ao.triangulateShape(P,C),R=P;for(M=0,S=C.length;M<S;M++)w=C[M],P=P.concat(w);function I(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}var O,D,N,k,F,G,z=P.length,U=L.length;function B(t,e,i){var n,r,a,o=t.x-e.x,s=t.y-e.y,h=i.x-t.x,c=i.y-t.y,l=o*o+s*s,u=o*c-s*h;if(Math.abs(u)>Number.EPSILON){var d=Math.sqrt(l),p=Math.sqrt(h*h+c*c),f=e.x-s/d,g=e.y+o/d,v=((i.x-c/p-f)*c-(i.y+h/p-g)*h)/(o*c-s*h),y=(n=f+o*v-t.x)*n+(r=g+s*v-t.y)*r;if(y<=2)return new m(n,r);a=Math.sqrt(y/2)}else{var x=!1;o>Number.EPSILON?h>Number.EPSILON&&(x=!0):o<-Number.EPSILON?h<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(c)&&(x=!0),x?(n=-s,r=o,a=Math.sqrt(l)):(n=o,r=s,a=Math.sqrt(l/2))}return new m(n/a,r/a)}for(var H=[],j=0,V=R.length,W=V-1,X=j+1;j<V;j++,W++,X++)W===V&&(W=0),X===V&&(X=0),H[j]=B(R[j],R[W],R[X]);var Y,q,Z=[],J=H.concat();for(M=0,S=C.length;M<S;M++){for(w=C[M],Y=[],j=0,W=(V=w.length)-1,X=j+1;j<V;j++,W++,X++)W===V&&(W=0),X===V&&(X=0),Y[j]=B(w[j],w[W],w[X]);Z.push(Y),J=J.concat(Y)}for(O=0;O<p;O++){for(N=O/p,k=l*Math.cos(N*Math.PI/2),D=u*Math.sin(N*Math.PI/2)+d,j=0,V=R.length;j<V;j++)Q((F=I(R[j],H[j],D)).x,F.y,-k);for(M=0,S=C.length;M<S;M++)for(w=C[M],Y=Z[M],j=0,V=w.length;j<V;j++)Q((F=I(w[j],Y[j],D)).x,F.y,-k)}for(D=u+d,j=0;j<z;j++)F=c?I(P[j],J[j],D):P[j],T?(b.copy(y.normals[0]).multiplyScalar(F.x),x.copy(y.binormals[0]).multiplyScalar(F.y),_.copy(v[0]).add(b).add(x),Q(_.x,_.y,_.z)):Q(F.x,F.y,0);for(q=1;q<=s;q++)for(j=0;j<z;j++)F=c?I(P[j],J[j],D):P[j],T?(b.copy(y.normals[q]).multiplyScalar(F.x),x.copy(y.binormals[q]).multiplyScalar(F.y),_.copy(v[q]).add(b).add(x),Q(_.x,_.y,_.z)):Q(F.x,F.y,h/s*q);for(O=p-1;O>=0;O--){for(N=O/p,k=l*Math.cos(N*Math.PI/2),D=u*Math.sin(N*Math.PI/2)+d,j=0,V=R.length;j<V;j++)Q((F=I(R[j],H[j],D)).x,F.y,h+k);for(M=0,S=C.length;M<S;M++)for(w=C[M],Y=Z[M],j=0,V=w.length;j<V;j++)F=I(w[j],Y[j],D),T?Q(F.x,F.y+v[s-1].y,v[s-1].x+k):Q(F.x,F.y,h+k)}function K(t,e){var i,n;for(j=t.length;--j>=0;){i=j,(n=j-1)<0&&(n=t.length-1);var r=0,a=s+2*p;for(r=0;r<a;r++){var o=z*r,h=z*(r+1);tt(e+i+o,e+n+o,e+n+h,e+i+h)}}}function Q(t,e,i){a.push(t),a.push(e),a.push(i)}function $(t,e,r){et(t),et(e),et(r);var a=n.length/3,o=g.generateTopUV(i,n,a-3,a-2,a-1);it(o[0]),it(o[1]),it(o[2])}function tt(t,e,r,a){et(t),et(e),et(a),et(e),et(r),et(a);var o=n.length/3,s=g.generateSideWallUV(i,n,o-6,o-3,o-2,o-1);it(s[0]),it(s[1]),it(s[3]),it(s[1]),it(s[2]),it(s[3])}function et(t){n.push(a[3*t+0]),n.push(a[3*t+1]),n.push(a[3*t+2])}function it(t){r.push(t.x),r.push(t.y)}!function(){var t=n.length/3;if(c){var e=0,r=z*e;for(j=0;j<U;j++)$((G=L[j])[2]+r,G[1]+r,G[0]+r);for(r=z*(e=s+2*p),j=0;j<U;j++)$((G=L[j])[0]+r,G[1]+r,G[2]+r)}else{for(j=0;j<U;j++)$((G=L[j])[2],G[1],G[0]);for(j=0;j<U;j++)$((G=L[j])[0]+z*s,G[1]+z*s,G[2]+z*s)}i.addGroup(t,n.length/3-t,0)}(),function(){var t=n.length/3,e=0;for(K(R,e),e+=R.length,M=0,S=C.length;M<S;M++)K(w=C[M],e),e+=w.length;i.addGroup(t,n.length/3-t,1)}()}this.setAttribute("position",new oe(n,3)),this.setAttribute("uv",new oe(r,2)),this.computeVertexNormals()}ho.prototype=Object.create(He.prototype),ho.prototype.constructor=ho,ho.prototype.toJSON=function(){var t=He.prototype.toJSON.call(this);return uo(this.parameters.shapes,this.parameters.options,t)},co.prototype=Object.create(ve.prototype),co.prototype.constructor=co,co.prototype.toJSON=function(){var t=ve.prototype.toJSON.call(this);return uo(this.parameters.shapes,this.parameters.options,t)};var lo={generateTopUV:function(t,e,i,n,r){var a=e[3*i],o=e[3*i+1],s=e[3*n],h=e[3*n+1],c=e[3*r],l=e[3*r+1];return[new m(a,o),new m(s,h),new m(c,l)]},generateSideWallUV:function(t,e,i,n,r,a){var o=e[3*i],s=e[3*i+1],h=e[3*i+2],c=e[3*n],l=e[3*n+1],u=e[3*n+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],g=e[3*a],v=e[3*a+1],y=e[3*a+2];return Math.abs(s-l)<.01?[new m(o,1-h),new m(c,1-u),new m(d,1-f),new m(g,1-y)]:[new m(s,1-h),new m(l,1-u),new m(p,1-f),new m(v,1-y)]}};
vendor: 6,151 bytes, line 12
12function uo(t,e,i){if(i.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var a=t[n];i.shapes.push(a.uuid)}else i.shapes.push(t.uuid);return void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}function po(t,e){He.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new fo(t,e)),this.mergeVertices()}function fo(t,e){var i=(e=e||{}).font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new He;var n=i.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),co.call(this,n,e),this.type="TextBufferGeometry"}function mo(t,e,i,n,r,a,o){He.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new go(t,e,i,n,r,a,o)),this.mergeVertices()}function go(t,e,i,n,r,a,o){ve.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,h,c=Math.min(a+o,Math.PI),l=0,u=[],d=new E,p=new E,f=[],m=[],g=[],v=[];for(h=0;h<=i;h++){var y=[],x=h/i,b=0;for(0==h&&0==a?b=.5/e:h==i&&c==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var _=s/e;d.x=-t*Math.cos(n+_*r)*Math.sin(a+x*o),d.y=t*Math.cos(a+x*o),d.z=t*Math.sin(n+_*r)*Math.sin(a+x*o),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(_+b,1-x),y.push(l++)}u.push(y)}for(h=0;h<i;h++)for(s=0;s<e;s++){var w=u[h][s+1],M=u[h][s],S=u[h+1][s],T=u[h+1][s+1];(0!==h||a>0)&&f.push(w,M,T),(h!==i-1||c<Math.PI)&&f.push(M,S,T)}this.setIndex(f),this.setAttribute("position",new oe(m,3)),this.setAttribute("normal",new oe(g,3)),this.setAttribute("uv",new oe(v,2))}function vo(t,e,i,n,r,a){He.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new yo(t,e,i,n,r,a)),this.mergeVertices()}function yo(t,e,i,n,r,a){ve.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},t=t||.5,e=e||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,i=void 0!==i?Math.max(3,i):8;var o,s,h,c=[],l=[],u=[],d=[],p=t,f=(e-t)/(n=void 0!==n?Math.max(1,n):1),g=new E,v=new m;for(s=0;s<=n;s++){for(h=0;h<=i;h++)o=r+h/i*a,g.x=p*Math.cos(o),g.y=p*Math.sin(o),l.push(g.x,g.y,g.z),u.push(0,0,1),v.x=(g.x/e+1)/2,v.y=(g.y/e+1)/2,d.push(v.x,v.y);p+=f}for(s=0;s<n;s++){var y=s*(i+1);for(h=0;h<i;h++){var x=o=h+y,b=o+i+1,_=o+i+2,w=o+1;c.push(x,b,w),c.push(b,_,w)}}this.setIndex(c),this.setAttribute("position",new oe(l,3)),this.setAttribute("normal",new oe(u,3)),this.setAttribute("uv",new oe(d,2))}function xo(t,e,i,n){He.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},this.fromBufferGeometry(new bo(t,e,i,n)),this.mergeVertices()}function bo(t,e,i,n){ve.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e)||12,i=i||0,n=n||2*Math.PI,n=f.clamp(n,0,2*Math.PI);var r,a,o,s=[],h=[],c=[],l=1/e,u=new E,d=new m;for(a=0;a<=e;a++){var p=i+a*l*n,g=Math.sin(p),v=Math.cos(p);for(o=0;o<=t.length-1;o++)u.x=t[o].x*g,u.y=t[o].y,u.z=t[o].x*v,h.push(u.x,u.y,u.z),d.x=a/e,d.y=o/(t.length-1),c.push(d.x,d.y)}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){var y=r=o+a*t.length,x=r+t.length,b=r+t.length+1,_=r+1;s.push(y,x,_),s.push(x,b,_)}if(this.setIndex(s),this.setAttribute("position",new oe(h,3)),this.setAttribute("uv",new oe(c,2)),this.computeVertexNormals(),n===2*Math.PI){var w=this.attributes.normal.array,M=new E,S=new E,T=new E;for(r=e*t.length*3,a=0,o=0;a<t.length;a++,o+=3)M.x=w[o+0],M.y=w[o+1],M.z=w[o+2],S.x=w[r+o+0],S.y=w[r+o+1],S.z=w[r+o+2],T.addVectors(M,S).normalize(),w[o+0]=w[r+o+0]=T.x,w[o+1]=w[r+o+1]=T.y,w[o+2]=w[r+o+2]=T.z}}function _o(t,e){He.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new wo(t,e)),this.mergeVertices()}function wo(t,e){ve.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var i=[],n=[],r=[],a=[],o=0,s=0;if(!1===Array.isArray(t))c(t);else for(var h=0;h<t.length;h++)c(t[h]),this.addGroup(o,s,h),o+=s,s=0;function c(t){var o,h,c,l=n.length/3,u=t.extractPoints(e),d=u.shape,p=u.holes;for(!1===ao.isClockWise(d)&&(d=d.reverse()),o=0,h=p.length;o<h;o++)c=p[o],!0===ao.isClockWise(c)&&(p[o]=c.reverse());var f=ao.triangulateShape(d,p);for(o=0,h=p.length;o<h;o++)c=p[o],d=d.concat(c);for(o=0,h=d.length;o<h;o++){var m=d[o];n.push(m.x,m.y,0),r.push(0,0,1),a.push(m.x,m.y)}for(o=0,h=f.length;o<h;o++){var g=f[o],v=g[0]+l,y=g[1]+l,x=g[2]+l;i.push(v,y,x),s+=3}}this.setIndex(i),this.setAttribute("position",new oe(n,3)),this.setAttribute("normal",new oe(r,3)),this.setAttribute("uv",new oe(a,2))}function Mo(t,e){if(e.shapes=[],Array.isArray(t))for(var i=0,n=t.length;i<n;i++){var r=t[i];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function So(t,e){ve.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var i,n,r,a,o=[],s=Math.cos(f.DEG2RAD*e),h=[0,0],c={},l=["a","b","c"];t.isBufferGeometry?(a=new He).fromBufferGeometry(t):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var u=a.vertices,d=a.faces,p=0,m=d.length;p<m;p++)for(var g=d[p],v=0;v<3;v++)i=g[l[v]],n=g[l[(v+1)%3]],h[0]=Math.min(i,n),h[1]=Math.max(i,n),void 0===c[r=h[0]+","+h[1]]?c[r]={index1:h[0],index2:h[1],face1:p,face2:void 0}:c[r].face2=p;for(r in c){var y=c[r];if(void 0===y.face2||d[y.face1].normal.dot(d[y.face2].normal)<=s){var x=u[y.index1];o.push(x.x,x.y,x.z),x=u[y.index2],o.push(x.x,x.y,x.z)}}this.setAttribute("position",new oe(o,3))}
vendor: 1,749 bytes, line 12
12function To(t,e,i,n,r,a,o,s){He.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Eo(t,e,i,n,r,a,o,s)),this.mergeVertices()}function Eo(t,e,i,n,r,a,o,s){ve.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};var h=this;t=void 0!==t?t:1,e=void 0!==e?e:1,i=i||1,n=Math.floor(n)||8,r=Math.floor(r)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var c=[],l=[],u=[],d=[],p=0,f=[],g=i/2,v=0;function y(i){var r,a,f,y=new m,x=new E,b=0,_=!0===i?t:e,w=!0===i?1:-1;for(a=p,r=1;r<=n;r++)l.push(0,g*w,0),u.push(0,w,0),d.push(.5,.5),p++;for(f=p,r=0;r<=n;r++){var M=r/n*s+o,S=Math.cos(M),T=Math.sin(M);x.x=_*T,x.y=g*w,x.z=_*S,l.push(x.x,x.y,x.z),u.push(0,w,0),y.x=.5*S+.5,y.y=.5*T*w+.5,d.push(y.x,y.y),p++}for(r=0;r<n;r++){var A=a+r,P=f+r;!0===i?c.push(P,P+1,A):c.push(P+1,P,A),b+=3}h.addGroup(v,b,!0===i?1:2),v+=b}!function(){var a,m,y=new E,x=new E,b=0,_=(e-t)/i;for(m=0;m<=r;m++){var w=[],M=m/r,S=M*(e-t)+t;for(a=0;a<=n;a++){var T=a/n,A=T*s+o,P=Math.sin(A),C=Math.cos(A);x.x=S*P,x.y=-M*i+g,x.z=S*C,l.push(x.x,x.y,x.z),y.set(P,_,C).normalize(),u.push(y.x,y.y,y.z),d.push(T,1-M),w.push(p++)}f.push(w)}for(a=0;a<n;a++)for(m=0;m<r;m++){var L=f[m][a],R=f[m+1][a],I=f[m+1][a+1],O=f[m][a+1];c.push(L,R,O),c.push(R,I,O),b+=6}h.addGroup(v,b,0),v+=b}(),!1===a&&(t>0&&y(!0),e>0&&y(!1)),this.setIndex(c),this.setAttribute("position",new oe(l,3)),this.setAttribute("normal",new oe(u,3)),this.setAttribute("uv",new oe(d,2))}function Ao(t,e,i,n,r,a,o){To.call(this,0,t,e,i,n,r,a,o),this.type="C
12oneGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function Po(t,e,i,n,r,a,o){Eo.call(this,0,t,e,i,n,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function Co(t,e,i,n){He.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new Lo(t,e,i,n)),this.mergeVertices()}function Lo(t,e,i,n){ve.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r,a,o=[],s=[],h=[],c=[],l=new E,u=new m;for(s.push(0,0,0),h.push(0,0,1),c.push(.5,.5),a=0,r=3;a<=e;a++,r+=3){var d=i+a/e*n;l.x=t*Math.cos(d),l.y=t*Math.sin(d),s.push(l.x,l.y,l.z),h.push(0,0,1),u.x=(s[r]/t+1)/2,u.y=(s[r+1]/t+1)/2,c.push(u.x,u.y)}for(r=1;r<=e;r++)o.push(r,r+1,0);this.setIndex(o),this.setAttribute("position",new oe(s,3)),this.setAttribute("normal",new oe(h,3)),this.setAttribute("uv",new oe(c,2))}po.prototype=Object.create(He.prototype),po.prototype.constructor=po,fo.prototype=Object.create(co.prototype),fo.prototype.constructor=fo,mo.prototype=Object.create(He.prototype),mo.prototype.constructor=mo,go.prototype=Object.create(ve.prototype),go.prototype.constructor=go,vo.prototype=Object.create(He.prototype),vo.prototype.constructor=vo,yo.prototype=Object.create(ve.prototype),yo.prototype.constructor=yo,xo.prototype=Object.create(He.prototype),xo.prototype.constructor=xo,bo.prototype=Object.create(ve.prototype),bo.prototype.constructor=bo,_o.prototype=Object.create(He.prototype),_o.prototype.constructor=_o,_o.prototype.toJSON=function(){var t=He.prototype.toJSON.call(this);return Mo(this.parameters.shapes,t)},wo.prototype=Object.create(ve.prototype),wo.prototype.constructor=wo,wo.prototype.toJSON=function(){var t=ve.prototype.toJSON.call(this);return Mo(this.parameters.shapes,t)},So.prototype=Object.create(ve.prototype),So.prototype.constructor=So,To.prototype=Object.create(He.prototype),To.prototype.constructor=To,Eo.prototype=Object.create(ve.prototype),Eo.prototype.constructor=Eo,Ao.prototype=Object.create(To.prototype),Ao.prototype.constructor=Ao,Po.prototype=Object.create(Eo.prototype),Po.prototype.constructor=Po,Co.prototype=Object.create(He.prototype),Co.prototype.constructor=Co,Lo.prototype=Object.create(ve.prototype),Lo.prototype.constructor=Lo;var Ro=Object.freeze({__proto__:null,WireframeGeometry:ma,ParametricGeometry:ga,ParametricBufferGeometry:va,TetrahedronGeometry:ba,TetrahedronBufferGeometry:_a,OctahedronGeometry:wa,OctahedronBufferGeometry:Ma,IcosahedronGeometry:Sa,IcosahedronBufferGeometry:Ta,DodecahedronGeometry:Ea,DodecahedronBufferGeometry:Aa,PolyhedronGeometry:ya,PolyhedronBufferGeometry:xa,TubeGeometry:Pa,TubeBufferGeometry:Ca,TorusKnotGeometry:La,TorusKnotBufferGeometry:Ra,TorusGeometry:Ia,TorusBufferGeometry:Oa,TextGeometry:po,TextBufferGeometry:fo,SphereGeometry:mo,SphereBufferGeometry:go,RingGeometry:vo,RingBufferGeometry:yo,PlaneGeometry:ai,PlaneBufferGeometry:oi,LatheGeometry:xo,LatheBufferGeometry:bo,ShapeGeometry:_o,ShapeBufferGeometry:wo,ExtrudeGeometry:ho,ExtrudeBufferGeometry:co,EdgesGeometry:So,ConeGeometry:Ao,ConeBufferGeometry:Po,CylinderGeometry:To,CylinderBufferGeometry:Eo,CircleGeometry:Co,CircleBufferGeometry:Lo,BoxGeometry:class extends He{constructor(t,e,i,n,r,a){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new je(t,e,i,n,r,a)),this.mergeVertices()}},BoxBufferGeometry:je});function Io(t){Zt.call(this),this.type="ShadowMaterial",this.color=new jt(0),this.transparent=!0,this.setValues(t)}function Oo(t){Ye.call(this,t),this.type="RawShaderMaterial"}function Do(t){Zt.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new jt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function No(t){Do.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new m(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function ko(t){Zt.call(this),this.type="MeshPhongMaterial",this.color=new jt(16777215),this.specular=new jt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Fo(t){Zt.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new jt(16777215),this.specular=new jt(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Go(t){Zt.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function zo(t){Zt.call(this),this.type="MeshLambertMaterial",this.color=new jt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Uo(t){Zt.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new jt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Bo(t){Yr.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Io.prototype=Object.create(Zt.prototype),Io.prototype.constructor=Io,Io.prototype.isShadowMaterial=!0,Io.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this},Oo.prototype=Object.create(Ye.prototype),Oo.prototype.constructor=Oo,Oo.prototype.isRawShaderMaterial=!0,Do.prototype=Object.create(Zt.prototype),Do.prototype.constructor=Do,Do.prototype.isMeshStandardMaterial=!0,Do.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},No.prototype=Object.create(Do.prototype),No.prototype.constructor=No,No.prototype.isMeshPhysicalMaterial=!0,No.prototype.copy=function(t){return Do.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new jt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},ko.prototype=Object.create(Zt.prototype),ko.prototype.constructor=ko,ko.prototype.isMeshPhongMaterial=!0,ko.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Fo.prototype=Object.create(Zt.prototype),Fo.prototype.constructor=Fo,Fo.prototype.isMeshToonMaterial=!0,Fo.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Go.prototype=Object.create(Zt.prototype),Go.prototype.constructor=Go,Go.prototype.isMeshNormalMaterial=!0,Go.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},zo.prototype=Object.create(Zt.prototype),zo.prototype.constructor=zo,zo.prototype.isMeshLambertMaterial=!0,zo.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Uo.prototype=Object.create(Zt.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isMeshMat
12capMaterial=!0,Uo.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Bo.prototype=Object.create(Yr.prototype),Bo.prototype.constructor=Bo,Bo.prototype.isLineDashedMaterial=!0,Bo.prototype.copy=function(t){return Yr.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Ho=Object.freeze({__proto__:null,ShadowMaterial:Io,SpriteMaterial:fr,RawShaderMaterial:Oo,ShaderMaterial:Ye,PointsMaterial:ra,MeshPhysicalMaterial:No,MeshStandardMaterial:Do,MeshPhongMaterial:ko,MeshToonMaterial:Fo,MeshNormalMaterial:Go,MeshLambertMaterial:zo,MeshDepthMaterial:Jn,MeshDistanceMaterial:Kn,MeshBasicMaterial:Jt,MeshMatcapMaterial:Uo,LineDashedMaterial:Bo,LineBasicMaterial:Yr,Material:Zt}),jo={arraySlice:function(t,e,i){return jo.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,i=new Array(e),n=0;n!==e;++n)i[n]=n;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){for(var n=t.length,r=new t.constructor(n),a=0,o=0;o!==n;++a)for(var s=i[a]*e,h=0;h!==e;++h)r[o++]=t[s+h];return r},flattenJSON:function(t,e,i,n){for(var r=1,a=t[0];void 0!==a&&void 0===a[n];)a=t[r++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[n])&&(e.push(a.time),i.push.apply(i,o)),a=t[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[n])&&(e.push(a.time),o.toArray(i,i.length)),a=t[r++]}while(void 0!==a);else do{void 0!==(o=a[n])&&(e.push(a.time),i.push(o)),a=t[r++]}while(void 0!==a)}},subclip:function(t,e,i,n,r){r=r||30;var a=t.clone();a.name=e;for(var o=[],s=0;s<a.tracks.length;++s){for(var h=a.tracks[s],c=h.getValueSize(),l=[],u=[],d=0;d<h.times.length;++d){var p=h.times[d]*r;if(!(p<i||p>=n)){l.push(h.times[d]);for(var f=0;f<c;++f)u.push(h.values[d*c+f])}}0!==l.length&&(h.times=jo.convertArray(l,h.times.constructor),h.values=jo.convertArray(u,h.values.constructor),o.push(h))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a},makeClipAdditive:function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=t),(void 0===n||n<=0)&&(n=30);for(var r=t.tracks.length,a=e/n,o=0;o<r;++o){var s=i.tracks[o],h=s.ValueTypeName;if("bool"!==h&&"string"!==h){var c=t.tracks.find((function(t){return t.name===s.name&&t.ValueTypeName===h}));if(void 0!==c){var l,u=s.getValueSize(),d=s.times.length-1;if(a<=s.times[0])l=jo.arraySlice(s.values,0,s.valueSize);else if(a>=s.times[d]){var p=d*u;l=jo.arraySlice(s.values,p)}else{var f=s.createInterpolant();f.evaluate(a),l=f.resultBuffer}if("quaternion"===h)new M(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l);for(var m=c.times.length,g=0;g<m;++g){var v=g*u;if("quaternion"===h)M.multiplyQuaternionsFlat(c.values,v,l,0,c.values,v);else for(var y=0;y<u;++y)c.values[v+y]-=l[y]}}}}return t.blendMode=2501,t}};function Vo(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function Wo(t,e,i,n){Vo.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Xo(t,e,i,n){Vo.call(this,t,e,i,n)}function Yo(t,e,i,n){Vo.call(this,t,e,i,n)}function qo(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=jo.convertArray(e,this.TimeBufferType),this.values=jo.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}function Zo(t,e,i){qo.call(this,t,e,i)}
vendor: 13,139 bytes, line 12
12function Jo(t,e,i,n){qo.call(this,t,e,i,n)}function Ko(t,e,i,n){qo.call(this,t,e,i,n)}function Qo(t,e,i,n){Vo.call(this,t,e,i,n)}function $o(t,e,i,n){qo.call(this,t,e,i,n)}function ts(t,e,i,n){qo.call(this,t,e,i,n)}function es(t,e,i,n){qo.call(this,t,e,i,n)}function is(t,e,i,n){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==n?n:2500,this.uuid=f.generateUUID(),this.duration<0&&this.resetDuration()}function ns(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ko;case"vector":case"vector2":case"vector3":case"vector4":return es;case"color":return Jo;case"quaternion":return $o;case"bool":case"boolean":return Zo;case"string":return ts}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var i=[],n=[];jo.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Vo.prototype,{evaluate:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{var a;i:{n:if(!(t<n)){for(var o=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===o)break;if(r=n,t<(n=e[++i]))break e}a=e.length;break i}if(t>=r)break t;var s=e[1];t<s&&(i=2,r=s);for(o=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===o)break;if(n=r,t>=(r=e[--i-1]))break e}a=i,i=0}for(;i<a;){var h=i+a>>>1;t<e[h]?a=h:i=h+1}if(n=e[i],void 0===(r=e[i-1]))return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n,a=0;a!==n;++a)e[a]=i[r+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Vo.prototype,{beforeStart_:Vo.prototype.copySampleValue_,afterEnd_:Vo.prototype.copySampleValue_}),Wo.prototype=Object.assign(Object.create(Vo.prototype),{constructor:Wo,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,i){var n=this.parameterPositions,r=t-2,a=t+1,o=n[r],s=n[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=t,o=2*e-i;break;case 2402:o=e+n[r=n.length-2]-n[r+1];break;default:r=t,o=i}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=t,s=2*i-e;break;case 2402:a=1,s=i+n[1]-n[0];break;default:a=t-1,s=e}var h=.5*(i-e),c=this.valueSize;this._weightPrev=h/(e-o),this._weightNext=h/(s-i),this._offsetPrev=r*c,this._offsetNext=a*c},interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,h=s-o,c=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f,b=0;b!==o;++b)r[b]=g*a[c+b]+v*a[h+b]+y*a[s+b]+x*a[l+b];return r}}),Xo.prototype=Object.assign(Object.create(Vo.prototype),{constructor:Xo,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,h=s-o,c=(i-e)/(n-e),l=1-c,u=0;u!==o;++u)r[u]=a[h+u]*l+a[s+u]*c;return r}}),Yo.prototype=Object.assign(Object.create(Vo.prototype),{constructor:Yo,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(qo,{toJSON:function(t){var e,i=t.constructor;if(void 0!==i.toJSON)e=i.toJSON(t);else{e={name:t.name,times:jo.convertArray(t.times,Array),values:jo.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e}}),Object.assign(qo.prototype,{constructor:qo,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Yo(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Xo(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Wo(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this},trim:function(t,e){for(var i=this.times,n=i.length,r=0,a=n-1;r!==n&&i[r]<t;)++r;for(;-1!==a&&i[a]>e;)--a;if(++a,0!==r||a!==n){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=jo.arraySlice(i,r,a),this.values=jo.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==r;o++){var s=i[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==n&&jo.isTypedArray(n)){o=0;for(var h=n.length;o!==h;++o){var c=n[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}}return t},optimize:function(){for(var t=jo.arraySlice(this.times),e=jo.arraySlice(this.values),i=this.getValueSize(),n=2302===this.getInterpolation(),r=1,a=t.length-1,o=1;o<a;++o){var s=!1,h=t[o];if(h!==t[o+1]&&(1!==o||h!==h[0]))if(n)s=!0;else for(var c=o*i,l=c-i,u=c+i,d=0;d!==i;++d){var p=e[c+d];if(p!==e[l+d]||p!==e[u+d]){s=!0;break}}if(s){if(o!==r){t[r]=t[o];var f=o*i,m=r*i;for(d=0;d!==i;++d)e[m+d]=e[f+d]}++r}}if(a>0){t[r]=t[a];for(f=a*i,m=r*i,d=0;d!==i;++d)e[m+d]=e[f+d];++r}return r!==t.length?(this.times=jo.arraySlice(t,0,r),this.values=jo.arraySlice(e,0,r*i)):(this.times=t,this.values=e),this},clone:function(){var t=jo.arraySlice(this.times,0),e=jo.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}),Zo.prototype=Object.assign(Object.create(qo.prototype),{constructor:Zo,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Jo.prototype=Object.assign(Object.create(qo.prototype),{constructor:Jo,ValueTypeName:"color"}),Ko.prototype=Object.assign(Object.create(qo.prototype),{constructor:Ko,ValueTypeName:"number"}),Qo.prototype=Object.assign(Object.create(Vo.prototype),{constructor:Qo,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,h=(i-e)/(n-e),c=s+o;s!==c;s+=4)M.slerpFlat(r,0,a,s-o,a,s,h);return r}}),$o.prototype=Object.assign(Object.create(qo.prototype),{constructor:$o,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new Qo(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),ts.prototype=Object.assign(Object.create(qo.prototype),{constructor:ts,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),es.prototype=Object.assign(Object.create(qo.prototype),{constructor:es,ValueTypeName:"vector"}),Object.assign(is,{parse:function(t){for(var e=[],i=t.tracks,n=1/(t.fps||1),r=0,a=i.length;r!==a;++r)e.push(ns(i[r]).scale(n));return new is(t.name,t.duration,e,t.blendMode)},toJSON:function(t){for(var e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},r=0,a=i.length;r!==a;++r)e.push(qo.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){for(var r=e.length,a=[],o=0;o<r;o++){var s=[],h=[];s.push((o+r-1)%r,o,(o+1)%r),h.push(0,1,0);var c=jo.getKeyframeOrder(s);s=jo.sortedArray(s,1,c),h=jo.sortedArray(h,1,c),n||0!==s[0]||(s.push(r),h.push(h[0])),a.push(new Ko(".morphTargetInfluences["+e[o].name+"]",s,h).scale(1/i))}return new is(t,-1,a)},findByName:function(t,e){var i=t;if(!Array.isArray(t)){var n=t;i=n.geometry&&n.geometry.animations||n.animations}for(var r=0;r<i.length;r++)if(i[r].name===e)return i[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){for(var n={},r=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],h=s.name.match(r);if(h&&h.length>1){var c=n[u=h[1]];c||(n[u]=c=[]),c.push(s)}}var l=[];for(var u in n)l.push(is.CreateFromMorphTargetSequence(u,n[u],e,i));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var i=function(t,e,i,n,r){if(0!==i.length){var a=[],o=[];jo.flattenJSON(i,a,o,n),0!==a.length&&r.push(new t(e,a,o))}},n=[],r=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.blendMode,h=t.hierarchy||[],c=0;c<h.length;c++){var l=h[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},d=0;d<l.length;d++)if(l[d].morphTargets)for(var p=0;p<l[d].morphTargets.length;p++)u[l[d].morphTargets[p]]=-1;for(var f in u){var m=[],g=[];for(p=0;p!==l[d].morphTargets.length;++p){var v=l[d];m.push(v.time),g.push(v.morphTarget===f?1:0)}n.push(new Ko(".morphTargetInfluence["+f+"]",m,g))}a=u.length*(o||1)}else{var y=".bones["+e[c].name+"]";i(es,y+".position",l,"pos",n),i($o,y+".quaternion",l,"rot",n),i(es,y+".scale",l,"scl",n)}}return 0===n.length?null:new is(r,a,n,s)}}),Object.assign(is.prototype,{resetDuration:function(){for(var t=0,e=0,i=this.tracks.length;e!==i;++e){var n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new is(this.name,this.duration,t,this.blendMode)}});var rs={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function as(t,e,i){var n=this,r=!1,a=0,o=0,s=void 0,h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===r&&void 0!==n.onStart&&n.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){var e=h.indexOf(t);return-1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(var e=0,i=h.length;e<i;e+=2){var n=h[e],r=h[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}var os=new as;function ss(t){this.manager=void 0!==t?t:os,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(ss.prototype,{load:function(){},loadAsync:function(t,e){var i=this;return new Promise((function(n,r){i.load(t,n,e,r)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var hs={};function cs(t){ss.call(this,t)}function ls(t){ss.call(this,t)}function us(t){ss.call(this,t)}function ds(t){ss.call(this,t)}function ps(t){ss.call(this,t)}function fs(t){ss.call(this,t)}function ms(t){ss.call(this,t)}function gs(){this.type="Curve",this.arcLengthDivisions=200}function vs(t,e,i,n,r,a,o,s){gs.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}
vendor: 4,313 bytes, line 12
12function ys(t,e,i,n,r,a){vs.call(this,t,e,i,i,n,r,a),this.type="ArcCurve"}function xs(){var t=0,e=0,i=0,n=0;function r(r,a,o,s){t=r,e=o,i=-3*r+3*a-2*o-s,n=2*r-2*a+o+s}return{initCatmullRom:function(t,e,i,n,a){r(e,i,a*(i-t),a*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,a,o,s){var h=(e-t)/a-(i-t)/(a+o)+(i-e)/o,c=(i-e)/o-(n-e)/(o+s)+(n-i)/s;r(e,i,h*=o,c*=o)},calc:function(r){var a=r*r;return t+e*r+i*a+n*(a*r)}}}cs.prototype=Object.assign(Object.create(ss.prototype),{constructor:cs,load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=rs.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout((function(){e&&e(a),r.manager.itemEnd(t)}),0),a;if(void 0===hs[t]){var o=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],h=!!o[2],c=o[3];c=decodeURIComponent(c),h&&(c=atob(c));try{var l,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var d=new Uint8Array(c.length),p=0;p<c.length;p++)d[p]=c.charCodeAt(p);l="blob"===u?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;l=f.parseFromString(c,s);break;case"json":l=JSON.parse(c);break;default:l=c}setTimeout((function(){e&&e(l),r.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{hs[t]=[],hs[t].push({onLoad:e,onProgress:i,onError:n});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",(function(e){var i=this.response,n=hs[t];if(delete hs[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),rs.add(t,i);for(var a=0,o=n.length;a<o;a++){(s=n[a]).onLoad&&s.onLoad(i)}r.manager.itemEnd(t)}else{for(a=0,o=n.length;a<o;a++){var s;(s=n[a]).onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),m.addEventListener("progress",(function(e){for(var i=hs[t],n=0,r=i.length;n<r;n++){var a=i[n];a.onProgress&&a.onProgress(e)}}),!1),m.addEventListener("error",(function(e){var i=hs[t];delete hs[t];for(var n=0,a=i.length;n<a;n++){var o=i[n];o.onError&&o.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),m.addEventListener("abort",(function(e){var i=hs[t];delete hs[t];for(var n=0,a=i.length;n<a;n++){var o=i[n];o.onError&&o.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(t),m}hs[t].push({onLoad:e,onProgress:i,onError:n})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),ls.prototype=Object.assign(Object.create(ss.prototype),{constructor:ls,load:function(t,e,i,n){var r=this,a=new cs(r.manager);a.setPath(r.path),a.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){for(var e=[],i=0;i<t.length;i++){var n=is.parse(t[i]);e.push(n)}return e}}),us.prototype=Object.assign(Object.create(ss.prototype),{constructor:us,load:function(t,e,i,n){var r=this,a=[],o=new da;o.image=a;var s=new cs(this.manager);function h(h){s.load(t[h],(function(t){var i=r.parse(t,!0);a[h]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(c+=1)&&(1===i.mipmapCount&&(o.minFilter=1006),o.format=i.format,o.needsUpdate=!0,e&&e(o))}),i,n)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var c=0,l=0,u=t.length;l<u;++l)h(l);else s.load(t,(function(t){var i=r.parse(t,!0);if(i.isCubemap)for(var n=i.mipmaps.length/i.mipmapCount,s=0;s<n;s++){a[s]={mipmaps:[]};for(var h=0;h<i.mipmapCount;h++)a[s].mipmaps.push(i.mipmaps[s*i.mipmapCount+h]),a[s].format=i.format,a[s].width=i.width,a[s].height=i.height}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=1006),o.format=i.format,o.needsUpdate=!0,e&&e(o)}),i,n);return o}}),ds.prototype=Object.assign(Object.create(ss.prototype),{constructor:ds,load:function(t,e,
vendor: 4,818 bytes, line 12
12i,n){var r=this,a=new Qe,o=new cs(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,(function(t){var i=r.parse(t);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:1001,a.wrapT=void 0!==i.wrapT?i.wrapT:1001,a.magFilter=void 0!==i.magFilter?i.magFilter:1006,a.minFilter=void 0!==i.minFilter?i.minFilter:1006,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps,a.minFilter=1008),1===i.mipmapCount&&(a.minFilter=1006),a.needsUpdate=!0,e&&e(a,i))}),i,n),a}}),ps.prototype=Object.assign(Object.create(ss.prototype),{constructor:ps,load:function(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=rs.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout((function(){e&&e(a),r.manager.itemEnd(t)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",h,!1),rs.add(t,this),e&&e(this),r.manager.itemEnd(t)}function h(e){o.removeEventListener("load",s,!1),o.removeEventListener("error",h,!1),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}return o.addEventListener("load",s,!1),o.addEventListener("error",h,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}),fs.prototype=Object.assign(Object.create(ss.prototype),{constructor:fs,load:function(t,e,i,n){var r=new bi,a=new ps(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(i){a.load(t[i],(function(t){r.images[i]=t,6===++o&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(var h=0;h<t.length;++h)s(h);return r}}),ms.prototype=Object.assign(Object.create(ss.prototype),{constructor:ms,load:function(t,e,i,n){var r=new x,a=new ps(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,(function(i){r.image=i;var n=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=n?1022:1023,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}),Object.assign(gs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,n=[],r=this.getPoint(0),a=0;for(n.push(0),i=1;i<=t;i++)a+=(e=this.getPoint(i/t)).distanceTo(r),n.push(a),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,n=this.getLengths(),r=0,a=n.length;i=e||t*n[a-1];for(var o,s=0,h=a-1;s<=h;)if((o=n[r=Math.floor(s+(h-s)/2)]-i)<0)s=r+1;else{if(!(o>0)){h=r;break}h=r-1}if(n[r=h]===i)return r/(a-1);var c=n[r];return(r+(i-c)/(n[r+1]-c))/(a-1)},getTangent:function(t,e){var i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);var r=this.getPoint(i),a=this.getPoint(n),o=e||(r.isVector2?new m:new E);return o.copy(a).sub(r).normalize(),o},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},computeFrenetFrames:function(t,e){var i,n,r,a=new E,o=[],s=[],h=[],c=new E,l=new D;for(i=0;i<=t;i++)n=i/t,o[i]=this.getTangentAt(n,new E),o[i].normalize();s[0]=new E,h[0]=new E;var u=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),m=Math.abs(o[0].z);for(d<=u&&(u=d,a.set(1,0,0)),p<=u&&(u=p,a.set(0,1,0)),m<=u&&a.set(0,0,1),c.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],c),h[0].crossVectors(o[0],s[0]),i=1;i<=t;i++)s[i]=s[i-1].clone(),h[i]=h[i-1].clone(),c.crossVectors(o[i-1],o[i]),c.length()>Number.EPSILON&&(c.normalize(),r=Math.acos(f.clamp(o[i-1].dot(o[i]),-1,1)),s[i].applyMatrix4(l.makeRotationAxis(c,r))),h[i].crossVectors(o[i],s[i]);if(!0===e)for(r=Math.acos(f.clamp(s[0].dot(s[t]),-1,1)),r/=t,o[0].dot(c.crossVectors(s[0],s[t]))>0&&(r=-r),i=1;i<=t;i++)s[i].applyMatrix4(l.makeRotationAxis(o[i],r*i)),h[i].crossVectors(o[i],s[i]);return{tangents:o,normals:s,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.t
vendor: 5,787 bytes, line 12
12ype,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),vs.prototype=Object.create(gs.prototype),vs.prototype.constructor=vs,vs.prototype.isEllipseCurve=!0,vs.prototype.getPoint=function(t,e){for(var i=e||new m,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=a?0:n),!0!==this.aClockwise||a||(r===n?r=-n:r-=n);var o=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(o),h=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),l=Math.sin(this.aRotation),u=s-this.aX,d=h-this.aY;s=u*c-d*l+this.aX,h=u*l+d*c+this.aY}return i.set(s,h)},vs.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},vs.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},vs.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ys.prototype=Object.create(vs.prototype),ys.prototype.constructor=ys,ys.prototype.isArcCurve=!0;var bs=new E,_s=new xs,ws=new xs,Ms=new xs;function Ss(t,e,i,n){gs.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=i||"centripetal",this.tension=n||.5}function Ts(t,e,i,n,r){var a=.5*(n-e),o=.5*(r-i),s=t*t;return(2*i-2*n+a+o)*(t*s)+(-3*i+3*n-2*a-o)*s+a*t+i}function Es(t,e,i,n){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function As(t,e,i,n,r){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}function Ps(t,e,i,n){gs.call(this),this.type="CubicBezierCurve",this.v0=t||new m,this.v1=e||new m,this.v2=i||new m,this.v3=n||new m}function Cs(t,e,i,n){gs.call(this),this.type="CubicBezierCurve3",this.v0=t||new E,this.v1=e||new E,this.v2=i||new E,this.v3=n||new E}function Ls(t,e){gs.call(this),this.type="LineCurve",this.v1=t||new m,this.v2=e||new m}function Rs(t,e){gs.call(this),this.type="LineCurve3",this.v1=t||new E,this.v2=e||new E}function Is(t,e,i){gs.call(this),this.type="QuadraticBezierCurve",this.v0=t||new m,this.v1=e||new m,this.v2=i||new m}function Os(t,e,i){gs.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new E,this.v1=e||new E,this.v2=i||new E}function Ds(t){gs.call(this),this.type="SplineCurve",this.points=t||[]}Ss.prototype=Object.create(gs.prototype),Ss.prototype.constructor=Ss,Ss.prototype.isCatmullRomCurve3=!0,Ss.prototype.getPoint=function(t,e){var i,n,r,a,o=e||new E,s=this.points,h=s.length,c=(h-(this.closed?0:1))*t,l=Math.floor(c),u=c-l;if(this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/h)+1)*h:0===u&&l===h-1&&(l=h-2,u=1),this.closed||l>0?i=s[(l-1)%h]:(bs.subVectors(s[0],s[1]).add(s[0]),i=bs),n=s[l%h],r=s[(l+1)%h],this.closed||l+2<h?a=s[(l+2)%h]:(bs.subVectors(s[h-1],s[h-2]).add(s[h-1]),a=bs),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(i.distanceToSquared(n),d),f=Math.pow(n.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),_s.initNonuniformCatmullRom(i.x,n.x,r.x,a.x,p,f,m),ws.initNonuniformCatmullRom(i.y,n.y,r.y,a.y,p,f,m),Ms.initNonuniformCatmullRom(i.z,n.z,r.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(_s.initCatmullRom(i.x,n.x,r.x,a.x,this.tension),ws.initCatmullRom(i.y,n.y,r.y,a.y,this.tension),Ms.initCatmullRom(i.z,n.z,r.z,a.z,this.tension));return o.set(_s.calc(u),ws.calc(u),Ms.calc(u)),o},Ss.prototype.copy=function(t){gs.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ss.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);t.points=[];for(var e=0,i=this.points.length;e<i;e++){var n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Ss.prototype.fromJSON=function(t){gs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push((new E).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ps.prototype=Object.create(gs.prototype),Ps.prototype.constructor=Ps,Ps.prototype.isCubicBezierCurve=!0,Ps.prototype.getPoint=function(t,e){var i=e||new m,n=this.v0,r=this.v1,a=this.v2,o=this.v3;return i.set(As(t,n.x,r.x,a.x,o.x),As(t,n.y,r.y,a.y,o.y)),i},Ps.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ps.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ps.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Cs.prototype=Object.create(gs.prototype),Cs.prototype.constructor=Cs,Cs.prototype.isCubicBezierCurve3=!0,Cs.prototype.getPoint=function(t,e){var i=e||new E,n=this.v0,r=this.v1,a=this.v2,o=this.v3;
vendor: 4,387 bytes, line 12
12return i.set(As(t,n.x,r.x,a.x,o.x),As(t,n.y,r.y,a.y,o.y),As(t,n.z,r.z,a.z,o.z)),i},Cs.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Cs.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Cs.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ls.prototype=Object.create(gs.prototype),Ls.prototype.constructor=Ls,Ls.prototype.isLineCurve=!0,Ls.prototype.getPoint=function(t,e){var i=e||new m;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},Ls.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Ls.prototype.getTangent=function(t,e){return(e||new m).copy(this.v2).sub(this.v1).normalize()},Ls.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ls.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ls.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Rs.prototype=Object.create(gs.prototype),Rs.prototype.constructor=Rs,Rs.prototype.isLineCurve3=!0,Rs.prototype.getPoint=function(t,e){var i=e||new E;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},Rs.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Rs.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Rs.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Rs.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Is.prototype=Object.create(gs.prototype),Is.prototype.constructor=Is,Is.prototype.isQuadraticBezierCurve=!0,Is.prototype.getPoint=function(t,e){var i=e||new m,n=this.v0,r=this.v1,a=this.v2;return i.set(Es(t,n.x,r.x,a.x),Es(t,n.y,r.y,a.y)),i},Is.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Is.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Is.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Os.prototype=Object.create(gs.prototype),Os.prototype.constructor=Os,Os.prototype.isQuadraticBezierCurve3=!0,Os.prototype.getPoint=function(t,e){var i=e||new E,n=this.v0,r=this.v1,a=this.v2;return i.set(Es(t,n.x,r.x,a.x),Es(t,n.y,r.y,a.y),Es(t,n.z,r.z,a.z)),i},Os.prototype.copy=function(t){return gs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Os.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Os.prototype.fromJSON=function(t){return gs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ds.prototype=Object.create(gs.prototype),Ds.prototype.constructor=Ds,Ds.prototype.isSplineCurve=!0,Ds.prototype.getPoint=function(t,e){var i=e||new m,n=this.points,r=(n.length-1)*t,a=Math.floor(r),o=r-a,s=n[0===a?a:a-1],h=n[a],c=n[a>n.length-2?n.length-1:a+1],l=n[a>n.length-3?n.length-1:a+2];return i.set(Ts(o,s.x,h.x,c.x,l.x),Ts(o,s.y,h.y,c.y,l.y)),i},Ds.prototype.copy=function(t){gs.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push(n.clone())}return this},Ds.prototype.toJSON=function(){var t=gs.prototype.toJSON.call(this);t.points=[];for(var e=0,i=this.points.length;e<i;e++){var n=this.points[e];t.points.push(n.toArray())}return t},Ds.prototype.fromJSON=function(t){gs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push((new m).fromArray(n))}return this};var Ns=Object.freeze({__proto__:null,ArcCurve:ys,CatmullRomCurve3:Ss,CubicBezierCurve:Ps,Cub
vendor: 15,973 bytes, line 12
12icBezierCurve3:Cs,EllipseCurve:vs,LineCurve:Ls,LineCurve3:Rs,QuadraticBezierCurve:Is,QuadraticBezierCurve3:Os,SplineCurve:Ds});function ks(){gs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Fs(t){ks.call(this),this.type="Path",this.currentPoint=new m,t&&this.setFromPoints(t)}function Gs(t){Fs.call(this,t),this.uuid=f.generateUUID(),this.type="Shape",this.holes=[]}function zs(t,e){Q.call(this),this.type="Light",this.color=new jt(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Us(t,e,i){zs.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Q.DefaultUp),this.updateMatrix(),this.groundColor=new jt(e)}function Bs(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new m(512,512),this.map=null,this.mapPass=null,this.matrix=new D,this._frustum=new ei,this._frameExtents=new m(1,1),this._viewportCount=1,this._viewports=[new b(0,0,1,1)]}function Hs(){Bs.call(this,new Ze(50,1,.5,500))}function js(t,e,i,n,r,a){zs.call(this,t,e),this.type="SpotLight",this.position.copy(Q.DefaultUp),this.updateMatrix(),this.target=new Q,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new Hs}function Vs(){Bs.call(this,new Ze(90,1,.5,500)),this._frameExtents=new m(4,2),this._viewportCount=6,this._viewports=[new b(2,1,1,1),new b(0,1,1,1),new b(3,1,1,1),new b(1,1,1,1),new b(3,0,1,1),new b(1,0,1,1)],this._cubeDirections=[new E(1,0,0),new E(-1,0,0),new E(0,0,1),new E(0,0,-1),new E(0,1,0),new E(0,-1,0)],this._cubeUps=[new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,0,1),new E(0,0,-1)]}function Ws(t,e,i,n){zs.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new Vs}function Xs(t,e,i,n,r,a){qe.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==i?i:1,this.bottom=void 0!==n?n:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ys(){Bs.call(this,new Xs(-5,5,5,-5,.5,500))}function qs(t,e){zs.call(this,t,e),this.type="DirectionalLight",this.position.copy(Q.DefaultUp),this.updateMatrix(),this.target=new Q,this.shadow=new Ys}function Zs(t,e){zs.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Js(t,e,i,n){zs.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function Ks(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new E)}function Qs(t,e){zs.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new Ks}function $s(t){ss.call(this,t),this.textures={}}ks.prototype=Object.assign(Object.create(gs.prototype),{constructor:ks,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ls(e,t))},getPoint:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),n=0;n<i.length;){if(i[n]>=e){var r=i[n]-e,a=this.curves[n],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,i=[],n=0,r=this.curves;n<r.length;n++)for(var a=r[n],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),h=0;h<s.length;h++){var c=s[h];e&&e.equals(c)||(i.push(c),e=c)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},copy:function(t){gs.prototype.copy.call(this,t),this.curves=[];for(var e=0,i=t.curves.length;e<i;e++){var n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=gs.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,i=this.curves.length;e<i;e++){var n=this.curves[e];t.curves.push(n.toJSON())}return t},fromJSON:function(t){gs.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,i=t.curves.length;e<i;e++){var n=t.curves[e];this.curves.push((new Ns[n.type]).fromJSON(n))}return this}}),Fs.prototype=Object.assign(Object.create(ks.prototype),{constructor:Fs,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var i=new Ls(this.currentPoint.clone(),new m(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,i,n){var r=new Is(this.currentPoint.clone(),new m(t,e),new m(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this},bezierCurveTo:function(t,e,i,n,r,a){var o=new Ps(this.currentPoint.clone(),new m(t,e),new m(i,n),new m(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this},splineThru:function(t){var e=new Ds([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,i,n,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,i,n,r,a),this},absarc:function(t,e,i,n,r,a){return this.absellipse(t,e,i,i,n,r,a),this},ellipse:function(t,e,i,n,r,a,o,s){var h=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+h,e+c,i,n,r,a,o,s),this},absellipse:function(t,e,i,n,r,a,o,s){var h=new vs(t,e,i,n,r,a,o,s);if(this.curves.length>0){var c=h.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(h);var l=h.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return ks.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=ks.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return ks.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Gs.prototype=Object.assign(Object.create(Fs.prototype),{constructor:Gs,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Fs.prototype.copy.call(this,t),this.holes=[];for(var e=0,i=t.holes.length;e<i;e++){var n=t.holes[e];this.holes.push(n.clone())}return this},toJSON:function(){var t=Fs.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,i=this.holes.length;e<i;e++){var n=this.holes[e];t.holes.push(n.toJSON())}return t},fromJSON:function(t){Fs.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,i=t.holes.length;e<i;e++){var n=t.holes[e];this.holes.push((new Fs).fromJSON(n))}return this}}),zs.prototype=Object.assign(Object.create(Q.prototype),{constructor:zs,isLight:!0,copy:function(t){return Q.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Q.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Us.prototype=Object.assign(Object.create(zs.prototype),{constructor:Us,isHemisphereLight:!0,copy:function(t){return zs.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Bs.prototype,{_projScreenMatrix:new D,_lightPositionWorld:new E,_lookTarget:new E,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,i=this.matrix,n=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(t.matrixWorld),e.position.copy(a),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),n.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(n),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Hs.prototype=Object.assign(Object.create(Bs.prototype),{constructor:Hs,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,i=2*f.RAD2DEG*t.angle,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),Bs.prototype.updateMatrices.call(this,t)}}),js.prototype=Object.assign(Object.create(zs.prototype),{constructor:js,isSpotLight:!0,copy:function(t){return zs.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Vs.prototype=Object.assign(Object.create(Bs.prototype),{constructor:Vs,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var i=this.camera,n=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),i.position.copy(r),a.copy(i.position),a.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(a),i.updateMatrixWorld(),n.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Ws.prototype=Object.assign(Object.create(zs.prototype),{constructor:Ws,isPointLight:!0,copy:function(t){return zs.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Xs.prototype=Object.assign(Object.create(qe.prototype),{constructor:Xs,isOrthographicCamera:!0,copy:function(t,e){return qe.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-t,a=i+t,o=n+e,s=n-e;if(null!==this.view&&this.view.enabled){var h=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(r+=h*this.view.offsetX)+h*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Q.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Ys.prototype=Object.assign(Object.create(Bs.prototype),{constructor:Ys,isDirectionalLightShadow:!0,updateMatrices:function(t){Bs.prototype.updateMatrices.call(this,t)}}),qs.prototype=Object.assign(Object.create(zs.prototype),{constructor:qs,isDirectionalLight:!0,copy:function(t){return zs.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Zs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Zs,isAmbientLight:!0}),Js.prototype=Object.assign(Object.create(zs.prototype),{constructor:Js,isRectAreaLight:!0,copy:function(t){return zs.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=zs.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Ks.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var i=t.x,n=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScaledVector(a[1],.488603*n),e.addScaledVector(a[2],.488603*r),e.addScaledVector(a[3],.488603*i),e.addScaledVector(a[4],i*n*1.092548),e.addScaledVector(a[5],n*r*1.092548),e.addScaledVector(a[6],.315392*(3*r*r-1)),e.addScaledVector(a[7],i*r*1.092548),e.addScaledVector(a[8],.546274*(i*i-n*n)),e},getIrradianceAt:function(t,e){var i=t.x,n=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScaledVector(a[1],1.023328*n),e.addScaledVector(a[2],1.023328*r),e.addScaledVector(a[3],1.023328*i),e.addScaledVector(a[4],.858086*i*n),e.addScaledVector(a[5],.858086*n*r),e.addScaledVector(a[6],.743125*r*r-.247708),e.addScaledVector(a[7],.858086*i*r),e.addScaledVector(a[8],.429043*(i*i-n*n)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},addScaledSH:function(t,e){for(var i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var i=this.coefficients,n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var i=this.coefficients,n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}}),Object.assign(Ks,{getBasisAt:function(t,e){var i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}),Qs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Qs,isLightProbe:!0,copy:function(t){return zs.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){var e=zs.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),$s.prototype=Object.assign(Object.create(ss.prototype),{constructor:$s,load:function(t,e,
12i,n){var r=this,a=new cs(r.manager);a.setPath(r.path),a.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){var e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var n=new Ho[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=(new jt).setHex(t.sheen)),void 0!==t.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&n.specular.setHex(t.specular),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(n.morphNormals=t.morphNormals),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.vertexTangents&&(n.vertexTangents=t.vertexTangents),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=t.vertexColors>0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var r in t.uniforms){var a=t.uniforms[r];switch(n.uniforms[r]={},a.type){case"t":n.uniforms[r].value=i(a.value);break;case"c":n.uniforms[r].value=(new jt).setHex(a.value);break;case"v2":n.uniforms[r].value=(new m).fromArray(a.value);break;case"v3":n.uniforms[r].value=(new E).fromArray(a.value);break;case"v4":n.uniforms[r].value=(new b).fromArray(a.value);break;case"m3":n.uniforms[r].value=(new g).fromArray(a.value);
12case"m4":n.uniforms[r].value=(new D).fromArray(a.value);break;default:n.uniforms[r].value=a.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)n.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),n.normalScale=(new m).fromArray(s)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new m).fromArray(t.clearcoatNormalScale)),n},setTextures:function(t){return this.textures=t,this}});var th=function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(t){return e}},eh=function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};function ih(){ve.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}
vendor: 13,491 bytes, line 12
12function nh(t,e,i,n){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Qt.call(this,t,e,i),this.meshPerAttribute=n||1}function rh(t){ss.call(this,t)}ih.prototype=Object.assign(Object.create(ve.prototype),{constructor:ih,isInstancedBufferGeometry:!0,copy:function(t){return ve.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=ve.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),nh.prototype=Object.assign(Object.create(Qt.prototype),{constructor:nh,isInstancedBufferAttribute:!0,copy:function(t){return Qt.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=Qt.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),rh.prototype=Object.assign(Object.create(ss.prototype),{constructor:rh,load:function(t,e,i,n){var r=this,a=new cs(r.manager);a.setPath(r.path),a.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){var e=t.isInstancedBufferGeometry?new ih:new ve,i=t.data.index;if(void 0!==i){var n=new ah[i.type](i.array);e.setIndex(new Qt(n,1))}var r=t.data.attributes;for(var a in r){var o=r[a],s=(n=new ah[o.type](o.array),new(o.isInstancedBufferAttribute?nh:Qt)(n,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),e.setAttribute(a,s)}var h=t.data.morphAttributes;if(h)for(var a in h){for(var c=h[a],l=[],u=0,d=c.length;u<d;u++){o=c[u],s=new Qt(n=new ah[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),l.push(s)}e.morphAttributes[a]=l}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var p=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==p){u=0;for(var f=p.length;u!==f;++u){var m=p[u];e.addGroup(m.start,m.count,m.materialIndex)}}var g=t.data.boundingSphere;if(void 0!==g){var v=new E;void 0!==g.center&&v.fromArray(g.center),e.boundingSphere=new gt(v,g.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var ah={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function oh(t){ss.call(this,t)}oh.prototype=Object.assign(Object.create(ss.prototype),{constructor:oh,load:function(t,e,i,n){var r=this,a=""===this.path?eh(t):this.path;this.resourcePath=this.resourcePath||a;var o=new cs(r.manager);o.setPath(this.path),o.load(t,(function(i){var a=null;try{a=JSON.parse(i)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(a,e):console.error("THREE.ObjectLoader: Can't load "+t)}),i,n)},parse:function(t,e){var i=this.parseShape(t.shapes),n=this.parseGeometries(t.geometries,i),r=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),a=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,n,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var i=0,n=t.length;i<n;i++){var r=(new Gs).fromJSON(t[i]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var i={};if(void 0!==t)for(var n=new rh,r=0,a=t.length;r<a;r++){var o,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Ro[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Ro[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Ro[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Ro[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Ro[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Ro[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Ro[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Ro[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Ro[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Ro[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Ro[s.type]((new Ns[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Ro[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Ro[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var h=[],c=0,l=s.shapes.length;c<l;c++){var u=e[s.shapes[c]];h.push(u)}o=new Ro[s.type](h,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(h=[],c=0,l=s.shapes.length;c<l;c++){u=e[s.shapes[c]];h.push(u)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new Ns[d.type]).fromJSON(d)),o=new Ro[s.type](h,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=n.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),i[s.uuid]=o}return i},parseMaterials:function(t,e){var i={},n={};if(void 0!==t){var r=new $s;r.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[a];if("MultiMaterial"===s.type){for(var h=[],c=0;c<s.materials.length;c++){var l=s.materials[c];void 0===i[l.uuid]&&(i[l.uuid]=r.parse(l)),h.push(i[l.uuid])}n[s.uuid]=h}else void 0===i[s.uuid]&&(i[s.uuid]=r.parse(s)),n[s.uuid]=i[s.uuid]}}return n},parseAnimations:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i],r=is.parse(n);void 0!==n.uuid&&(r.uuid=n.uuid),e.push(r)}return e},parseImages:function(t,e){var i=this,n={};function r(t){return i.manager.itemStart(t),a.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){var a=new ps(new as(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var h=t[o],c=h.url;if(Array.isArray(c)){n[h.uuid]=[];for(var l=0,u=c.length;l<u;l++){var d=c[l],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:i.resourcePath+d;n[h.uuid].push(r(p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:i.resourcePath+h.url;n[h.uuid]=r(p)}}}return n},parseTextures:function(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var n={};if(void 0!==t)for(var r=0,a=t.length;r<a;r++){var o,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(e[s.image])?new bi(e[s.image]):new x(e[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=i(s.mapping,hh)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=i(s.wrap[0],ch),o.wrapT=i(s.wrap[1],ch)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=i(s.minFilter,lh)),void 0!==s.magFilter&&(o.magFilter=i(s.magFilter,lh)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),n[s.uuid]=o}return n},parseObject:function(t,e,i){var n;function r(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,r=t.length;n<r;n++){var a=t[n];void 0===i[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),e.push(i[a])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}switch(t.type){case"Scene":n=new $,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new jt(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new cr(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new hr(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new Ze(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new Xs(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new Zs(t.color,t.intensity);break;case"DirectionalLight":n=new qs(t.color,t.intensity);break;case"PointLight":n=new Ws(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new Js(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new js(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new Us(t.color,t.groundColor,t.intensity);break;case"LightProbe":n=(new Qs).fromJSON(t);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":n=new Ne(o=r(t.geometry),s=a(t.material));break;case"InstancedMesh":var o=r(t.geometry),s=a(t.material),h=t.count,c=t.instanceMatrix;(n=new Xr(o,s,h)).instanceMatrix=new Qt(new Float32Array(c.array),16);break;case"LOD":n=new kr;break;case"Line":n=new $r(r(t.geometry),a(t.material),t.mode);break;case"LineLoop":n=new na(r(t.geometry),a(t.material));break;case"LineSegments":n=new ia(r(t.geometry),a(t.material));break;case"PointCloud":case"Points":n=new ca(r(t.geometry),a(t.material));break;case"Sprite":n=new Ar(a(t.material));break;case"Group":n=new nr;break;default:n=new Q}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var l=t.children,u=0;u<l.length;u++)n.add(this.parseObject(l[u],e,i));if("LOD"===t.type){void 0!==t.autoUpdate&&(n.autoUpdate=t.autoUpdate);for(var d=t.levels,p=0;p<d.length;p++){var f=d[p],m=n.getObjectByProperty("uuid",f.object);void 0!==m&&n.addLevel(m,f.distance)}}return n}});var sh,hh={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},ch={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},lh={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};function uh(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ss.call(this,t),this.options=void 0}function dh(){this.type="ShapePath",this.color=new jt,this.subPaths=[],this.currentPath=null}function ph(t){this.type="Font",this.data=t}
vendor: 4,704 bytes, line 12
12function fh(t,e,i,n,r){var a=r.glyphs[t]||r.glyphs["?"];if(a){var o,s,h,c,l,u,d,p,f=new dh;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*e+i,s=m[g++]*e+n,f.moveTo(o,s);break;case"l":o=m[g++]*e+i,s=m[g++]*e+n,f.lineTo(o,s);break;case"q":h=m[g++]*e+i,c=m[g++]*e+n,l=m[g++]*e+i,u=m[g++]*e+n,f.quadraticCurveTo(l,u,h,c);break;case"b":h=m[g++]*e+i,c=m[g++]*e+n,l=m[g++]*e+i,u=m[g++]*e+n,d=m[g++]*e+i,p=m[g++]*e+n,f.bezierCurveTo(l,u,d,p,h,c)}}return{offsetX:a.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".")}function mh(t){ss.call(this,t)}uh.prototype=Object.assign(Object.create(ss.prototype),{constructor:uh,setOptions:function(t){return this.options=t,this},load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=rs.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout((function(){e&&e(a),r.manager.itemEnd(t)}),0),a;fetch(t).then((function(t){return t.blob()})).then((function(t){return void 0===r.options?createImageBitmap(t):createImageBitmap(t,r.options)})).then((function(i){rs.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}}),Object.assign(dh.prototype,{moveTo:function(t,e){return this.currentPath=new Fs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this},bezierCurveTo:function(t,e,i,n,r,a){return this.currentPath.bezierCurveTo(t,e,i,n,r,a),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function i(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],a=new Gs;a.curves=r.curves,e.push(a)}return e}function n(t,e){for(var i=e.length,n=!1,r=i-1,a=0;a<i;r=a++){var o=e[r],s=e[a],h=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=e[a],h=-h,s=e[r],c=-c),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var l=c*(t.x-o.x)-h*(t.y-o.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return n}var r=ao.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return i(a);var o,s,h,c=[];if(1===a.length)return s=a[0],(h=new Gs).curves=s.curves,c.push(h),c;var l=!r(a[0].getPoints());l=t?!l:l;var u,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=r(u=(s=a[v]).getPoints()),(o=t?!o:o)?(!l&&f[g]&&g++,f[g]={s:new Gs,p:u},f[g].s.curves=s.curves,l&&g++,m[g]=[]):m[g].push({h:s,p:u[0]});if(!f[0])return i(a);if(f.length>1){for(var x=!1,b=[],_=0,w=f.length;_<w;_++)p[_]=[];for(_=0,w=f.length;_<w;_++)for(var M=m[_],S=0;S<M.length;S++){for(var T=M[S],E=!0,A=0;A<f.length;A++)n(T.p,f[A].p)&&(_!==A&&b.push({froms:_,tos:A,hole:S}),E?(E=!1,p[A].push(T)):x=!0);E&&p[_].push(T)}b.length>0&&(x||(m=p))}v=0;for(var P=f.length;v<P;v++){h=f[v].s,c.push(h);for(var C=0,L=(d=m[v]).length;C<L;C++)h.holes.push(d[C].h)}return c}}),Object.assign(ph.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var i=[],n=function(t,e,i){for(var n=Array.from?Array.from(t):String(t).split(""),r=e/i.resolution,a=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,o=[],s=0,h=0,c=0;c<n.length;c++){var l=n[c];if("\n"===l)s=0,h-=a;else{var u=fh(l,r,s,h,i);s+=u.offsetX,o.push(u.path)}}return o}(t,e,this.data),r=0,a=n.length;r<a;r++)Array.prototype.push.apply(i,n[r].toShapes());return i}}),mh.prototype=Object.assign(Object.create(ss.prototype),{constructor:mh,load:function(t,e,i,n){var r=this,a=new cs(this.manager);a.setPath(this.path),a.load(t,(function(t){var i;try{i=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}var n=r.parse(i);e&&e(n)}),i,n)},parse:function(t){return new ph(t)}});var gh=function(){return void 0===sh&&(sh=new(window.AudioContext||window.webkitAudioContext)),sh};function vh(t){ss.call(this,t)}function yh(t,e,i){Qs.call(this,void 0,i);var n=(new jt).set(t),r=(new jt).set(e),a=new E(n.r,n.g,n.b),o=new E(r.r,r.g,r.b),s=Math.sqrt(Math.PI),h=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(h)}function xh(t,e){Qs.call(this,void 0,e);var i=(new jt).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}vh.prototype=Object.assign(Object.create(ss.prototype),{constructor:vh,load:function(t,e,
vendor: 4,828 bytes, line 12
12i,n){var r=this,a=new cs(r.manager);a.setResponseType("arraybuffer"),a.setPath(r.path),a.load(t,(function(i){try{var a=i.slice(0);gh().decodeAudioData(a,(function(t){e(t)}))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}}),yh.prototype=Object.assign(Object.create(Qs.prototype),{constructor:yh,isHemisphereLightProbe:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this},toJSON:function(t){return Qs.prototype.toJSON.call(this,t)}}),xh.prototype=Object.assign(Object.create(Qs.prototype),{constructor:xh,isAmbientLightProbe:!0,copy:function(t){return Qs.prototype.copy.call(this,t),this},toJSON:function(t){return Qs.prototype.toJSON.call(this,t)}});var bh=new D,_h=new D;function wh(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ze,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ze,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var i,n,r=t.projectionMatrix.clone(),a=e.eyeSep/2,o=a*e.near/e.focus,s=e.near*Math.tan(f.DEG2RAD*e.fov*.5)/e.zoom;_h.elements[12]=-a,bh.elements[12]=a,i=-s*e.aspect+o,n=s*e.aspect+o,r.elements[0]=2*e.near/(n-i),r.elements[8]=(n+i)/(n-i),this.cameraL.projectionMatrix.copy(r),i=-s*e.aspect-o,n=s*e.aspect-o,r.elements[0]=2*e.near/(n-i),r.elements[8]=(n+i)/(n-i),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(_h),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(bh)}}),Object.assign(wh.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});var Mh=new E,Sh=new M,Th=new E,Eh=new E;function Ah(){Q.call(this),this.type="AudioListener",this.context=gh(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new wh}function Ph(t){Q.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._progress=0,this.filters=[]}Ah.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ah,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){Q.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Mh,Sh,Th),Eh.set(0,0,-1).applyQuaternion(Sh),e.positionX){var n=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Mh.x,n),e.positionY.linearRampToValueAtTime(Mh.y,n),e.positionZ.linearRampToValueAtTime(Mh.z,n),e.forwardX.linearRampToValueAtTime(Eh.x,n),e.forwardY.linearRampToValueAtTime(Eh.y,n),e.forwardZ.linearRampToValueAtTime(Eh.z,n),e.upX.linearRampToValueAtTime(i.x,n),e.upY.linearRampToValueAtTime(i.y,n),e.upZ.linearRampToValueAtTime(i.z,n)}else e.setPosition(Mh.x,Mh.y,Mh.z),e.setOrientation(Eh.x,Eh.y,Eh.z,i.x,i.y,i.z)}}),Ph.prototype=Object.assign(Object.create(Q.prototype),{constructor:Ph,getOutput:function(){return this.gain}
12,setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Ch=new E,Lh=new M,Rh=new E,Ih=new E;function Oh(t){Ph.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Dh(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Nh(t,e,i){var n,r,a;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Oh.prototype=Object.assign(Object.create(Ph.prototype),{constructor:Oh,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this}
12,setDirectionalCone:function(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this},updateMatrixWorld:function(t){if(Q.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Ch,Lh,Rh),Ih.set(0,0,1).applyQuaternion(Lh);var e=this.panner;if(e.positionX){var i=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Ch.x,i),e.positionY.linearRampToValueAtTime(Ch.y,i),e.positionZ.linearRampToValueAtTime(Ch.z,i),e.orientationX.linearRampToValueAtTime(Ih.x,i),e.orientationY.linearRampToValueAtTime(Ih.y,i),e.orientationZ.linearRampToValueAtTime(Ih.z,i)}else e.setPosition(Ch.x,Ch.y,Ch.z),e.setOrientation(Ih.x,Ih.y,Ih.z)}}}),Object.assign(Dh.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),i=0;i<e.length;i++)t+=e[i];return t/e.length}}),Object.assign(Nh.prototype,{accumulate:function(t,e){var i=this.buffer,n=this.valueSize,r=t*n+n,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==n;++o)i[r+o]=i[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(i,r,0,s,n)}this.cumulativeWeight=a},accumulateAdditive:function(t){var e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t},apply:function(t){var e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){var s=e*this._origIndex;this._mixBufferRegion(i,n,s,1-r,e)}a>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(var h=e,c=e+e;h!==c;++h)if(i[h]!==i[h+e]){o.setValue(i,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(var r=i,a=n;r!==a;++r)e[r]=e[n+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,i=t;i<e;i++)this.buffer[i]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){for(var t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize,i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]},_select:function(t,e,i,n,r){if(n>=.5)for(var a=0;a!==r;++a)t[e+a]=t[i+a]},_slerp:function(t,e,i,n){M.slerpFlat(t,e,t,e,t,i,n)},_slerpAdditive:function(t,e,i,n,r){var a=this._workIndex*r;M.multiplyQuaternionsFlat(t,a,t,e,t,i),M.slerpFlat(t,e,t,e,t,a,n)},_lerp:function(t,e,i,n,r){for(var a=1-n,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[i+o]*n}},_lerpAdditive:function(t,e,i,n,r){for(var a=0;a!==r;++a){var o=e+a;t[o]=t[o]+t[i+a]*n}}});var kh=new RegExp("[\\[\\]\\.:\\/]","g"),Fh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Gh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),zh=/(WCOD+)?/.source.replace("WCOD",Fh),Uh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Bh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Hh=new RegExp("^"+Gh+zh+Uh+Bh+"$"),jh=["material","materials","bones"];function Vh(t,e,i){var n=i||Wh.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Wh(t,e,i){this.path=e,this.parsedPath=i||Wh.parseTrackName(e),this.node=Wh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Xh(t,e,i,n){this._mixer=t,this._clip=e,this._localRoot=i||null,this.blendMode=n||e.blendMode;for(var r=e.tracks,a=r.length,o=new Array(a),s={endingStart:2400,endingEnd:2400},h=0;h!==a;++h){var c=r[h].createInterpolant(null);o[h]=c,c.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Yh(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function qh(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Zh(t,e,i){lr.call(this,t,e),this.meshPerAttribute=i||1}function Jh(t,e,i,n){this.ray=new St(t,e),this.near=i||0,this.far=n||1/0,this.camera=null,this.layers=new G,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Kh(t,e){return t.distance-e.distance}
vendor: 6,561 bytes, line 12
12function Qh(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n)for(var r=t.children,a=0,o=r.length;a<o;a++)Qh(r[a],e,i,!0)}function $h(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this}Object.assign(Vh.prototype,{getValue:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}),Object.assign(Wh,{Composite:Vh,create:function(t,e,i){return t&&t.isAnimationObjectGroup?new Wh.Composite(t,e,i):new Wh(t,e,i)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(kh,"")},parseTrackName:function(t){var e=Hh.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var r=i.nodeName.substring(n+1);-1!==jh.indexOf(r)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=r)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var r=t[i];if(r.name===e||r.uuid===e)return r;var a=n(r.children);if(a)return a}return null},r=n(t.children);if(r)return r}return null}}),Object.assign(Wh.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=Wh.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(i){var a=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[n];if(void 0!==s){var h=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?h=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][h]}else{var l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+n+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Wh.prototype,{_getValue_unbound:Wh.prototype.getValue,_setValue_unbound:Wh.prototype.setValue}),Object.assign(function(){this.uuid=f.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;
vendor: 4,178 bytes, line 12
12for(var e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,h=void 0,c=0,l=arguments.length;c!==l;++c){var u=arguments[c],d=u.uuid,p=n[d];if(void 0===p){p=e++,n[d]=p,t.push(u);for(var f=0,m=s;f!==m;++f)o[f].push(new Wh(u,r[f],a[f]))}else if(p<i){h=t[p];var g=--i,v=t[g];n[v.uuid]=p,t[p]=v,n[d]=g,t[g]=u;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[p];y[p]=x,void 0===b&&(b=new Wh(u,r[f],a[f])),y[g]=b}}else t[p]!==h&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=i},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,r=n.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],h=s.uuid,c=i[h];if(void 0!==c&&c>=e){var l=e++,u=t[l];i[u.uuid]=c,t[c]=u,i[h]=l,t[l]=s;for(var d=0,p=r;d!==p;++d){var f=n[d],m=f[l],g=f[c];f[c]=m,f[l]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var h=arguments[o],c=h.uuid,l=n[c];if(void 0!==l)if(delete n[c],l<i){var u=--i,d=t[u],p=t[y=--e];n[d.uuid]=l,t[l]=d,n[p.uuid]=u,t[u]=p,t.pop();for(var f=0,m=a;f!==m;++f){var g=(x=r[f])[u],v=x[y];x[l]=g,x[u]=v,x.pop()}}else{var y;n[(p=t[y=--e]).uuid]=l,t[l]=p,t.pop();for(f=0,m=a;f!==m;++f){var x;(x=r[f])[l]=x[y],x.pop()}}}this.nCachedObjects_=i},subscribe_:function(t,e){var i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];var a=this._paths,o=this._parsedPaths,s=this._objects,h=s.length,c=this.nCachedObjects_,l=new Array(h);n=r.length,i[t]=n,a.push(t),o.push(e),r.push(l);for(var u=c,d=s.length;u!==d;++u){var p=s[u];l[u]=new Wh(p,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){var n=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];e[t[o]]=i,a[i]=s,a.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}}),Object.assign(Xh.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){var n=this._clip.duration,r=t._clip.duration,a=r/n,o=n/r;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)}
vendor: 9,947 bytes, line 12
12,warp:function(t,e,i){var n=this._mixer,r=n.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,h=a.sampleValues;return s[0]=r,s[1]=r+i,h[0]=t/o,h[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,n){if(this.enabled){var r=this._startTime;if(null!==r){var a=(t-r)*i;if(a<0||0===i)return;this._startTime=null,e=i*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0){var h=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,u=h.length;l!==u;++l)h[l].evaluate(o),c[l].accumulateAdditive(s);break;case 2500:default:for(l=0,u=h.length;l!==u;++l)h[l].evaluate(o),c[l].accumulate(n,s)}}}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i)e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,i=this._clip.duration,n=this.loop,r=this._loopCount,a=2202===n;if(0===t)return-1===r?e:a&&1==(1&r)?i-e:e;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),e>=i||e<0){var o=Math.floor(e/i);e-=i*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var h=t<0;this._setEndings(h,!h,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=e;if(a&&1==(1&r))return i-e}return e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=i,this}}),Yh.prototype=Object.assign(Object.create(l.prototype),{constructor:Yh,_bindAction:function(t,e){var i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,a=t._propertyBindings,o=t._interpolants,s=i.uuid,h=this._bindingsByRootAndName,c=h[s];void 0===c&&(c={},h[s]=c);for(var l=0;l!==r;++l){var u=n[l],d=u.name,p=c[d];if(void 0!==p)a[l]=p;else{if(void 0!==(p=a[l])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;++(p=new Nh(Wh.create(i,d,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[l]=p}o[l].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}for(var r=t._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){var n=this._actions,r=this._actionsByClip,a=r[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=n.length,n.push(t),a.actionByRoot[i]=t},_removeInactiveAction:function(t){var e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,h=s[s.length-1],c=t._byClipCacheIndex;h._byClipCacheIndex=c,s[c]=h,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackAction:function(t){var e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_addInactiveBinding:function(t,e,i){var n=this._bindingsByRootAndName,r=n[e],a=this._bindings;void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,a=this._bindingsByRootAndName,o=a[n],s=e[e.length-1],h=t._cacheIndex;s._cacheIndex=h,e[h]=s,e.pop(),delete o[r],0===Object.keys(o).length&&delete a[n]},_lendBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&((i=new Xo(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,i){var n=e||this._root,r=n.uuid,a="string"==typeof t?is.findByName(n,t):t,o=null!==a?a.uuid:t,s=this._actionsByClip[o],h=null;if(void 0===i&&(i=null!==a?a.blendMode:2500),void 0!==s){var c=s.actionByRoot[r];if(void 0!==c&&c.blendMode===i)return c;h=s.knownActions[0],null===a&&(a=h._clip)}if(null===a)return null;var l=new Xh(this,a,e,i);return this._bindAction(l,h),this._addInactiveAction(l,o,r),l},existingAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?is.findByName(i,t):t,a=r?r.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[n]||null},stopAllAction:function(){for(var t=this._actions,e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==i;++o){e[o]._update(n,t,r,a)}var s=this._bindings,h=this._nActiveBindings;for(o=0;o!==h;++o)s[o].apply(a);return this},setTime:function(t){this.time=0;for(var e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var h=a[o];this._deactivateAction(h);var c=h._cacheIndex,l=e[e.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,l._cacheIndex=c,e[c]=l,e.pop(),this._removeInactiveBindingsForAction(h)}delete n[i]}},uncacheRoot:function(t){var e=t.uuid,i=this._actionsByClip;for(var n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),qh.prototype.clone=function(){return new qh(void 0===this.value.clone?this.value:this.value.clone())},Zh.prototype=Object.assign(Object.create(lr.prototype),{constructor:Zh,isInstancedInterleavedBuffer:!0,copy:function(t){return lr.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Jh.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: 
12Unsupported camera type.")},intersectObject:function(t,e,i){var n=i||[];return Qh(t,this,n,e),n.sort(Kh),n},intersectObjects:function(t,e,i){var n=i||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var r=0,a=t.length;r<a;r++)Qh(t[r],this,n,e);return n.sort(Kh),n}}),Object.assign($h.prototype,{set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(f.clamp(e/this.radius,-1,1))),this}}),Object.assign(function(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}.prototype,{set:function(t,e,i){return this.radius=t,this.theta=e,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}});var tc=new m;function ec(t,e){this.min=void 0!==t?t:new m(1/0,1/0),this.max=void 0!==e?e:new m(-1/0,-1/0)}Object.assign(ec.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var i=tc.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new m),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new m),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new m),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new m),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return tc.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var ic=new E,nc=new E;function rc(t,e){this.start=void 0!==t?t:new E,this.end=void 0!==e?e:new E}function ac(t){Q.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUv
vendor: 11,441 bytes, line 12
12s=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(rc.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new E),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new E),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new E),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){ic.subVectors(t,this.start),nc.subVectors(this.end,this.start);var i=nc.dot(nc),n=nc.dot(ic)/i;return e&&(n=f.clamp(n,0,1)),n},closestPointToPoint:function(t,e,i){var n=this.closestPointToPointParameter(t,e);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new E),this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),ac.prototype=Object.create(Q.prototype),ac.prototype.constructor=ac,ac.prototype.isImmediateRenderObject=!0;var oc=new E;function sc(t,e){Q.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var i=new ve,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;n.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}i.setAttribute("position",new oe(n,3));var h=new Yr({fog:!1,toneMapped:!1});this.cone=new ia(i,h),this.add(this.cone),this.update()}sc.prototype=Object.create(Q.prototype),sc.prototype.constructor=sc,sc.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},sc.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),oc.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(oc),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var hc=new E,cc=new D,lc=new D;function uc(t){for(var e=function t(e){var i=[];e&&e.isBone&&i.push(e);for(var n=0;n<e.children.length;n++)i.push.apply(i,t(e.children[n]));return i}(t),i=new ve,n=[],r=[],a=new jt(0,0,1),o=new jt(0,1,0),s=0;s<e.length;s++){var h=e[s];h.parent&&h.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new oe(n,3)),i.setAttribute("color",new oe(r,3));var c=new Yr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});ia.call(this,i,c),this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function dc(t,e,i){this.light=t,this.light.updateMatrixWorld(),this.color=i;var n=new go(e,4,2),r=new Jt({wireframe:!0,fog:!1,toneMapped:!1});Ne.call(this,n,r),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}uc.prototype=Object.create(ia.prototype),uc.prototype.constructor=uc,uc.prototype.isSkeletonHelper=!0,uc.prototype.updateMatrixWorld=function(t){var e=this.bones,i=this.geometry,n=i.getAttribute("position");lc.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<e.length;r++){var o=e[r];o.parent&&o.parent.isBone&&(cc.multiplyMatrices(lc,o.matrixWorld),hc.setFromMatrixPosition(cc),n.setXYZ(a,hc.x,hc.y,hc.z),cc.multiplyMatrices(lc,o.parent.matrixWorld),hc.setFromMatrixPosition(cc),n.setXYZ(a+1,hc.x,hc.y,hc.z),a+=2)}i.getAttribute("position").needsUpdate=!0,Q.prototype.updateMatrixWorld.call(this,t)},dc.prototype=Object.create(Ne.prototype),dc.prototype.constructor=dc,dc.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},dc.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var pc=new E,fc=new jt,mc=new jt;function gc(t,e,i){Q.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;var n=new Ma(e);n.rotateY(.5*Math.PI),this.material=new Jt({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);var r=n.getAttribute("position"),a=new Float32Array(3*r.count);n.setAttribute("color",new Qt(a,3)),this.add(new Ne(n,this.material)),this.update()}function vc(t,e,i,n){t=t||10,e=e||10,i=new jt(void 0!==i?i:4473924),n=new jt(void 0!==n?n:8947848);for(var r=e/2,a=t/e,o=t/2,s=[],h=[],c=0,l=0,u=-o;c<=e;c++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var d=c===r?i:n;d.toArray(h,l),l+=3,d.toArray(h,l),l+=3,d.toArray(h,l),l+=3,d.toArray(h,l),l+=3}var p=new ve;p.setAttribute("position",new oe(s,3)),p.setAttribute("color",new oe(h,3));var f=new Yr({vertexColors:!0,toneMapped:!1});ia.call(this,p,f),this.type="GridHelper"}function yc(t,e,i,n,r,a){t=t||10,e=e||16,i=i||8,n=n||64,r=new jt(void 0!==r?r:4473924),a=new jt(void 0!==a?a:8947848);var o,s,h,c,l,u,d,p=[],f=[];for(c=0;c<=e;c++)h=c/e*(2*Math.PI),o=Math.sin(h)*t,s=Math.cos(h)*t,p.push(0,0,0),p.push(o,0,s),d=1&c?r:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(c=0;c<=i;c++)for(d=1&c?r:a,u=t-t/i*c,l=0;l<n;l++)h=l/n*(2*Math.PI),o=Math.sin(h)*u,s=Math.cos(h)*u,p.push(o,0,s),f.push(d.r,d.g,d.b),h=(l+1)/n*(2*Math.PI),o=Math.sin(h)*u,s=Math.cos(h)*u,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new ve;m.setAttribute("position",new oe(p,3)),m.setAttribute("color",new oe(f,3));var g=new Yr({vertexColors:!0,toneMapped:!1});ia.call(this,m,g),this.type="PolarGridHelper"}gc.prototype=Object.create(Q.prototype),gc.prototype.constructor=gc,gc.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},gc.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");fc.copy(this.light.color),mc.copy(this.light.groundColor);for(var i=0,n=e.count;i<n;i++){var r=i<n/2?fc:mc;e.setXYZ(i,r.r,r.g,r.b)}e.needsUpdate=!0}t.lookAt(pc.setFromMatrixPosition(this.light.matrixWorld).negate())},vc.prototype=Object.assign(Object.create(ia.prototype),{constructor:vc,copy:function(t){return ia.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),yc.prototype=Object.create(ia.prototype),yc.prototype.constructor=yc;var xc=new E,bc=new E,_c=new E;function wc(t,e,i){Q.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);var n=new ve;n.setAttribute("position",new oe([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new Yr({fog:!1,toneMapped:!1});this.lightPlane=new $r(n,r),this.add(this.lightPlane),(n=new ve).setAttribute("position",new oe([0,0,0,0,0,1],3)),this.targetLine=new $r(n,r),this.add(this.targetLine),this.update()}wc.prototype=Object.create(Q.prototype),wc.prototype.constructor=wc,wc.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},wc.prototype.update=function(){xc.setFromMatrixPosition(this.light.matrixWorld),bc.setFromMatrixPosition(this.light.target.matrixWorld),_c.subVectors(bc,xc),this.lightPlane.lookAt(bc),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(bc),this.targetLine.scale.z=_c.length()};var Mc=new E,Sc=new qe;function Tc(t){var e=new ve,i=new Yr({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],a={},o=new jt(16755200),s=new jt(16711680),h=new jt(43775),c=new jt(16777215),l=new jt(3355443);function u(t,e,i){d(t,i),d(e,i)}function d(t,e){n.push(0,0,0),r.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(n.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",s),u("p","n2",s),u("p","n3",s),u("p","n4",s),u("u1","u2",h),u("u2","u3",h),u("u3","u1",h),u("c","t",c),u("p","c",l),u("cn1","cn2",l),u("cn3","cn4",l),u("cf1","cf2",l),u("cf3","cf4",l),e.setAttribute("position",new oe(n,3)),e.setAttribute("color",new oe(r,3)),ia.call(this,e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Ec(t,e,i,n,r,a,o){Mc.set(r,a,o).unproject(n);var s=e[t];if(void 0!==s)for(var h=i.getAttribute("position"),c=0,l=s.length;c<l;c++)h.setXYZ(s[c],Mc.x,Mc.y,Mc.z)}Tc.prototype=Object.create(ia.prototype),Tc.prototype.constructor=Tc,Tc.prototype.update=function(){var t=this.geometry,e=this.pointMap;Sc.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Ec("c",e,t,Sc,0,0,-1),Ec("t",e,t,Sc,0,0,1),Ec("n1",e,t,Sc,-1,-1,-1),Ec("n2",e,t,Sc,1,-1,-1),Ec("n3",e,t,Sc,-1,1,-1),Ec("n4",e,t,Sc,1,1,-1),Ec("f1",e,t,Sc,-1,-1,1),Ec("f2",e,t,Sc,1,-1,1),Ec("f3",e,t,Sc,-1,1,1),Ec("f4",e,t,Sc,1,1,1),Ec("u1",e,t,Sc,.7,1.1,-1),Ec("u2",e,t,Sc,-.7,1.1,-1),Ec("u3",e,t,Sc,0,2,-1),Ec("cf1",e,t,Sc,-1,0,1),Ec("cf2",e,t,Sc,1,0,1),Ec("cf3",e,t,Sc,0,-1,1),Ec("cf4",e,t,Sc,0,1,1),Ec("cn1",e,t,Sc,-1,0,-1),Ec("cn2",e,t,Sc,1,0,-1),Ec("cn3",e,t,Sc,0,-1,-1),Ec("cn4",e,t,Sc,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Ac=new pt;function Pc(t,e){this.object=t,void 0===e&&(e=16776960);var i=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]),n=new Float32Array(24),r=new ve;r.setIndex(new Qt(i,1)),r.setAttribute("position",new Qt(n,3)),ia.call(this,r,new Yr({color:e,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Cc(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var i=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]),n=new ve;n.setIndex(new Qt(i,1)),n.setAttribute("position",new oe([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),ia.call(this,n,new Yr({color:e,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function Lc(t,e,i){this.plane=t,this.size=void 0===e?1:e;var n=void 0!==i?i:16776960,r=new ve;r.setAttribute("position",new oe([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),$r.call(this,r,new Yr({color:n,toneMapped:!1})),this.type="PlaneHelper";var a=new ve;a.setAttribute("position",new oe([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Ne(a,new Jt({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}Pc.prototype=Object.create(ia.prototype),Pc.prototype.constructor=Pc,Pc.prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update(
12) has no longer arguments."),void 0!==this.object&&Ac.setFromObject(this.object),!Ac.isEmpty()){var e=Ac.min,i=Ac.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Pc.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Pc.prototype.copy=function(t){return ia.prototype.copy.call(this,t),this.object=t.object,this},Pc.prototype.clone=function(){return(new this.constructor).copy(this)},Cc.prototype=Object.create(ia.prototype),Cc.prototype.constructor=Cc,Cc.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Q.prototype.updateMatrixWorld.call(this,t))},Lc.prototype=Object.create($r.prototype),Lc.prototype.constructor=Lc,Lc.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),Q.prototype.updateMatrixWorld.call(this,t)};var Rc,Ic,Oc=new E;function Dc(t,e,i,n,r,a){Q.call(this),this.type="ArrowHelper",void 0===t&&(t=new E(0,0,1)),void 0===e&&(e=new E(0,0,0)),void 0===i&&(i=1),void 0===n&&(n=16776960),void 0===r&&(r=.2*i),void 0===a&&(a=.2*r),void 0===Rc&&((Rc=new ve).setAttribute("position",new oe([0,0,0,0,1,0],3)),(Ic=new Eo(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new $r(Rc,new Yr({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ne(Ic,new Jt({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,a)}function Nc(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new ve;i.setAttribute("position",new oe(e,3)),i.setAttribute("color",new oe([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var n=new Yr({vertexColors:!0,toneMapped:!1});ia.call(this,i,n),this.type="AxesHelper"}Dc.prototype=Object.create(Q.prototype),Dc.prototype.constructor=Dc,Dc.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Oc.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Oc,e)}},Dc.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Dc.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Dc.prototype.copy=function(t){return Q.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Dc.prototype.clone=function(){return(new this.constructor).copy(this)},Nc.prototype=Object.create(ia.prototype),Nc.prototype.constructor=Nc;var kc=Math.pow(2,8),Fc=[.125,.215,.35,.446,.526,.582],Gc=5+Fc.length,zc={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Uc=new Xs,{_lodPlanes:Bc,_sizeLods:Hc,_sigmas:jc}=function(){for(var t=[],e=[],i=[],n=8,r=0;r<Gc;r++){var a=Math.pow(2,n);e.push(a);var o=1/a;r>4?o=Fc[r-8+4-1]:0==r&&(o=0),i.push(o);for(var s=1/(a-1),h=-s/2,c=1+s/2,l=[h,h,c,h,c,c,h,h,c,c,h,c],u=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=f>2?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,g+1,0,m,g,0,m+2/3,g+1,0,m,g+1,0];u.set(v,18*f),d.set(l,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new ve;x.setAttribute("position",new Qt(u,3)),x.setAttribute("uv",new Qt(d,2)),x.setAttribute("faceIndex",new Qt(p,1)),t.push(x),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}(),Vc=null,Wc=(1+Math.sqrt(5))/2,Xc=1/Wc,Yc=[new E(1,1,1),new E(-1,1,1),new E(1,1,-1),new E(-1,1,-1),new E(0,Wc,Xc),new E(0,Wc,-Xc),new E(Xc,0,Wc),new E(-Xc,0,Wc),new E(Wc,Xc,0),new E(-Wc,Xc,0)];function qc(t){var e,i,n,r;this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(e=20,i=new Float32Array(e),n=new E(0,1,0),(r=new Oo({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:zc[3e3]},outputEncoding:{value:zc[3e3]}},vertexShader:tl(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${el()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * 
12sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",r),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Zc(t){return void 0!==t&&1009===t.type&&(3e3===t.encoding||3001===t.encoding||3007===t.encoding)}function Jc(t){var e=new _(3*kc,3*kc,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Kc(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Qc(){var t=new Oo({uniforms:{envMap:{value:null},texelSize:{value:new m(1,1)},inputEncoding:{value:zc[3e3]},outputEncoding:{value:zc[3e3]}},vertexShader:tl(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${el()}\n\n#include <common>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function $c(){var t=new Oo({uniforms:{envMap:{value:null},inputEncoding:{value:zc[3e3]},outputEncoding:{value:zc[3e3]}},vertexShader:tl(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${el()}\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function tl(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function el(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}qc.prototype={constructor:qc,fromScene:function(t,e=0,i=.1,n=100){Vc=this._renderer.getRenderTarget();var r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r},fromEquirectangular:function(t){return t.magFilter=1003,t.minFilter=1003,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){Vc=this._renderer.getRenderTarget();var e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=$c(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=Qc(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t<Bc.length;t++)Bc[t].dispose()},_cleanup:function(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Vc),t.scissorTest=!1,t.setSize(t.width,t.height)},_allocateTargets:function(t){var e={magFilter:1003,minFilter:1003,generateMipmaps:!1,type:1009,format:1023,encoding:Zc(t)?t.encoding:3002,depthBuffer:!1,stencilBuffer:!1},i=Jc(e);return i.depthBuffer=!t,this._pingPongRenderTarget=Jc(e),i},_compileMaterial:function(t){var e=new Ne(Bc[0],t);this._renderer.compile(e,Uc)}
12,_sceneToCubeUV:function(t,e,i,n){var r=new Ze(90,1,e,i),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,h=s.outputEncoding,c=s.toneMapping,l=s.toneMappingExposure,u=s.getClearColor(),d=s.getClearAlpha();s.toneMapping=1,s.toneMappingExposure=1,s.outputEncoding=3e3;var p=t.background;if(p&&p.isColor){p.convertSRGBToLinear();var f=Math.max(p.r,p.g,p.b),m=Math.min(Math.max(Math.ceil(Math.log2(f)),-128),127);p=p.multiplyScalar(Math.pow(2,-m));var g=(m+128)/255;s.setClearColor(p,g),t.background=null}for(var v=0;v<6;v++){var y=v%3;0==y?(r.up.set(0,a[v],0),r.lookAt(o[v],0,0)):1==y?(r.up.set(0,0,a[v]),r.lookAt(0,o[v],0)):(r.up.set(0,a[v],0),r.lookAt(0,0,o[v])),Kc(n,y*kc,v>2?kc:0,kc,kc),s.setRenderTarget(n),s.render(t,r)}s.toneMapping=c,s.toneMappingExposure=l,s.outputEncoding=h,s.setClearColor(u,d)},_textureToCubeUV:function(t,e){var i=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=$c()):null==this._equirectShader&&(this._equirectShader=Qc());var n=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new Ne(Bc[0],n),a=n.uniforms;a.envMap.value=t,t.isCubeTexture||a.texelSize.value.set(1/t.image.width,1/t.image.height),a.inputEncoding.value=zc[t.encoding],a.outputEncoding.value=zc[e.texture.encoding],Kc(e,0,0,3*kc,2*kc),i.setRenderTarget(e),i.render(r,Uc)},_applyPMREM:function(t){var e=this._renderer,i=e.autoClear;e.autoClear=!1;for(var n=1;n<Gc;n++){var r=Math.sqrt(jc[n]*jc[n]-jc[n-1]*jc[n-1]),a=Yc[(n-1)%Yc.length];this._blur(t,n-1,n,r,a)}e.autoClear=i},_blur:function(t,e,i,n,r){var a=this._pingPongRenderTarget;this._halfBlur(t,a,e,i,n,"latitudinal",r),this._halfBlur(a,t,i,i,n,"longitudinal",r)},_halfBlur:function(t,e,i,n,r,a,o){var s=this._renderer,h=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var c=new Ne(Bc[n],h),l=h.uniforms,u=Hc[i]-1,d=isFinite(r)?Math.PI/(2*u):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);for(var m=[],g=0,v=0;v<20;++v){var y=v/p,x=Math.exp(-y*y/2);m.push(x),0==v?g+=x:v<f&&(g+=2*x)}for(v=0;v<m.length;v++)m[v]=m[v]/g;l.envMap.value=t.texture,l.samples.value=f,l.weights.value=m,l.latitudinal.value="latitudinal"===a,o&&(l.poleAxis.value=o),l.dTheta.value=d,l.mipInt.value=8-i,l.inputEncoding.value=zc[t.texture.encoding],l.outputEncoding.value=zc[t.texture.encoding];var b=Hc[n];Kc(e,y=3*Math.max(0,kc-2*b),(0===n?0:2*kc)+2*b*(n>4?n-8+4:0),3*b,2*b),s.setRenderTarget(e),s.render(c,Uc)}};function il(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ss.call(this,t),this.type="catmullrom"}gs.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(gs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(ks.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new He,i=0,n=t.length;i<n;i++){var r=t[i];e.vertices.push(new E(r.x,r.y,r.z||0))}return e}}),Object.assign(Fs.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(Ss.prototype),Object.create(Ss.prototype),il.prototype=Object.create(Ss.prototype),Object.assign(il.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),vc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},uc.prototype.update=function(){console.error("THREE.SkeletonHelper: update(
12) no longer needs to be called.")},Object.assign(ss.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),eh(t)}}),ss.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(oh.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(ec.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(pt.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(gt.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),ei.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},rc.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(f,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),f.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),f.ceilPowerOfTwo(t)}}),Object.assign(g.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3(
12) has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(D.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new E).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3(
12) has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,i,n,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,a)}}),Pt.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},M.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3(
12) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(St.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(zt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(zt,{barycoordFromPoint:function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),zt.getBarycoord(t,e,i,n,r)},normal:function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),zt.getNormal(t,e,i,n)}}),Object.assign(Gs.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ho(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new _o(this,t)}}),Object.assign(m.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(E.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(b.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(He.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyM
12atrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(Q.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Q.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Ne.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Ne.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(kr.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ur.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}
vendor: 4,759 bytes, line 12
12,set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Fr.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(gs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Ze.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(zs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Qt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Qt.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(ve.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Qt(arguments[1],arguments[2])))},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyM
12atrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(ve.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ih.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Jh.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(lr.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(lr.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(co.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(qh.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Zt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
vendor: 4,745 bytes, line 12
12,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new jt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(ko.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Ye.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(sr.prototype,{clearTarget:function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling(
12) has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(sr.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?3001:3e3}}}),Object.defineProperties(Qn.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(_.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy 
12is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Ph.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new vh).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Dh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Je.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
12)."),this.update(t,e)};v.crossOrigin=void 0,v.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new ms;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,i,void 0,n);return e&&(a.mapping=e),a},v.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new fs;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,i,void 0,n);return e&&(a.mapping=e),a},v.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},v.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"117"}}));var nl=function(){function t(t){ss.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function e(){var t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}t.prototype=Object.assign(Object.create(ss.prototype),{constructor:t,load:function(t,e,i,n){var r,a=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:eh(t),a.manager.itemStart(t);var o=function(e){n?n(e):console.error(e),a.manager.itemError(t),a.manager.itemEnd(t)},s=new cs(a.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),"use-credentials"===a.crossOrigin&&s.setWithCredentials(!0),s.load(t,(function(i){try{a.parse(i,r,(function(i){e(i),a.manager.itemEnd(t)}),o)}catch(t){o(t)}}),i,o)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},parse:function(t,e,h,c){var p,f={};if("string"==typeof t)p=t;else if(th(new Uint8Array(t,0,4))===s){try{f[i.KHR_BINARY_GLTF]=new l(t)}catch(t){return void(c&&c(t))}p=f[i.KHR_BINARY_GLTF].content}else p=th(new Uint8Array(t));var m=JSON.parse(p);if(void 0===m.asset||m.asset.version[0]<2)c&&c(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(m.extensionsUsed)for(var y=0;y<m.extensionsUsed.length;++y){var x=m.extensionsUsed[y],b=m.extensionsRequired||[];switch(x){case i.KHR_LIGHTS_PUNCTUAL:f[x]=new r(m);break;case i.KHR_MATERIALS_CLEARCOAT:f[x]=new o;break;case i.KHR_MATERIALS_UNLIT:f[x]=new a;break;case i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:f[x]=new g;break;case i.KHR_DRACO_MESH_COMPRESSION:f[x]=new u(m,this.dracoLoader);break;case i.MSFT_TEXTURE_DDS:f[x]=new n(this.ddsLoader);break;case i.KHR_TEXTURE_TRANSFORM:f[x]=new d;break;case i.KHR_MESH_QUANTIZATION:f[x]=new v;break;default:b.indexOf(x)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+x+'".')}}var _=new V(m,f,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});_.fileLoader.setRequestHeader(this.requestHeader),_.parse(h,c)}}});var i={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_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=i.MSFT_TEXTURE_DDS,this.ddsLoader=t}function r(t){this.name=i.KHR_LIGHTS_PUNCTUAL;var e=t.extensions&&t.extensions[i.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=e.lights||[]}function a(){this.name=i.KHR_MATERIALS_UNLIT}function o(){this.name=i.KHR_MATERIALS_CLEARCOAT}r.prototype.loadLight=function(t){var e,i=this.lightDefs[t],n=new jt(16777215);void 0!==i.color&&n.fromArray(i.color);var r=void 0!==i.range?i.range:0;switch(i.type){case"directional":(e=new qs(n)).target.position.set(0,0,-1),e.add(e.target);break;case"point":(e=new Ws(n)).distance=r;break;case"spot":(e=new js(n)).distance=r,i.spot=i.spot||{},i.spot.innerConeAngle=void 0!==i.spot.innerConeAngle?i.spot.innerConeAngle:0,i.spot.outerConeAngle=void 0!==i.spot.outerConeAngle?i.spot.outerConeAngle:Math.PI/4,e.angle=i.spot.outerConeAngle,e.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,e.target.position.set(0,0,-1),e.add(e.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+i.type+'".')}return e.position.set(0,0,0),e.decay=2,void 0!==i.intensity&&(e.intensity=i.intensity),e.name=i.name||"light_"+t,Promise.resolve(e)},a.prototype.getMaterialType=function(){return Jt}
vendor: 11,291 bytes, line 12
12,a.prototype.extendParams=function(t,e,i){var n=[];t.color=new jt(1,1,1),t.opacity=1;var r=e.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){var a=r.baseColorFactor;t.color.fromArray(a),t.opacity=a[3]}void 0!==r.baseColorTexture&&n.push(i.assignTexture(t,"map",r.baseColorTexture))}return Promise.all(n)},o.prototype.getMaterialType=function(){return No},o.prototype.extendParams=function(t,e,i){var n=[],r=e.extensions[this.name];if(void 0!==r.clearcoatFactor&&(t.clearcoat=r.clearcoatFactor),void 0!==r.clearcoatTexture&&n.push(i.assignTexture(t,"clearcoatMap",r.clearcoatTexture)),void 0!==r.clearcoatRoughnessFactor&&(t.clearcoatRoughness=r.clearcoatRoughnessFactor),void 0!==r.clearcoatRoughnessTexture&&n.push(i.assignTexture(t,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),void 0!==r.clearcoatNormalTexture&&(n.push(i.assignTexture(t,"clearcoatNormalMap",r.clearcoatNormalTexture)),void 0!==r.clearcoatNormalTexture.scale)){var a=r.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new m(a,a)}return Promise.all(n)};var s="glTF",h=1313821514,c=5130562;function l(t){this.name=i.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,12);if(this.header={magic:th(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var n=new DataView(t,12),r=0;r<n.byteLength;){var a=n.getUint32(r,!0);r+=4;var o=n.getUint32(r,!0);if(r+=4,o===h){var l=new Uint8Array(t,12+r,a);this.content=th(l)}else if(o===c){var u=12+r;this.body=t.slice(u,u+a)}r+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function u(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=i.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}function d(){this.name=i.KHR_TEXTURE_TRANSFORM}function p(t){Do.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var e=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),i=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),n=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),r=["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"),a=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),o={specular:{value:(new jt).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(t){for(var s in o)t.uniforms[s]=o[s];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),t.fragmentShader=t.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),t.fragmentShader=t.fragmentShader.replace("#include <roughnessmap_pars_fragment>",e),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_pars_fragment>",i),t.fragmentShader=t.fragmentShader.replace("#include <roughnessmap_fragment>",n),t.fragmentShader=t.fragmentShader.replace("#include <metalnessmap_fragment>",r),t.fragmentShader=t.fragmentShader.replace("#include <lights_physical_fragment>",a)},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}},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_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function g(){return{name:i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return p},extendParams:function(t,e,i){var n=e.extensions[this.name];t.color=new jt(1,1,1),t.opacity=1;var r=[];if(Array.isArray(n.diffuseFactor)){var a=n.diffuseFactor;t.color.fromArray(a),t.opacity=a[3]}if(void 0!==n.diffuseTexture&&r.push(i.assignTexture(t,"map",n.diffuseTexture)),t.emissive=new jt(0,0,0),t.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,t.specular=new jt(1,1,1),Array.isArray(n.specularFactor)&&t.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var o=n.specularGlossinessTexture;r.push(i.assignTexture(t,"glossinessMap",o)),r.push(i.assignTexture(t,"specularMap",o))}return Promise.all(r)},createMaterial:function(t){var e=new p(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=1,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=0,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.refractionRatio=.98,e}}}function v(){this.name=i.KHR_MESH_QUANTIZATION}function y(t,e,i,n){Vo.call(this,t,e,i,n)}u.prototype.decodePrimitive=function(t,e){var i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,a=t.extensions[this.name].attributes,o={},s={},h={};for(var c in a){var l=R[c]||c.toLowerCase();o[l]=a[c]}for(c in t.attributes){l=R[c]||c.toLowerCase();if(void 0!==a[c]){var u=i.accessors[t.attributes[c]],d=A[u.componentType];h[l]=d,s[l]=!0===u.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){n.decodeDracoFile(t,(function(t){for(var i in t.attributes){var n=t.attributes[i],r=s[i];void 0!==r&&(n.normalized=r)}e(t)}),o,h)}))}))},d.prototype.extendTexture=function(t,e){return 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),void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},p.prototype=Object.create(Do.prototype),p.prototype.constructor=p,p.prototype.copy=function(t){return Do.prototype.copy.call(this,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},y.prototype=Object.create(Vo.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n,a=0;a!==n;a++)e[a]=i[r+a];return e},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(t,e,i,n){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,h=3*o,c=n-e,l=(i-e)/c,u=l*l,d=u*l,p=t*h,f=p-h,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+l,x=0;x!==o;x++){var b=a[f+x+o],_=a[f+x+s]*c,w=a[p+x+o],M=a[p+x]*c;r[x]=v*b+y*_+m*w+g*M}return r};var x=0,b=1,_=2,w=3,M=4,S=5,T=6,A={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},P={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},C={33071:1001,33648:1002,10497:1e3},L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={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"},O={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},N="OPAQUE",k="MASK",F="BLEND",G={"image/png":1023,"image/jpeg":1022};function z(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}function U(t,e,i){for(var n in i.extensions)void 0===t[n]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=i.extensions[n])}function B(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 H(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(var i=0,n=e.weights.length;i<n;i++)t.morphTargetInfluences[i]=e.weights[i];if(e.extras&&Array.isArray(e.extras.targetNames)){var r=e.extras.targetNames;if(t.morphTargetInfluences.length===r.length){t.morphTargetDictionary={};for(i=0,n=r.length;i<n;i++)t.morphTargetDictionary[r[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function j(t){for(var e="",i=Object.keys(t).sort(),n=0,r=i.length;n<r;n++)e+=i[n]+":"+t[i[n]]+";";return e}function V(t,i,n){this.json=t||{},this.extensions=i||{},this.options=n||{},this.cache=new e,this.associations=new Map,this.primitiveCache={},this.textureLoader=new ms(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new cs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function W(t,e,i){var n=e.attributes,r=[];function a(e,n){return i.getDependency("accessor",e).then((function(e){t.setAttribute(n,e)}))}for(var o in n){var s=R[o]||o.toLowerCase();s in t.attributes||r.push(a(n[o],s))}if(void 0!==e.indices&&!t.index){var h=i.getDependency("accessor",e.indices).then((function(e){t.setIndex(e)}));r.push(h)}
12return B(t,e),function(t,e,i){var n=e.attributes,r=new pt;if(void 0!==n.POSITION){var a=(p=i.json.accessors[n.POSITION]).min,o=p.max;if(void 0!==a&&void 0!==o){r.set(new E(a[0],a[1],a[2]),new E(o[0],o[1],o[2]));var s=e.targets;if(void 0!==s){for(var h=new E,c=new E,l=0,u=s.length;l<u;l++){var d=s[l];if(void 0!==d.POSITION){var p;a=(p=i.json.accessors[d.POSITION]).min,o=p.max;void 0!==a&&void 0!==o?(c.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),c.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),c.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),h.max(c)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(h)}t.boundingBox=r;var f=new gt;r.getCenter(f.center),f.radius=r.min.distanceTo(r.max)/2,t.boundingSphere=f}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(t,e,i),Promise.all(r).then((function(){return void 0!==e.targets?function(t,e,i){for(var n=!1,r=!1,a=0,o=e.length;a<o;a++){if(void 0!==(c=e[a]).POSITION&&(n=!0),void 0!==c.NORMAL&&(r=!0),n&&r)break}if(!n&&!r)return Promise.resolve(t);var s=[],h=[];for(a=0,o=e.length;a<o;a++){var c=e[a];if(n){var l=void 0!==c.POSITION?i.getDependency("accessor",c.POSITION):t.attributes.position;s.push(l)}if(r){l=void 0!==c.NORMAL?i.getDependency("accessor",c.NORMAL):t.attributes.normal;h.push(l)}}return Promise.all([Promise.all(s),Promise.all(h)]).then((function(e){var i=e[0],a=e[1];return n&&(t.morphAttributes.position=i),r&&(t.morphAttributes.normal=a),t.morphTargetsRelative=!0,t}))}(t,e.targets,i):t}))}function X(t,e){var i=t.getIndex();if(null===i){var n=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var a=0;a<r.count;a++)n.push(a);t.setIndex(n),i=t.getIndex()}var o=i.count-2,s=[];if(2===e)for(a=1;a<=o;a++)s.push(i.getX(0)),s.push(i.getX(a)),s.push(i.getX(a+1));else for(a=0;a<o;a++)a%2==0?(s.push(i.getX(a)),s.push(i.getX(a+1)),s.push(i.getX(a+2))):(s.push(i.getX(a+2)),s.push(i.getX(a+1)),s.push(i.getX(a)));s.length/3!==o&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var h=t.clone();return h.setIndex(s),h}return V.prototype.parse=function(t,e){var i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(e){var a={scene:e[0][n.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:n.asset,parser:i,userData:{}};U(r,a,n),B(a,n),t(a)})).catch(e)},V.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[],n={},r={},a=0,o=e.length;a<o;a++)for(var s=e[a].joints,h=0,c=s.length;h<c;h++)t[s[h]].isBone=!0;for(var l=0,u=t.length;l<u;l++){var d=t[l];void 0!==d.mesh&&(void 0===n[d.mesh]&&(n[d.mesh]=r[d.mesh]=0),n[d.mesh]++,void 0!==d.skin&&(i[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=n,this.json.meshUses=r},V.prototype.getDependency=function(t,e){var n=t+":"+e,r=this.cache.get(n);if(!r){switch(t){case"scene":r=this.loadScene(e);break;case"node":r=this.loadNode(e);break;case"mesh":r=this.loadMesh(e);break;case"accessor":r=this.loadAccessor(e);break;case"bufferView":r=this.loadBufferView(e);break;case"buffer":r=this.loadBuffer(e);break;case"material":r=this.loadMaterial(e);break;case"texture":r=this.loadTexture(e);break;case"skin":r=this.loadSkin(e);break;case"animation":r=this.loadAnimation(e);break;case"camera":r=this.loadCamera(e);break;case"light":r=this.extensions[i.KHR_LIGHTS_PUNCTUAL].loadLight(e);break;default:throw new Error("Unknown type: "+t)}this.cache.add(n,r)}return r},V.prototype.getDependencies=function(t){var e=this.cache.get(t);if(!e){var i=this,n=this.json[t+("mesh"===t?"es":"s")]||[];e=Promise.all(n.map((function(e,n){return i.getDependency(t,n)}))),this.cache.add(t,e)}return e},V.prototype.loadBuffer=function(t){var e=this.json.buffers[t],n=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");
vendor: 13,481 bytes, line 12
12if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[i.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(t,i){n.load(z(e.uri,r.path),t,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))}))}))},V.prototype.loadBufferView=function(t){var e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then((function(t){var i=e.byteLength||0,n=e.byteOffset||0;return t.slice(n,n+i)}))},V.prototype.loadAccessor=function(t){var e=this,i=this.json,n=this.json.accessors[t];if(void 0===n.bufferView&&void 0===n.sparse)return Promise.resolve(null);var r=[];return void 0!==n.bufferView?r.push(this.getDependency("bufferView",n.bufferView)):r.push(null),void 0!==n.sparse&&(r.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(r).then((function(t){var r,a=t[0],o=L[n.type],s=A[n.componentType],h=s.BYTES_PER_ELEMENT,c=h*o,l=n.byteOffset||0,u=void 0!==n.bufferView?i.bufferViews[n.bufferView].byteStride:void 0,d=!0===n.normalized;if(u&&u!==c){var p=Math.floor(l/u),f="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+p+":"+n.count,m=e.cache.get(f);m||(m=new lr(new s(a,p*u,n.count*u/h),u/h),e.cache.add(f,m)),r=new pr(m,o,l%u/h,d)}else r=new Qt(null===a?new s(n.count*o):new s(a,l,n.count*o),o,d);if(void 0!==n.sparse){var g=L.SCALAR,v=A[n.sparse.indices.componentType],y=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,b=new v(t[1],y,n.sparse.count*g),_=new s(t[2],x,n.sparse.count*o);null!==a&&(r=new Qt(r.array.slice(),r.itemSize,r.normalized));for(var w=0,M=b.length;w<M;w++){var S=b[w];if(r.setX(S,_[w*o]),o>=2&&r.setY(S,_[w*o+1]),o>=3&&r.setZ(S,_[w*o+2]),o>=4&&r.setW(S,_[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r}))},V.prototype.loadTexture=function(t){var e,n=this,r=this.json,a=this.options,o=this.textureLoader,s=self.URL||self.webkitURL,h=r.textures[t],c=h.extensions||{},l=(e=c[i.MSFT_TEXTURE_DDS]?r.images[c[i.MSFT_TEXTURE_DDS].source]:r.images[h.source]).uri,u=!1;return void 0!==e.bufferView&&(l=n.getDependency("bufferView",e.bufferView).then((function(t){u=!0;var i=new Blob([t],{type:e.mimeType});return l=s.createObjectURL(i)}))),Promise.resolve(l).then((function(t){var e=a.manager.getHandler(t);return e||(e=c[i.MSFT_TEXTURE_DDS]?n.extensions[i.MSFT_TEXTURE_DDS].ddsLoader:o),new Promise((function(i,n){e.load(z(t,a.path),i,void 0,n)}))})).then((function(i){!0===u&&s.revokeObjectURL(l),i.flipY=!1,h.name&&(i.name=h.name),e.mimeType in G&&(i.format=G[e.mimeType]);var a=(r.samplers||{})[h.sampler]||{};return i.magFilter=P[a.magFilter]||1006,i.minFilter=P[a.minFilter]||1008,i.wrapS=C[a.wrapS]||1e3,i.wrapT=C[a.wrapT]||1e3,n.associations.set(i,{type:"textures",index:t}),i}))},V.prototype.assignTexture=function(t,e,n){var r=this;return this.getDependency("texture",n.index).then((function(a){if(!a.isCompressedTexture)switch(e){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=1022}if(void 0===n.texCoord||0==n.texCoord||"aoMap"===e&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+e+" not yet supported."),r.extensions[i.KHR_TEXTURE_TRANSFORM]){var o=void 0!==n.extensions?n.extensions[i.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var s=r.associations.get(a);a=r.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,s)}}t[e]=a}))},V.prototype.assignFinalMaterial=function(t){var e=t.geometry,i=t.material,n=void 0!==e.attributes.tangent,r=void 0!==e.attributes.color,a=void 0===e.attributes.normal,o=!0===t.isSkinnedMesh,s=Object.keys(e.morphAttributes).length>0,h=s&&void 0!==e.morphAttributes.normal;if(t.isPoints){var c="PointsMaterial:"+i.uuid,l=this.cache.get(c);l||(l=new ra,Zt.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(c,l)),i=l}else if(t.isLine){c="LineBasicMaterial:"+i.uuid;var u=this.cache.get(c);u||(u=new Yr,Zt.prototype.copy.call(u,i),u.color.copy(i.color),this.cache.add(c,u)),i=u}if(n||r||a||o||s){c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),o&&(c+="skinning:"),n&&(c+="vertex-tangents:"),r&&(c+="vertex-colors:"),a&&(c+="flat-shading:"),s&&(c+="morph-targets:"),h&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=i.clone(),o&&(d.skinning=!0),n&&(d.vertexTangents=!0),r&&(d.vertexColors=!0),a&&(d.flatShading=!0),s&&(d.morphTargets=!0),h&&(d.morphNormals=!0),this.cache.add(c,d),this.associations.set(d,this.associations.get(i))),i=d}i.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),i.normalScale&&!n&&(i.normalScale.y=-i.normalScale.y),i.clearcoatNormalScale&&!n&&(i.clearcoatNormalScale.y=-i.clearcoatNormalScale.y),t.material=i},V.prototype.loadMaterial=function(t){var e,n=this,r=this.json,a=this.extensions,o=r.materials[t],s={},h=o.extensions||{},c=[];if(h[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var l=a[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];e=l.getMaterialType(),c.push(l.extendParams(s,o,n))}else if(h[i.KHR_MATERIALS_UNLIT]){var u=a[i.KHR_MATERIALS_UNLIT];e=u.getMaterialType(),c.push(u.extendParams(s,o,n))}else{e=Do;var d=o.pbrMetallicRoughness||{};if(s.color=new jt(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var f=d.baseColorFactor;s.color.fromArray(f),s.opacity=f[3]}void 0!==d.baseColorTexture&&c.push(n.assignTexture(s,"map",d.baseColorTexture)),s.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,s.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture)))}!0===o.doubleSided&&(s.side=2);var g=o.alphaMode||N;if(g===F?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,g===k&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&e!==Jt&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new m(1,1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&e!==Jt&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&e!==Jt&&(s.emissive=(new jt).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&e!==Jt&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture)),h[i.KHR_MATERIALS_CLEARCOAT]){var v=a[i.KHR_MATERIALS_CLEARCOAT];e=v.getMaterialType(),c.push(v.extendParams(s,{extensions:h},n))}return Promise.all(c).then((function(){var r;return r=e===p?a[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new e(s),o.name&&(r.name=o.name),r.map&&(r.map.encoding=3001),r.emissiveMap&&(r.emissiveMap.encoding=3001),B(r,o),n.associations.set(r,{type:"materials",index:t}),o.extensions&&U(a,r,o),r}))},V.prototype.loadGeometries=function(t){var e=this,n=this.extensions,r=this.primitiveCache;function a(t){return n[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return W(i,t,e)}))}for(var o,s,h=[],c=0,l=t.length;c<l;c++){var u,d=t[c],p=(s=void 0,(s=(o=d).extensions&&o.extensions[i.KHR_DRACO_MESH_COMPRESSION])?"draco:"+s.bufferView+":"+s.indices+":"+j(s.attributes):o.indices+":"+j(o.attributes)+":"+o.mode),f=r[p];if(f)h.push(f.promise);else u=d.extensions&&d.extensions[i.KHR_DRACO_MESH_COMPRESSION]?a(d):W(new ve,d,e),r[p]={primitive:d,promise:u},h.push(u)}return Promise.all(h)},V.prototype.loadMesh=function(t){for(var e,i=this,n=this.json.meshes[t],r=n.primitives,a=[],o=0,s=r.length;o<s;o++){var h=void 0===r[o].material?(void 0===(e=this.cache).DefaultMaterial&&(e.DefaultMaterial=new Do({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial):this.getDependency("material",r[o].material);a.push(h)}return a.push(i.loadGeometries(r)),Promise.all(a).then((function(e){for(var a=e.slice(0,e.length-1),o=e[e.length-1],s=[],h=0,c=o.length;h<c;h++){var l,u=o[h],d=r[h],p=a[h];if(d.mode===M||d.mode===S||d.mode===T||void 0===d.mode)!0!==(l=!0===n.isSkinnedMesh?new Fr(u,p):new Ne(u,p)).isSkinnedMesh||l.geometry.attributes.skinWeight.normalized||l.normalizeSkinWeights(),d.mode===S?l.geometry=X(l.geometry,1):d.mode===T&&(l.geometry=X(l.geometry,2));else if(d.mode===b)l=new ia(u,p);else if(d.mode===w)l=new $r(u,p);else if(d.mode===_)l=new na(u,p);else{if(d.mode!==x)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);l=new ca(u,p)}Object.keys(l.geometry.morphAttributes).length>0&&H(l,n),l.name=n.name||"mesh_"+t,o.length>1&&(l.name+="_"+h),B(l,n),i.assignFinalMaterial(l),s.push(l)}if(1===s.length)return s[0];var f=new nr;for(h=0,c=s.length;h<c;h++)f.add(s[h]);return f}))},V.prototype.loadCamera=function(t){var e,i=this.json.cameras[t],n=i[i.type];if(n)return"perspective"===i.type?e=new Ze(f.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===i.type&&(e=new Xs(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=i.name),B(e,i),Promise.resolve(e);console.warn("THREE.GLTFLoader: Missing camera parameters.")},V.prototype.loadSkin=function(t){var 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}))},V.prototype.loadAnimation=function(t){for(var e=this.json.animations[t],i=[],n=[],r=[],a=[],o=[],s=0,h=e.channels.length;s<h;s++){var c=e.channels[s],l=e.samplers[c.sampler],u=c.target,d=void 0!==u.node?u.node:u.id,p=void 0!==e.parameters?e.parameters[l.input]:l.input,f=void 0!==e.parameters?e.parameters[l.output]:l.output;i.push(this.getDependency("node",d)),n.push(this.getDependency("accessor",p)),r.push(this.getDependency("accessor",f)),a.push(l),o.push(u)}return Promise.all([Promise.all(i),Promise.all(n),Promise.all(r),Promise.all(a),Promise.all(o)]).then((function(i){for(var n=i[0],r=i[1],a=i[2],o=i[3],s=i[4],h=[],c=0,l=n.length;c<l;c++){var u=n[c],d=r[c],p=a[c],f=o[c],m=s[c];if(void 0!==u){var g;switch(u.updateMatrix(),u.matrixAutoUpdate=!0,I[m.path]){case I.weights:g=Ko;break;case I.rotation:g=$o;break;case I.position:case I.scale:default:g=es}var v=u.name?u.name:u.uuid,x=void 0!==f.interpolation?O[f.interpolation]:2301,b=[];I[m.path]===I.weights?u.traverse((function(t){!0===t.isMesh&&t.morphTargetInfluences&&b.push(t.name?t.name:t.uuid)})):b.push(v);var _=p.array;if(p.normalized){var w;if(_.constructor===Int8Array)w=1/127;else if(_.constructor===Uint8Array)w=1/255;else if(_.constructor==Int16Array)w=1/32767;else{if(_.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");w=1/65535}for(var M=new Float32Array(_.length),S=0,T=_.length;S<T;S++)M[S]=_[S]*w;_=M}for(S=0,T=b.length;S<T;S++){var E=new g(b[S]+"."+I[m.path],d.array,_,x);"CUBICSPLINE"===f.interpolation&&(E.createInterpolant=function(t){return new y(this.times,this.values,this.getValueSize()/3,t)},E.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),h.push(E)}}}return new is(e.name?e.name:"animation_"+t,void 0,h)}))},V.prototype.loadNode=function(t){var e,n=this.json,r=this.extensions,a=this,o=n.meshReferences,s=n.meshUses,h=n.nodes[t];return(e=[],void 0!==h.mesh&&e.push(a.getDependency("mesh",h.mesh).then((function(t){var e;if(o[h.mesh]>1){var i=s[h.mesh]++;(e=t.clone()).name+="_instance_"+i}else e=t;return void 0!==h.weights&&e.traverse((function(t){if(t.isMesh)for(var e=0,i=h.weights.length;e<i;e++)t.morphTargetInfluences[e]=h.weights[e]})),e}))),void 0!==h.camera&&e.push(a.getDependency("camera",h.camera)),h.extensions&&h.extensions[i.KHR_LIGHTS_PUNCTUAL]&&void 0!==h.extensions[i.KHR_LIGHTS_PUNCTUAL].light&&e.push(a.getDependency("light",h.extensions[i.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(e)).then((function(e){var i;if((i=!0===h.isBone?new Br:e.length>1?new nr:1===e.length?e[0]:new Q)!==e[0])for(var n=0,o=e.length;n<o;n++)i.add(e[n]);if(h.name&&(i.userData.name=h.name,i.name=Wh.sanitizeNodeName(h.name)),B(i,h),h.extensions&&U(r,i,h),void 0!==h.matrix){var s=new D;s.fromArray(h.matrix),i.applyMatrix4(s)}else void 0!==h.translation&&i.position.fromArray(h.translation),void 0!==h.rotation&&i.quaternion.fromArray(h.rotation),void 0!==h.scale&&i.scale.fromArray(h.scale);return a.associations.set(i,{type:"nodes",index:t}),i}))},V.prototype.loadScene=function(){function t(e,i,n,r){var a=n.nodes[e];return r.getDependency("node",e).then((function(t){return void 0===a.skin?t:r.getDependency("skin",a.skin).then((function(t){for(var i=[],n=0,a=(e=t).joints.length;n<a;n++)i.push(r.getDependency("node",e.joints[n]));return Promise.all(i)})).then((function(i){return t.traverse((function(t){if(t.isMesh){for(var n=[],r=[],a=0,o=i.length;a<o;a++){var s=i[a];if(s){n.push(s);var h=new D;void 0!==e.inverseBindMatrices&&h.fromArray(e.inverseBindMatrices.array,16*a),r.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[a])}t.bind(new Ur(n,r),t.matrixWorld)}})),t}));var e})).then((function(e){i.add(e);var o=[];if(a.children)for(var s=a.children,h=0,c=s.length;h<c;h++){var l=s[h];o.push(t(l,e,n,r))}return Promise.all(o)}))}return function(e){var i=this.json,n=this.extensions,r=this.json.scenes[e],a=new nr;r.name&&(a.name=r.name),B(a,r),r.extensions&&U(n,a,r);
12for(var o=r.nodes||[],s=[],h=0,c=o.length;h<c;h++)s.push(t(o[h],a,i,this));return Promise.all(s).then((function(){return a}))}}(),t}(),rl=function(t){ss.call(this,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"}};rl.prototype=Object.assign(Object.create(ss.prototype),{constructor:rl,setDecoderPath:function(t){return this.decoderPath=t,this},setDecoderConfig:function(t){return this.decoderConfig=t,this},setWorkerLimit:function(t){return this.workerLimit=t,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(t,e,i,n){var r=new cs(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&r.setWithCredentials(!0),r.load(t,t=>{var i={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(t,i).then(e).catch(n)},i,n)},decodeDracoFile:function(t,e,i,n){var r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(t,r).then(e)},decodeGeometry:function(t,e){for(var i in e.attributeTypes){var n=e.attributeTypes[i];void 0!==n.BYTES_PER_ELEMENT&&(e.attributeTypes[i]=n.name)}var r,a=JSON.stringify(e);if(rl.taskCache.has(t)){var o=rl.taskCache.get(t);if(o.key===a)return o.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var s=this.workerNextTaskID++,h=t.byteLength,c=this._getWorker(s,h).then(i=>(r=i,new Promise((i,n)=>{r._callbacks[s]={resolve:i,reject:n},r.postMessage({type:"decode",id:s,taskConfig:e,buffer:t},[t])}))).then(t=>this._createGeometry(t.geometry));return c.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),rl.taskCache.set(t,{key:a,promise:c}),c},_createGeometry:function(t){var e=new ve;t.index&&e.setIndex(new Qt(t.index.array,1));for(var i=0;i<t.attributes.length;i++){var n=t.attributes[i],r=n.name,a=n.array,o=n.itemSize;e.setAttribute(r,new Qt(a,o))}return e},_loadLibrary:function(t,e){var i=new cs(this.manager);return i.setPath(this.decoderPath),i.setResponseType(e),new Promise((e,n)=>{i.load(t,e,void 0,n)})},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var 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=>{var i=e[0];t||(this.decoderConfig.wasmBinary=e[1]);var n=rl.DRACOWorker.toString(),r=["/* draco decoder */",i,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))}),this.decoderPending},_getWorker:function(t,e){return this._initDecoder().then(()=>{var i;this.workerPool.length<this.workerLimit?((i=new Worker(this.workerSourceURL))._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(t){var e=t.data;switch(e.type){case"decode":i._callbacks[e.id].resolve(e);break;case"error":i._callbacks[e.id].reject(e);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+e.type+'"')}},this.workerPool.push(i)):this.workerPool.sort((function(t,e){return t._taskLoad>e._taskLoad?-1:1}));return(i=this.workerPool[this.workerPool.length-1])._taskCosts[t]=e,i._taskLoad+=e,i})},_releaseTask:function(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]},debug:function(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))},dispose:function(){for(var t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this}}),rl.DRACOWorker=function(){var t,e;function i(t,e,i,n,r,a){var o,s,h=a.num_components(),c=i.num_points()*h;switch(r){case Float32Array:o=new t.DracoFloat32Array,e.GetAttributeFloatForAllPoints(i,a,o),s=new Float32Array(c);break;case Int8Array:o=new t.DracoInt8Array,e.GetAttributeInt8ForAllPoints(i,a,o),s=new Int8Array(c);break;case Int16Array:o=new t.DracoInt16Array,e.GetAttributeInt16ForAllPoints(i,a,o),s=new Int16Array(c);break;case Int32Array:o=new t.DracoInt32Array,e.GetAttributeInt32ForAllPoints(i,a,o),s=new Int32Array(c);break;case Uint8Array:o=new t.DracoUInt8Array,e.GetAttributeUInt8ForAllPoints(i,a,o),s=new Uint8Array(c);break;case Uint16Array:o=new t.DracoUInt16Array,e.GetAttributeUInt16ForAllPoints(i,a,o),s=new Uint16Array(c);break;case Uint32Array:o=new t.DracoUInt32Array,e.GetAttributeUInt32ForAllPoints(i,a,o),s=new Uint32Array(c);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var l=0;l<c;l++)s[l]=o.GetValue(l);return t.destroy(o),{name:n,array:s,itemSize:h}}onmessage=function(n){var r=n.data;switch(r.type){case"init":t=r.decoderConfig,e=new Promise((function(e){t.onModuleLoaded=function(t){e({draco:t})},DracoDecoderModule(t)}));break;case"decode":var a=r.buffer,o=r.taskConfig;e.then(t=>{var e=t.draco,n=new e.Decoder,s=new e.DecoderBuffer;s.Init(new Int8Array(a),a.byteLength);try{var h=function(t,e,n,r){var a,o,s=r.attributeIDs,h=r.attributeTypes,c=e.GetEncodedGeometryType(n);if(c===t.TRIANGULAR_MESH)a=new t.Mesh,o=e.DecodeBufferToMesh(n,a);else{if(c!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new t.PointCloud,o=e.DecodeBufferToPointCloud(n,a)}if(!o.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());var l={index:null,attributes:[]};for(var u in s){var d,p,f=self[h[u]];if(r.useUniqueIDs)p=s[u],d=e.GetAttributeByUniqueId(a,p);else{if(-1===(p=e.GetAttributeId(a,t[s[u]])))continue;d=e.GetAttribute(a,p)}l.attributes.push(i(t,e,a,u,f,d))}if(c===t.TRIANGULAR_MESH){for(var m=a.num_faces(),g=new Uint32Array(3*m),v=new t.DracoInt32Array,y=0;y<m;++y){e.GetFaceFromMesh(a,y,v);for(var x=0;x<3;++x)g[3*y+x]=v.GetValue(x)}l.index={array:g,itemSize:1},t.destroy(v)}return t.destroy(a),l}(e,n,s,o),c=h.attributes.map(t=>t.array.buffer);h.index&&c.push(h.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:h},c)}catch(t){console.error(t),self.postMessage({type:"error",id:r.id,error:t.message})}finally{e.destroy(s),e.destroy(n)}})}}},rl.taskCache=new WeakMap,rl.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},rl.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},rl.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},rl.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var al=function(t,e){var i,l,u,d,p;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new E,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LE
vendor: 8,124 bytes, line 12
12FT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n,MIDDLE:r,RIGHT:a},this.touches={ONE:o,TWO:h},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return w.phi},this.getAzimuthalAngle=function(){return w.theta},this.saveState=function(){f.target0.copy(f.target),f.position0.copy(f.object.position),f.zoom0=f.object.zoom},this.reset=function(){f.target.copy(f.target0),f.object.position.copy(f.position0),f.object.zoom=f.zoom0,f.object.updateProjectionMatrix(),f.dispatchEvent(g),f.update(),b=x.NONE},this.update=(i=new E,l=(new M).setFromUnitVectors(t.up,new E(0,1,0)),u=l.clone().inverse(),d=new E,p=new M,function(){var t=f.object.position;return i.copy(t).sub(f.target),i.applyQuaternion(l),w.setFromVector3(i),f.autoRotate&&b===x.NONE&&z(2*Math.PI/60/60*f.autoRotateSpeed),f.enableDamping?(w.theta+=S.theta*f.dampingFactor,w.phi+=S.phi*f.dampingFactor):(w.theta+=S.theta,w.phi+=S.phi),w.theta=Math.max(f.minAzimuthAngle,Math.min(f.maxAzimuthAngle,w.theta)),w.phi=Math.max(f.minPolarAngle,Math.min(f.maxPolarAngle,w.phi)),w.makeSafe(),w.radius*=T,w.radius=Math.max(f.minDistance,Math.min(f.maxDistance,w.radius)),!0===f.enableDamping?f.target.addScaledVector(A,f.dampingFactor):f.target.add(A),i.setFromSpherical(w),i.applyQuaternion(u),t.copy(f.target).add(i),f.object.lookAt(f.target),!0===f.enableDamping?(S.theta*=1-f.dampingFactor,S.phi*=1-f.dampingFactor,A.multiplyScalar(1-f.dampingFactor)):(S.set(0,0,0),A.set(0,0,0)),T=1,!!(P||d.distanceToSquared(f.object.position)>_||8*(1-p.dot(f.object.quaternion))>_)&&(f.dispatchEvent(g),d.copy(f.object.position),p.copy(f.object.quaternion),P=!1,!0)}),this.dispose=function(){f.domElement.removeEventListener("contextmenu",ct,!1),f.domElement.removeEventListener("mousedown",et,!1),f.domElement.removeEventListener("wheel",rt,!1),f.domElement.removeEventListener("touchstart",ot,!1),f.domElement.removeEventListener("touchend",ht,!1),f.domElement.removeEventListener("touchmove",st,!1),document.removeEventListener("mousemove",it,!1),document.removeEventListener("mouseup",nt,!1),f.domElement.removeEventListener("keydown",at,!1)};var f=this,g={type:"change"},v={type:"start"},y={type:"end"},x={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},b=x.NONE,_=1e-6,w=new $h,S=new $h,T=1,A=new E,P=!1,C=new m,L=new m,R=new m,I=new m,O=new m,D=new m,N=new m,k=new m,F=new m;function G(){return Math.pow(.95,f.zoomSpeed)}function z(t){S.theta-=t}function U(t){S.phi-=t}var B,H=(B=new E,function(t,e){B.setFromMatrixColumn(e,0),B.multiplyScalar(-t),A.add(B)}),j=function(){var t=new E;return function(e,i){!0===f.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(f.object.up,t)),t.multiplyScalar(e),A.add(t)}}(),V=function(){var t=new E;return function(e,i){var n=f.domElement;if(f.object.isPerspectiveCamera){var r=f.object.position;t.copy(r).sub(f.target);var a=t.length();a*=Math.tan(f.object.fov/2*Math.PI/180),H(2*e*a/n.clientHeight,f.object.matrix),j(2*i*a/n.clientHeight,f.object.matrix)}else f.object.isOrthographicCamera?(H(e*(f.object.right-f.object.left)/f.object.zoom/n.clientWidth,f.object.matrix),j(i*(f.object.top-f.object.bottom)/f.object.zoom/n.clientHeight,f.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),f.enablePan=!1)}}();function W(t){f.object.isPerspectiveCamera?T/=t:f.object.isOrthographicCamera?(f.object.zoom=Math.max(f.minZoom,Math.min(f.maxZoom,f.object.zoom*t)),f.object.updateProjectionMatrix(),P=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),f.enableZoom=!1)}function X(t){f.object.isPerspectiveCamera?T*=t:f.object.isOrthographicCamera?(f.object.zoom=Math.max(f.minZoom,Math.min(f.maxZoom,f.object.zoom/t)),f.object.updateProjectionMatrix(),P=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),f.enableZoom=!1)}function Y(t){C.set(t.clientX,t.clientY)}function q(t){I.set(t.clientX,t.clientY)}function Z(t){if(1==t.touches.length)C.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);C.set(e,i)}}function J(t){if(1==t.touches.length)I.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);I.set(e,i)}}function K(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);N.set(0,n)}function Q(t){if(1==t.touches.length)L.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);L.set(e,i)}R.subVectors(L,C).multiplyScalar(f.rotateSpeed);var n=f.domElement;z(2*Math.PI*R.x/n.clientHeight),U(2*Math.PI*R.y/n.clientHeight),C.copy(L)}function $(t){if(1==t.touches.length)O.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);O.set(e,i)}D.subVectors(O,I).multiplyScalar(f.panSpeed),V(D.x,D.y),I.copy(O)}function tt(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);k.set(0,n),F.set(0,Math.pow(k.y/N.y,f.zoomSpeed)),W(F.y),N.copy(k)}function et(t){if(!1!==f.enabled){var e;switch(t.preventDefault(),f.domElement.focus?f.domElement.focus():window.focus(),t.button){case 0:e=f.mouseButtons.LEFT;break;case 1:e=f.mouseButtons.MIDDLE;break;case 2:e=f.mouseButtons.RIGHT;break;default:e=-1}switch(e){case r:if(!1===f.enableZoom)return;!function(t){N.set(t.clientX,t.clientY)}(t),b=x.DOLLY;break;case n:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===f.enablePan)return;q(t),b=x.PAN}else{if(!1===f.enableRotate)return;Y(t),b=x.ROTATE}break;case a:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===f.enableRotate)return;Y(t),b=x.ROTATE}else{if(!1===f.enablePan)return;q(t),b=x.PAN}break;default:b=x.NONE}b!==x.NONE&&(document.addEventListener("mousemove",it,!1),document.addEventListener("mouseup",nt,!1),f.dispatchEvent(v))}}function it(t){if(!1!==f.enabled)switch(t.preventDefault(),b){case x.ROTATE:if(!1===f.enableRotate)return;!function(t){L.set(t.clientX,t.clientY),R.subVectors(L,C).multiplyScalar(f.rotateSpeed);var e=f.domElement;z(2*Math.PI*R.x/e.clientHeight),U(2*Math.PI*R.y/e.clientHeight),C.copy(L),f.update()}(t);break;case x.DOLLY:if(!1===f.enableZoom)return;!function(t){k.set(t.clientX,t.clientY),F.subVectors(k,N),F.y>0?W(G()):F.y<0&&X(G()),N.copy(k),f.update()}(t);break;case x.PAN:if(!1===f.enablePan)return;!function(t){O.set(t.clientX,t.clientY),D.subVectors(O,I).multiplyScalar(f.panSpeed),V(D.x,D.y),I.copy(O),f.update()}(t)}}function nt(t){!1!==f.enabled&&(document.removeEventListener("mousemove",it,!1),document.removeEventListener("mouseup",nt,!1),f.dispatchEvent(y),b=x.NONE)}function rt(t){!1===f.enabled||!1===f.enableZoom||b!==x.NONE&&b!==x.ROTATE||(t.preventDefault(),t.stopPropagation(),f.dispatchEvent(v),function(t){t.deltaY<0?X(G()):t.deltaY>0&&W(G()),f.update()}(t),f.dispatchEvent(y))}function at(t){!1!==f.enabled&&!1!==f.enableKeys&&!1!==f.enablePan&&function(t){var e=!1;switch(t.keyCode){case f.keys.UP:V(0,f.keyPanSpeed),e=!0;break;case f.keys.BOTTOM:V(0,-f.keyPanSpeed),e=!0;break;case f.keys.LEFT:V(f.keyPanSpeed,0),e=!0;break;case f.keys.RIGHT:V(-f.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),f.update())}(t)}function ot(t){if(!1!==f.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(f.touches.ONE){case o:if(!1===f.enableRotate)return;Z(t),b=x.TOUCH_ROTATE;break;case s:if(!1===f.enablePan)return;J(t),b=x.TOUCH_PAN;break;default:b=x.NONE}break;case 2:switch(f.touches.TWO){case h:if(!1===f.enableZoom&&!1===f.enablePan)return;!function(t){f.enableZoom&&K(t),f.enablePan&&J(t)}(t),b=x.TOUCH_DOLLY_PAN;break;case c:if(!1===f.enableZoom&&!1===f.enableRotate)return;!function(t){f.enableZoom&&K(t),f.enableRotate&&Z(t)}(t),b=x.TOUCH_DOLLY_ROTATE;break;default:b=x.NONE}break;default:b=x.NONE}
12b!==x.NONE&&f.dispatchEvent(v)}}function st(t){if(!1!==f.enabled)switch(t.preventDefault(),t.stopPropagation(),b){case x.TOUCH_ROTATE:if(!1===f.enableRotate)return;Q(t),f.update();break;case x.TOUCH_PAN:if(!1===f.enablePan)return;$(t),f.update();break;case x.TOUCH_DOLLY_PAN:if(!1===f.enableZoom&&!1===f.enablePan)return;!function(t){f.enableZoom&&tt(t),f.enablePan&&$(t)}(t),f.update();break;case x.TOUCH_DOLLY_ROTATE:if(!1===f.enableZoom&&!1===f.enableRotate)return;!function(t){f.enableZoom&&tt(t),f.enableRotate&&Q(t)}(t),f.update();break;default:b=x.NONE}}function ht(t){!1!==f.enabled&&(f.dispatchEvent(y),b=x.NONE)}function ct(t){!1!==f.enabled&&t.preventDefault()}f.domElement.addEventListener("contextmenu",ct,!1),f.domElement.addEventListener("mousedown",et,!1),f.domElement.addEventListener("wheel",rt,!1),f.domElement.addEventListener("touchstart",ot,!1),f.domElement.addEventListener("touchend",ht,!1),f.domElement.addEventListener("touchmove",st,!1),f.domElement.addEventListener("keydown",at,!1),-1===f.domElement.tabIndex&&(f.domElement.tabIndex=0),this.update()};(al.prototype=Object.create(l.prototype)).constructor=al;var ol=function(t,e){al.call(this,t,e),this.mouseButtons.LEFT=a,this.mouseButtons.RIGHT=n,this.touches.ONE=s,this.touches.TWO=c};(ol.prototype=Object.create(l.prototype)).constructor=ol;var sl=function(t,e){void 0===e&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),Q.call(this),this.visible=!1,this.domElement=e;var i=new hl;this.add(i);var n=new cl;this.add(n);var r=this;H("camera",t),H("object",void 0),H("enabled",!0),H("axis",null),H("mode","translate"),H("translationSnap",null),H("rotationSnap",null),H("scaleSnap",null),H("space","world"),H("size",1),H("dragging",!1),H("showX",!0),H("showY",!0),H("showZ",!0);var a={type:"change"},o={type:"mouseDown"},s={type:"mouseUp",mode:r.mode},h={type:"objectChange"},c=new Jh;function l(t,e,i){for(var n=e.intersectObject(t,!0),r=0;r<n.length;r++)if(n[r].object.visible||i)return n[r];return!1}var u=new E,d=new E,p=new M,f={X:new E(1,0,0),Y:new E(0,1,0),Z:new E(0,0,1)},m=new E,g=new E,v=new E,y=new E,x=new E,b=new E,_=0,w=new E,S=new M,T=new E,A=new E,P=new M,C=new M,L=new E,R=new E,I=new M,O=new E,D=new E,N=new M,k=new M,F=new E,G=new E,z=new E,U=new M,B=new E;function H(t,e){var o=e;Object.defineProperty(r,t,{get:function(){return void 0!==o?o:e},set:function(e){o!==e&&(o=e,n[t]=e,i[t]=e,r.dispatchEvent({type:t+"-changed",value:e}),r.dispatchEvent(a))}}),r[t]=e,n[t]=e,i[t]=e}function j(t){if(document.pointerLockElement)return{x:0,y:0,button:t.button};var i=t.changedTouches?t.changedTouches[0]:t,n=e.getBoundingClientRect();return{x:(i.clientX-n.left)/n.width*2-1,y:-(i.clientY-n.top)/n.height*2+1,button:t.button}}function V(t){r.enabled&&r.pointerHover(j(t))}function W(t){r.enabled&&(document.addEventListener("mousemove",X,!1),r.pointerHover(j(t)),r.pointerDown(j(t)))}function X(t){r.enabled&&r.pointerMove(j(t))}function Y(t){r.enabled&&(document.removeEventListener("mousemove",X,!1),r.pointerUp(j(t)))}H("worldPosition",D),H("worldPositionStart",R),H("worldQuaternion",N),H("worldQuaternionStart",I),H("cameraPosition",w),H("cameraQuaternion",S),H("pointStart",m),H("pointEnd",g),H("rotationAxis",y),H("rotationAngle",_),H("eye",G),e.addEventListener("mousedown",W,!1),e.addEventListener("touchstart",W,!1),e.addEventListener("mousemove",V,!1),e.addEventListener("touchmove",V,!1),e.addEventListener("touchmove",X,!1),document.addEventListener("mouseup",Y,!1),e.addEventListener("touchend",Y,!1),e.addEventListener("touchcancel",Y,!1),e.addEventListener("touchleave",Y,!1),this.dispose=function(){e.removeEventListener("mousedown",W),e.removeEventListener("touchstart",W),e.removeEventListener("mousemove",V),document.removeEventListener("mousemove",X),e.removeEventListener("touchmove",V),e.removeEventListener("touchmove",X),document.removeEventListener("mouseup",Y),e.removeEventListener("touchend",Y),e.removeEventListener("touchcancel",Y),e.removeEventListener("touchleave",Y),this.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}))},this.attach=function(t){return this.object=t,this.visible=!0,this},this.detach=function(){return this.object=void 0,this.visible=!1,this.axis=null,this},this.updateMatrixWorld=function(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?c
12onsole.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(A,P,L),this.object.matrixWorld.decompose(D,N,F),C.copy(P).inverse(),k.copy(N).inverse()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(w,S,T),G.copy(w).sub(D).normalize(),Q.prototype.updateMatrixWorld.call(this)},this.pointerHover=function(t){if(void 0!==this.object&&!0!==this.dragging&&(void 0===t.button||0===t.button)){c.setFromCamera(t,this.camera);var e=l(i.picker[this.mode],c);this.axis=e?e.object.name:null}},this.pointerDown=function(t){if(!(void 0===this.object||!0===this.dragging||void 0!==t.button&&0!==t.button||0!==t.button&&void 0!==t.button||null===this.axis)){c.setFromCamera(t,this.camera);var e=l(n,c,!0);if(e){var i=this.space;if("scale"===this.mode?i="local":"E"!==this.axis&&"XYZE"!==this.axis&&"XYZ"!==this.axis||(i="world"),"local"===i&&"rotate"===this.mode){var r=this.rotationSnap;"X"===this.axis&&r&&(this.object.rotation.x=Math.round(this.object.rotation.x/r)*r),"Y"===this.axis&&r&&(this.object.rotation.y=Math.round(this.object.rotation.y/r)*r),"Z"===this.axis&&r&&(this.object.rotation.z=Math.round(this.object.rotation.z/r)*r)}this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),z.copy(this.object.position),U.copy(this.object.quaternion),B.copy(this.object.scale),this.object.matrixWorld.decompose(R,I,O),m.copy(e.point).sub(R)}this.dragging=!0,o.mode=this.mode,this.dispatchEvent(o)}},this.pointerMove=function(t){var e=this.axis,i=this.mode,r=this.object,o=this.space;if("scale"===i?o="local":"E"!==e&&"XYZE"!==e&&"XYZ"!==e||(o="world"),void 0!==r&&null!==e&&!1!==this.dragging&&(void 0===t.button||0===t.button)){c.setFromCamera(t,this.camera);
12var s=l(n,c,!0);if(s){if(g.copy(s.point).sub(R),"translate"===i)v.copy(g).sub(m),"local"===o&&"XYZ"!==e&&v.applyQuaternion(k),-1===e.indexOf("X")&&(v.x=0),-1===e.indexOf("Y")&&(v.y=0),-1===e.indexOf("Z")&&(v.z=0),"local"===o&&"XYZ"!==e?v.applyQuaternion(U).divide(L):v.applyQuaternion(C).divide(L),r.position.copy(v).add(z),this.translationSnap&&("local"===o&&(r.position.applyQuaternion(p.copy(U).inverse()),-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(U)),"world"===o&&(r.parent&&r.position.add(u.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(u.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===i){if(-1!==e.search("XYZ")){var w=g.length()/m.length();g.dot(m)<0&&(w*=-1),d.set(w,w,w)}else u.copy(m),d.copy(g),u.applyQuaternion(k),d.applyQuaternion(k),d.divide(u),-1===e.search("X")&&(d.x=1),-1===e.search("Y")&&(d.y=1),-1===e.search("Z")&&(d.z=1);r.scale.copy(B).multiply(d),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){v.copy(g).sub(m);var M=20/D.distanceTo(u.setFromMatrixPosition(this.camera.matrixWorld));"E"===e?(y.copy(G),_=g.angleTo(m),x.copy(m).normalize(),b.copy(g).normalize(),_*=b.cross(x).dot(G)<0?1:-1):"XYZE"===e?(y.copy(v).cross(G).normalize(),_=v.dot(u.copy(y).cross(this.eye))*M):"X"!==e&&"Y"!==e&&"Z"!==e||(y.copy(f[e]),u.copy(f[e]),"local"===o&&u.applyQuaternion(N),_=v.dot(u.cross(G).normalize())*M),this.rotationSnap&&(_=Math.round(_/this.rotationSnap)*this.rotationSnap),this.rotationAngle=_,"local"===o&&"E"!==e&&"XYZE"!==e?(r.quaternion.copy(U),r.quaternion.multiply(p.setFromAxisAngle(y,_)).normalize()):(y.applyQuaternion(C),r.quaternion.copy(p.setFromAxisAngle(y,_)),r.quaternion.multiply(U).normalize())}this.dispatchEvent(a),this.dispatchEvent(h)}}},this.pointerUp=function(t){void 0!==t.button&&0!==t.button||(this.dragging&&null!==this.axis&&(s.mode=this.mode,this.dispatchEvent(s)),this.dragging=!1,void 0===t.button&&(this.axis=null))},this.getMode=function(){return r.mode},this.setMode=function(t){r.mode=t},this.setTranslationSnap=function(t){r.translationSnap=t},this.setRotationSnap=function(t){r.rotationSnap=t},this.setScaleSnap=function(t){r.scaleSnap=t},this.setSize=function(t){r.size=t},this.setSpace=function(t){r.space=t},this.update=function(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}};sl.prototype=Object.assign(Object.create(Q.prototype),{constructor:sl,isTransformControls:!0});var hl=function(){Q.call(this),this.type="TransformControlsGizmo";var t=new Jt({depthTest:!1,depthWrite:!1,transparent:!0,side:2,fog:!1}),e=new Yr({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1}),i=t.clone();i.opacity=.15;var n=t.clone();n.opacity=.33;var r=t.clone();r.color.set(16711680);var a=t.clone();a.color.set(65280);var o=t.clone();o.color.set(255);var s=t.clone();s.opacity=.25;var h=s.clone();h.color.set(16776960);var c=s.clone();c.color.set(65535);var l=s.clone();l.color.set(16711935),t.clone().color.set(16776960);var u=e.clone();u.color.set(16711680);var d=e.clone();d.color.set(65280);var p=e.clone();p.color.set(255);var f=e.clone();f.color.set(65535);var m=e.clone();m.color.set(16711935);var g=e.clone();g.color.set(16776960);var v=e.clone();v.color.set(7895160);var y=g.clone();y.opacity=.25;var x=new Eo(0,.05,.2,12,1,!1),b=new je(.125,.125,.125),_=new ve;_.setAttribute("position",new oe([0,0,0,1,0,0],3));var w,S=function(t,e){for(var i=new ve,n=[],r=0;r<=64*e;++r)n.push(0,Math.cos(r/32*Math.PI)*t,Math.sin(r/32*Math.PI)*t);return i.setAttribute("position",new oe(n,3)),i}
12,T={X:[[new Ne(x,r),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new Ne(x,r),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new $r(_,u)]],Y:[[new Ne(x,a),[0,1,0],null,null,"fwd"],[new Ne(x,a),[0,1,0],[Math.PI,0,0],null,"bwd"],[new $r(_,d),null,[0,0,Math.PI/2]]],Z:[[new Ne(x,o),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new Ne(x,o),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new $r(_,p),null,[0,-Math.PI/2,0]]],XYZ:[[new Ne(new Ma(.1,0),s.clone()),[0,0,0],[0,0,0]]],XY:[[new Ne(new oi(.295,.295),h.clone()),[.15,.15,0]],[new $r(_,g),[.18,.3,0],null,[.125,1,1]],[new $r(_,g),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ne(new oi(.295,.295),c.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new $r(_,f),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new $r(_,f),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ne(new oi(.295,.295),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new $r(_,m),[.18,0,.3],null,[.125,1,1]],[new $r(_,m),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},A={X:[[new Ne(new Eo(.2,0,1,4,1,!1),i),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new Ne(new Eo(.2,0,1,4,1,!1),i),[0,.6,0]]],Z:[[new Ne(new Eo(.2,0,1,4,1,!1),i),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new Ne(new Ma(.2,0),i)]],XY:[[new Ne(new oi(.4,.4),i),[.2,.2,0]]],YZ:[[new Ne(new oi(.4,.4),i),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new Ne(new oi(.4,.4),i),[.2,0,.2],[-Math.PI/2,0,0]]]},P={START:[[new Ne(new Ma(.01,2),n),null,null,null,"helper"]],END:[[new Ne(new Ma(.01,2),n),null,null,null,"helper"]],DELTA:[[new $r((w=new ve,w.setAttribute("position",new oe([0,0,0,1,1,1],3)),w),n),null,null,null,"helper"]],X:[[new $r(_,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new $r(_,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new $r(_,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},C={X:[[new $r(S(1,.5),u)],[new Ne(new Ma(.04,0),r),[0,0,.99],null,[1,3,1]]],Y:[[new $r(S(1,.5),d),null,[0,0,-Math.PI/2]],[new Ne(new Ma(.04,0),a),[0,0,.99],null,[3,1,1]]],Z:[[new $r(S(1,.5),p),null,[0,Math.PI/2,0]],[new Ne(new Ma(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new $r(S(1.25,1),y),null,[0,Math.PI/2,0]],[new Ne(new Eo(.03,0,.15,4,1,!1),y),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new Ne(new Eo(.03,0,.15,4,1,!1),y),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new Ne(new Eo(.03,0,.15,4,1,!1),y),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new Ne(new Eo(.03,0,.15,4,1,!1),y),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new $r(S(1,1),v),null,[0,Math.PI/2,0]]]},L={AXIS:[[new $r(_,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},R={X:[[new Ne(new Oa(1,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Ne(new Oa(1,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Ne(new Oa(1,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Ne(new Oa(1.25,.1,2,24),i)]],XYZE:[[new Ne(new go(.7,10,8),i)]]},I={X:[[new Ne(b,r),[.8,0,0],[0,0,-Math.PI/2]],[new $r(_,u),null,null,[.8,1,1]]],Y:[[new Ne(b,a),[0,.8,0]],[new $r(_,d),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new Ne(b,o),[0,0,.8],[Math.PI/2,0,0]],[new $r(_,p),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new Ne(b,h),[.85,.85,0],null,[2,2,.2]],[new $r(_,g),[.855,.98,0],null,[.125,1,1]],[new $r(_,g),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ne(b,c),[0,.85,.85],null,[.2,2,2]],[new $r(_,f),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new $r(_,f),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ne(b,l),[.85,0,.85],null,[2,.2,2]],[new $r(_,m),[.855,0,.98],null,[.125,1,1]],[new $r(_,m),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new Ne(new je(.125,.125,.125),s.clone()),[1.1,0,0]]],XYZY:[[new Ne(new je(.125,.125,.125),s.clone()),[0,1.1,0]]],XYZZ:[[new Ne(new je(.125,.125,.125),s.clone()),[0,0,1.1]]]},O={X:[[new Ne(new Eo(.2,0,.8,4,1,!1),i),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new Ne(new Eo(.2,0,.8,4,1,!1),i),[0,.5,0]]],Z:[[new Ne(new Eo(.2,0,.8,4,1,!1),i),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new Ne(b,i),[.85,.85,0],null,[3,3,.2]]],YZ:[[new Ne(b,i),[0,.85,.85],null,[.2,3,3]]],XZ:[[new Ne(b,i),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new Ne(new je(.2,.2,.2),i),[1.1,0,0]]],XYZY:[[new Ne(new je(.2,.2,.2),i),[0,1.1,0]]],XYZZ:[[new Ne(new je(.2,.2,.2),i),[0,0,1.1]]]},N={X:[[new $r(_,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new $r(_,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new $r(_,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},k=function(t){var e=new Q;for(var i in t)for(var n=t[i].length;n--;){var r=t[i][n][0].clone(),a=t[i][n][1],o=t[i][n][2],s=t[i][n][3],h=t[i][n][4];r.name=i,r.tag=h,a&&r.position.set(a[0],a[1],a[2]),o&&r.rotation.set(o[0],o[1],o[2]),s&&r.scale.set(s[0],s[1],s[2]),r.updateMatrix();var c=r.geometry.clone();c.applyMatrix4(r.matrix),r.geometry=c,r.renderOrder=1/0,r.position.set(0,0,0),r.rotation.set(0,0,0),r.scale.set(1,1,1),e.add(r)}return e},G=new E(0,0,0),z=new F,U=new E(0,1,0),B=new E(0,0,0),H=new D,j=new M,V=new M,W=new M,X=new E(1,0,0),Y=new E(0,1,0),q=new E(0,0,1);this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=k(T)),this.add(this.gizmo.rotate=k(C)),this.add(this.gizmo.scale=k(I)),this.add(this.picker.translate=k(A)),this.add(this.picker.rotate=k(R)),this.add(this.picker.scale=k(O)),this.add(this.helper.translate=k(P)),this.add(this.helper.rotate=k(L)),this.add(this.helper.scale=k(N)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1,this.updateMatrixWorld=function(){var t=this.space;"scale"===this.mode&&(t="local");var e="local"===t?this.worldQuaternion:W;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;var i=[];i=(i=(i=i.concat(this.picker[this.mode].children)).concat(this.gizmo[this.mode].children)).concat(this.helper[this.mode].children);for(var n=0;n<i.length;n++){var r,a=i[n];if(a.visible=!0,a.rotation.set(0,0,0),a.position.copy(this.worldPosition),r=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),a.scale.set(1,1,1).multiplyScalar(r*this.size/7),"helper"!==a.tag){if(a.quaternion.copy(e),"translate"===this.mode||"scale"===this.mode){"X"!==a.name&&"XYZX"!==a.name||Math.abs(U.copy(X).applyQuaternion(e).dot(this.eye))>
12.99&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),"Y"!==a.name&&"XYZY"!==a.name||Math.abs(U.copy(Y).applyQuaternion(e).dot(this.eye))>.99&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),"Z"!==a.name&&"XYZZ"!==a.name||Math.abs(U.copy(q).applyQuaternion(e).dot(this.eye))>.99&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),"XY"===a.name&&Math.abs(U.copy(q).applyQuaternion(e).dot(this.eye))<.2&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),"YZ"===a.name&&Math.abs(U.copy(X).applyQuaternion(e).dot(this.eye))<.2&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),"XZ"===a.name&&Math.abs(U.copy(Y).applyQuaternion(e).dot(this.eye))<.2&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),-1!==a.name.search("X")&&(U.copy(X).applyQuaternion(e).dot(this.eye)<0?"fwd"===a.tag?a.visible=!1:a.scale.x*=-1:"bwd"===a.tag&&(a.visible=!1)),-1!==a.name.search("Y")&&(U.copy(Y).applyQuaternion(e).dot(this.eye)<0?"fwd"===a.tag?a.visible=!1:a.scale.y*=-1:"bwd"===a.tag&&(a.visible=!1)),-1!==a.name.search("Z")&&(U.copy(q).applyQuaternion(e).dot(this.eye)<0?"fwd"===a.tag?a.visible=!1:a.scale.z*=-1:"bwd"===a.tag&&(a.visible=!1))}else"rotate"===this.mode&&(V.copy(e),U.copy(this.eye).applyQuaternion(j.copy(e).inverse()),-1!==a.name.search("E")&&a.quaternion.setFromRotationMatrix(H.lookAt(this.eye,B,Y)),"X"===a.name&&(j.setFromAxisAngle(X,Math.atan2(-U.y,U.z)),j.multiplyQuaternions(V,j),a.quaternion.copy(j)),"Y"===a.name&&(j.setFromAxisAngle(Y,Math.atan2(U.x,U.z)),j.multiplyQuaternions(V,j),a.quaternion.copy(j)),"Z"===a.name&&(j.setFromAxisAngle(q,Math.atan2(U.y,U.x)),j.multiplyQuaternions(V,j),a.quaternion.copy(j)));a.visible=a.visible&&(-1===a.name.indexOf("X")||this.showX),a.visible=a.visible&&(-1===a.name.indexOf("Y")||this.showY),a.visible=a.visible&&(-1===a.name.indexOf("Z")||this.showZ),a.visible=a.visible&&(-1===a.name.indexOf("E")||this.showX&&this.showY&&this.showZ),a.material._opacity=a.material._opacity||a.material.opacity,a.material._color=a.material._color||a.material.color.clone(),a.material.color.copy(a.material._color),a.material.opacity=a.material._opacity,this.enabled?this.axis&&(a.name===this.axis||this.axis.split("").some((function(t){return a.name===t}))?(a.material.opacity=1,a.material.color.lerp(new jt(1,1,1),.5)):(a.material.opacity*=.25,a.material.color.lerp(new jt(1,1,1),.5))):(a.material.opacity*=.5,a.material.color.lerp(new jt(1,1,1),.5))}else a.visible=!1,"AXIS"===a.name?(a.position.copy(this.worldPositionStart),a.visible=!!this.axis,"X"===this.axis&&(j.setFromEuler(z.set(0,0,0)),a.quaternion.copy(e).multiply(j),Math.abs(U.copy(X).applyQuaternion(e).dot(this.eye))>.9&&(a.visible=!1)),"Y"===this.axis&&(j.setFromEuler(z.set(0,0,Math.PI/2)),a.quaternion.copy(e).multiply(j),Math.abs(U.copy(Y).applyQuaternion(e).dot(this.eye))>.9&&(a.visible=!1)),"Z"===this.axis&&(j.setFromEuler(z.set(0,Math.PI/2,0)),a.quaternion.copy(e).multiply(j),Math.abs(U.copy(q).applyQuaternion(e).dot(this.eye))>.9&&(a.visible=!1)),"XYZE"===this.axis&&(j.setFromEuler(z.set(0,Math.PI/2,0)),U.copy(this.rotationAxis),a.quaternion.setFromRotationMatrix(H.lookAt(B,U,Y)),a.quaternion.multiply(j),a.visible=this.dragging),"E"===this.axis&&(a.visible=!1)):"START"===a.name?(a.position.copy(this.worldPositionStart),a.visible=this.dragging):"END"===a.name?(a.position.copy(this.worldPosition),a.visible=this.dragging):"DELTA"===a.name?(a.position.copy(this.worldPositionStart),a.quaternion.copy(this.worldQuaternionStart),G.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),G.applyQuaternion(this.worldQuaternionStart.clone().inverse()),a.scale.copy(G),a.visible=this.dragging):(a.quaternion.copy(e),this.dragging?a.position.copy(this.worldPositionStart):a.position.copy(this.worldPosition),this.axis&&(a.visible=-1!==this.axis.search(a.name)))}Q.prototype.updateMatrixWorld.call(this)}};hl.prototype=Object.assign(Object.create(Q.prototype),{constructor:hl,isTransformControlsGizmo:!0});var cl=function(){Ne.call(this,new oi(1e5,1e5,2,2),new Jt({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1})),this.type="TransformControlsPlane";var t=new E(1,0,0),e=new E(0,1,0),i=new E(0,0,1),n=new E,r=new E,a=new E,o=new D,s=new M;this.updateMatrixWorld=function(){var h=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(h="local"),t.set(1,0,0).applyQuaternion("local"===h?this.worldQuaternion:s),e.set(0,1,0).applyQuaternion("local"===h?this.worldQuaternion:s),i.set(0,0,1).applyQuaternion("local"===h?this.worldQuaternion:s),a.copy(e),this.mode){case"translate":case"scale":switch(this.axis){case"X":a.copy(this.eye).
12cross(t),r.copy(t).cross(a);break;case"Y":a.copy(this.eye).cross(e),r.copy(e).cross(a);break;case"Z":a.copy(this.eye).cross(i),r.copy(i).cross(a);break;case"XY":r.copy(i);break;case"YZ":r.copy(t);break;case"XZ":a.copy(i),r.copy(e);break;case"XYZ":case"E":r.set(0,0,0)}break;case"rotate":default:r.set(0,0,0)}0===r.length()?this.quaternion.copy(this.cameraQuaternion):(o.lookAt(n.set(0,0,0),r,a),this.quaternion.setFromRotationMatrix(o)),Q.prototype.updateMatrixWorld.call(this)}};cl.prototype=Object.assign(Object.create(Ne.prototype),{constructor:cl,isTransformControlsPlane:!0});const ll=new ms;function ul(t){return![void 0,null].includes(t)}function dl(t,e){function i(t){const e=function(t,e){const i=t.split("_").find(t=>t.startsWith(e));return i?i.slice(e.length):null}(t,"scale");return e?e.split("&"):null}function n(t,e){return t[e].uri}return JSON.parse(JSON.stringify(t)).materials.reduce((e,r)=>{var a;const{pbrMetallicRoughness:o,normalTexture:s,name:h}=r,{baseColorTexture:c,metallicRoughnessTexture:l,metallicFactor:u,roughnessFactor:d}=o;e[h]||(e[h]={});const p=e[h],f=t.images;if(h.includes("base")){const t=i(h);t&&(p.repeat=t)}if(c){const{index:t,extensions:e}=c;p.map=n(f,t);const i=null===(a=null==e?void 0:e.KHR_texture_transform)||void 0===a?void 0:a.scale;i&&(p.repeat=i)}if(s){p.normalMap=n(f,s.index),p.normalScale=s.scale;const t=i(h);t&&(p.normalRepeat=t)}return l&&(p.metalMap=n(f,l.index)),p.metalness=u,p.roughness=d,e},{})}function pl(t,e,i){return`#${fl(t)}${fl(e)}${fl(i)}`}function fl(t){let e=Number(t).toString(16);return e.length<2&&(e="0"+e),e}function ml(t,e){return e.materials.filter(e=>e.name.includes(t)).map(t=>t.name)}function gl(t,e){return"direct"===t?e+"Studio_fan.png":e+"Studio.png"}var vl=i(4);const yl=new ms;const xl=new nl;function bl(t){const e=new rl;e.setDecoderPath(t),e.preload(),xl.setDRACOLoader(e)}class _l extends class extends class extends class{constructor(){this.waiting=!1,this.events=[],this.destroyed=!1}updateZoom(t){this.camera.zoom=t,this.camera.updateProjectionMatrix(),this.renderScene()}setCameraPosition({x:t=0,y:e=0,z:i=0}={}){this.camera.position.set(t,e,i),this.camera.lookAt(0,0,0),this.renderScene()}setRotation(t){const{x:e,y:i,z:n}=t;this.object.setRotationFromEuler(new F(e,i,n)),this.renderScene()}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}emit(t){const e=this.events[t];e&&e.forEach(t=>{t(this)})}getImg(){const{renderer:t}=this;if(t)return t.domElement}async loadPartTexture(t){return"string"==typeof t?await new Promise(e=>{ll.load(t,e)}):new pa(t,300)}initOrbitControls(){const{camera:t,renderer:e,options:{modelControlDomId:i}}=this;let n=i?document.getElementById(i):e.domElement;const r=this.control=new al(t,n);i&&(r.enableZoom=!0,r.enableRotate=!0,r.rotateSpeed=.05),r.enablePan=!1,!this.options.lightLock&&this.emit("LIGHT_FOLLOW_CAM_EVENT"),r.addEventListener("change",()=>{!this.options.lightLock&&this.emit("LIGHT_FOLLOW_CAM_EVENT"),this.renderScene()})}initTransformControl(){const{camera:t,renderer:e,scene:i,object:n,options:{modelControlDomId:r}}=this,a=new sl(t,e.domElement);a.attach(n),a.addEventListener("change",()=>this.renderScene()),a.addEventListener("objectChange",()=>
12this.emit("objectChange")),a.setSpace("local"),a.addEventListener("dragging-changed",t=>this.control.enabled=!t.value),i.add(a),a.setMode("rotate"),a.showX=!1,a.showY=!1,a.showZ=!1,window.addEventListener("keydown",t=>{switch(t.keyCode){case 187:case 107:a.setSize(a.size+.1);break;case 189:case 109:a.setSize(Math.max(a.size-.1,.1));break;case 69:a.setMode("rotate");break;case 81:a.setSpace("local"===a.space?"world":"local");break;case 88:a.showX=!r&&!this.options.clickModel&&!a.showX;break;case 89:a.showY=!r&&!this.options.clickModel&&!a.showY;break;case 90:a.showZ=!r&&!this.options.clickModel&&!a.showZ}})}initPartClickRotate(){let t=[];const{width:e,height:i}=this.options.el;this.renderer.domElement.addEventListener("mousedown",t=>{r.x=t.clientX/e*2-1,r.y=-t.clientY/i*2+1},!0),this.renderer.domElement.addEventListener("mouseup",t=>{a.x=t.clientX/e*2-1,a.y=-t.clientY/i*2+1,r.x===a.x&&r.y===a.y&&o()},!0);const n=new Jh;let r=new m,a=new m,o=()=>{n.setFromCamera(a,this.camera);let e=n.intersectObject(this.scene,!0);if(e=e.filter(t=>{if(1==t.object.visible&&"Mesh"==t.object.type)return t}),e.length>0){const n=e[0].object;
12i=n,t=[],t.push(i),this.options.clickModel(t)}var i}}setRenderer(){const{el:t}=this.options,e=this.renderer=new sr({canvas:t,antialias:!0,preserveDrawingBuffer:!0,alpha:!0});e.outputEncoding=3001;const{width:i,height:n}=t;e.setSize(i,n);const r=this.scene=new $,a=this.camera=new Ze(45,i/n,.1,1e4);r.add(a)}getModelRotate(){return this.object.rotation}resize(t,e){return this.camera.aspect=t/e,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,e),this.renderScene(!0),this}renderScene(t){if(this.destroyed)return;const{renderer:e,scene:i,camera:n}=this;t?e.render(i,n):this.waiting||(this.waiting=!0,requestAnimationFrame(()=>{e.render(i,n),this.waiting=!1}))}}{constructor(){super(...arguments),this.aroundPointLights=[],this.isAroundLightEmpty=!0,this.customLights=[]}initLights(){let{mainPointLight:t,ambientLight:e,customLights:i}=this.options;this.on("LIGHT_FOLLOW_CAM_EVENT",()=>{this.mainPointLight.position.copy(this.camera.position)}),this.setLight(t),this.ambientLight=new Zs(e.color,e.intensity),this.camera.add(this.ambientLight),i&&i.forEach(t=>this.addLight(t,this.customLights))}setLight(t){const{intensity:e,position:i,color:n}=t,{newLightModel:r,aroundPointLight:a}=this.options,o=r;o?this.isAroundLightEmpty||(this.aroundPointLights.forEach(t=>this.scene.remove(t)),this.isAroundLightEmpty=!0):this.isAroundLightEmpty&&([[0,200,0],[0,-200,0],[200,0,0],[-200,0,0],[0,0,200],[0,0,-200]].forEach(t=>{let[e,i,n]=t;this.addLight({position:{x:e,y:i,z:n},...a},this.aroundPointLights)}),this.isAroundLightEmpty=!1),this.mainPointLight&&this.scene.remove(this.mainPointLight);const s=o?qs:Ws;this.renderer.physicallyCorrectLights=o,this.mainPointLight=new s(n,e);const{x:h=32,y:c=23,z:l=-4}=i||{};this.mainPointLight.position.set(h,c,l),this.scene.add(this.mainPointLight),this.renderScene()}addLight({position:t,color:e,intensity:i,distance:n,closed:r,decay:a},o=this.customLights){const{x:s,y:h,z:c}=t,l=new Ws(e,r?0:i,n,a);l.position.set(s,h,c),o.push(l),this.scene.add(l),this.renderScene()}updateLightIntensity({main:t,ambient:e,around:i}){const{aroundPointLight:n,mainPointLight:r,ambientLight:a}=this.options;ul(t)&&(this.mainPointLight.intensity=t,r.intensity=t),ul(e)&&(this.ambientLight.intensity=e,a.intensity=e),ul(i)&&(n.intensity=i,this.aroundPointLights.forEach(t=>t.intensity=i)),this.renderScene()}updateLightPosition(t){const{x:e,y:i,z:n}=t||{};this.mainPointLight.position.set(e,i,n),this.renderScene()}updateDefaultLightSetting(t){this.options.newLightModel=t,this.mainPointLight.type=t?"direct":"point",this.setLight(this.mainPointLight)}removeLight(t){this.scene.remove(this.customLights.splice(t,1)[0]),this.renderScene()}updateCustomLight(t,e){const i=this.customLights[t],{position:{x:n,y:r,z:a},intensity:o,decay:s,color:h,distance:c,closed:l}=e;i.position.set(n,r,a),i.intensity=l?0:o,i.decay=s,i.color=new jt(h),i.distance=c,this.renderScene()}}{constructor(){super(...arguments),this.colorMapQueue=[]}async preloadTexture(){const{matsInfo:t}=this.options,e=async(t,e,i)=>({matName:t,type:e,map:await this.loadTexture(i)}),i=[...Object.entries(t).reduce((t,i)=>{const[n,r]=i;return r.map&&t.push(e(n,"map",r.map)),r.normalMap&&t.push(e(n,"normalMap",r.normalMap)),r.metalMap&&t.push(e(n,"metalMap",r.metalMap)),t},[])],n=t.env;n&&i.push(e("env","envMap",n.envMap));const r=await Promise.all(i);this.preloadTextures=r.reduce((t,e)=>{const i=t[e.matName];return t[e.matName]?i[e.type]=e.map:(t[e.matName]={},t[e.matName][e.type]=e.map),t},{}),n&&(this.preloadTextures.env.envMap=this.convertEnvMap(this.preloadTextures.env.envMap))}async loadTexture(t){return"string"==typeof t?await new Promise(e=>{yl.load(t,e)}):new pa(t,300)}convertEnvMap(t){const e=new qc(this.renderer);return e.compileEquirectangularShader(),t.flipY=!1,t.encoding=3001,t=e.fromEquirectangular(t).texture,e.dispose(),t}async setEnvMap(t,e){this.object&&(t&&!e&&(t=await this.loadTexture(t),t=this.convertEnvMap(t)),this.object.traverse(async e=>{if(!e.isMesh)return;const i=e.material;i.envMap&&i.envMap.dispose(),i.envMap=t||null,i.needsUpdate=!0}),this.renderScene())}setLoadedMap(t,e){if(!t)return;if(this.destroyed)return void t.dispose();e.map&&(e.map.dispose(),e.map=null),t.encoding=3001,t.minFilter=1006;const i=e.name;t.wrapS=t.wrapT=1e3,t.flipY=!!["custom","base"].find(t=>i.includes(t)),e.needsUpdate=!0,e.map=t}updateMap(t,e,i){const{destroyed:n,colorMapQueue:r,renderer:a,scene:o,camera:s,options:{needUpdateCb:h}}=this;
12if(!n){if(i)this.setLoadedMap(t,e);else{const i=e=>{e.mapPromise=new Promise(async(i,n)=>{if(e.rejectFn=n,t){i(await this.loadTexture(t))}else i(null)}).then(t=>{e.map=t,e.resolved=!0,r.every(t=>t.resolved)&&this.object&&(this.object.traverse(async t=>{if(!t.isMesh)return;const e=t.material,i=e.name;r.forEach(t=>t.material===i&&this.setLoadedMap(t.map,e))}),requestAnimationFrame(()=>{a.render(o,s),h&&this.options.onRendered&&this.options.onRendered(this.getImg())}))}).catch(()=>e.resolved=!1)},n=r.find(t=>t.material===e);if(n)n.resolved&&n.map?(n.resolved=!1,n.map.dispose()):n.rejectFn(),i(n);else{let t={map:null,mapPromise:null,rejectFn:null,resolved:!1,material:e};i(t),r.push(t)}}return this}console.log("update after destroyed")}async updatePart(t,e,i,n,r){const{object:a}=this;a&&(a.traverse(a=>{a.name===t&&a.children.forEach(t=>{t.name===e?(t.visible=!0,t.traverse(t=>{if(t.isMesh&&t.material.name.includes("mutable")&&n)if(1===i){const[e,i,r]=JSON.parse(n);t.material.color={r:parseInt(e)/255,g:parseInt(i)/255,b:parseInt(r)/255}}else 2===i&&this.updateMap(r,t.material,!1)})):t.visible=!1})}),this.renderScene())}updateColor(t,e={r:"",g:"",b:""}){this.object.traverse(async i=>{if(!i.isMesh)return;const n=i.material,r=n.name;var a,o;t===r&&(a=e,(o=n).needsUpdate=!0,o.map=null,o.color=a)})}setSelectObject(t,e,i,n,r){i?this.object.traverse(t=>{t.name===i&&t.children.forEach(t=>{t.name===n&&t.traverse(t=>{t.isMesh&&(this.selectChildColor=t.material.color,t.material.color={r:24/255,g:144/255,b:1},this.renderScene())})})}):this.object.traverse(async e=>{if(!e.isMesh)return;const i=e.material;i.name===t&&(this.selectChildColor=i.color,i.color={r:24/255,g:144/255,b:1},this.renderScene())});((e,a)=>{var o=new vl.a.Tween({x1:e.x,y1:e.y,z1:e.z});o.stop(),o.to({x1:a.x,y1:a.y,z1:a.z},1500),o.onUpdate(t=>{this.camera.position.x=t.x1,this.camera.position.y=t.y1,this.camera.position.z=t.z1,this.control.update(),requestAnimationFrame(()=>{o.update()})}),o.onComplete(()=>{this.control.enabled=!0}),o.easing(vl.a.Easing.Cubic.InOut),o.start(),o.update(),setTimeout(()=>{i?this.object.traverse(t=>{t.name===i&&t.children.forEach(t=>{t.name===n&&t.traverse(t=>{t.isMesh&&(t.material.color=this.selectChildColor,this.renderScene(),r&&r(!0))})})}):this.object.traverse(async e=>{if(!e.isMesh)return;const i=e.material;i.name===t&&(i.color=this.selectChildColor,this.renderScene(),r&&r(!0))})},500)})(this.camera.position,e)}addUvSet(t,e){const i=["map","normalMap"],n=/#include <(.*)>/gm;const r=/texture2D\( (.*Map|map), vUv \)/gm,a={};t.userData.extraUniforms=a,i.forEach(i=>{const n=i+"Repeat",r=e[i]||[1,1],[o,s]=r;t[n]=new m(o,s);const h=`u_${i}Transform`,c={value:new g,name:i};c.value.name=i,c.value.setUvTransform=function(t,e,i,n,r,a,o){const s=Math.cos(r),h=Math.sin(r);this.set(i*s,i*h,-i*(s*a+h*o)+a+t,-n*h,n*s,-n*(-h*a+s*o)+o+e,0,0,0)}.bind(c.value),a[h]=c;const l=i+"UpdateMatrix";t[l]=function(){const{x:t,y:e}=this[n];a[h].value.setUvTransform(0,0,t,e,0,0,0)}.bind(t),t[l]()}),t.onBeforeCompile=function(t){let e="";t.fragmentShader=function t(e){return e.replace(n,(function(e,i){return t(si[i])}))}(t.fragmentShader),t.fragmentShader=function n(o){return o.replace(r,(function(r,o){if(!i.includes(o))return r;let s=`u_${o}Transform`;return e=e.includes(s)?e:`${e} uniform mat3 ${s};\n`,t.uniforms[s]=a[s],t.uniforms[s].name=s,n(`texture2D( ${o}, ( ${s} * vec3( vUv, 1. ) ).xy )`)}))}(t.fragmentShader),t.fragmentShader=e+t.fragmentShader}.bind(t)}async processMaterial(){const{preloadTextures:t,colorMapQueue:e,options:{matsInfo:i}}=this;t.env&&await this.setEnvMap(t.env.envMap,!0),this.object.traverse(async n=>{if(!n.isMesh)return;const r=n.material,a=r.name,{repeat:o,normalRepeat:s=[1,1],normalScale:h,metalness:c,roughness:l}=i[a]||{},u=e.find(t=>t.material===a);u&&u.resolved&&this.updateMap(u.map,r,!0);let d=t[a];const[p,f]=s;if(this.addUvSet(r,{map:o||[1,1],normalMap:[p,-f]}),d){const{map:t,normalMap:e,metalMap:i}=d;t&&this.updateMap(t,r,!0),e&&(r.normalMap&&r.normalMap.dispose(),ul(h)&&r.normalScale.set(h,-h),e.wrapS=e.wrapT=1e3,r.normalMap=e),i&&(i.flipY=!1,r.metalnessMap&&r.metalnessMap.dispose(),r.roughnessMap&&r.roughnessMap.dispose(),r.metalnessMap=i,r.roughnessMap=i)}ul(c)&&(r.metalness=c),ul(l)&&(r.roughness=l)})}}{constructor(t){super(),this.options=t}
12async init(){const{options:{GLTFPath:t,zoom:e,cameraPosition:i,clickModel:n,enableControl:r}}=this;this.setRenderer(),n&&this.renderer.setClearColor(16185078),this.initLights(),this.setCameraPosition(i),e&&this.updateZoom(e),await this.preloadTexture(),this.destroyed||(await this.updateMeshGroup(t),this.destroyed||r&&(this.initOrbitControls(),this.initTransformControl(),n&&this.initPartClickRotate()))}async updateMeshGroup(t){const{object:e,scene:i,colorMapQueue:n,renderer:r,camera:a,options:{rotation:o,partInfos:s,needUpdateCb:h}}=this;if(!t)return;e&&i.remove(this.object),this.disposeMeshGroup();const c=await new Promise(e=>{xl.load(t,t=>e(t))});this.object=c.scene,this.processMaterial(),i.add(this.object),o&&this.setRotation(o),s&&s.forEach(t=>{const{parentMeshName:e,childMeshName:i,color:n,type:r,partMap:a}=t;this.updatePart(e,i,r,n,a)}),this.loaded=!0,this.emit("loaded"),r.render(i,a),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const t=this.options.onRendered;h?n.every(t=>t.resolved)&&t&&t(this.getImg()):t&&t()})})}disposeMeshGroup(){this.object&&this.object.traverse(t=>{if(!t.isMesh)return;t.geometry.dispose();const e=t.material;Array.isArray(e)?e.forEach(t=>t.dispose()):e.dispose()})}updateSyncInfo({zoom:t,position:e,main:i,ambient:n,around:r,rotation:a,custom:o=[]}){for(a&&this.setRotation(a),e&&this.setCameraPosition(e),t&&this.updateZoom(t),this.setLight(i),this.updateLightIntensity({main:i&&i.intensity,ambient:n,around:r});this.customLights.length;)this.removeLight(0);o.forEach(t=>this.addLight(t,this.customLights))}destroy(){const{control:t,scene:e,object:i,renderer:n,loaded:r}=this;r?(t&&t.dispose(),i&&(i.traverse(t=>{t.isMesh&&(t.geometry.dispose(),Array.isArray(t.material)?t.material.forEach(t=>{t.map&&t.map.dispose(),t.normalMap&&t.normalMap.dispose(),t.dispose()}):(t.material.map&&t.material.map.dispose(),t.material.normalMap&&t.material.normalMap.dispose(),t.material.dispose()))}),e.remove(i),this.object=null),e&&(e.dispose(),this.scene=null),n&&(n.forceContextLoss(),n.renderLists.dispose(),n.dispose(),this.renderer=null),this.destroyed=!0):this.on("loaded",()=>{this.destroy()})}}var wl=i(2),Ml=i.n(wl);async function Sl(t,e,i){const{uvList:n,renderParams:{allowAlpha:r}}=t,a=await Promise.all(n.map(async t=>{if(t.notChanged)return!1;let n;return n=i?function(t,e){return t.faceList.reduce((t,i)=>e[i.view_id]&&i.params.visible?(i.url=e[i.view_id],t.push(i),t):t,[])}(t,i):await Promise.all(t.faceList.map(t=>new Promise(i=>{const n=new Image;n.width=n.height=e,n.setAttribute("crossOrigin","anonymous"),n.src=t.url,n.onload=()=>{t.url=n,i(t)}}))),await async function(t,e,i,n){const r=document.createElement("canvas"),{designColorType:a,designColorCode:o,designColorUrl:s}=e;if(2===a&&s){const e=new Image;e.crossOrigin="anonymous",e.src=s;let i=await new Promise(t=>e.onload=()=>t(e));t.unshift({width:n,height:n,url:i,params:{scaleX:1,scaleY:1,visible:!0}})}const h=t.reduce((t,e)=>{const i=1/e.params.scaleX;return i>t?i:t},1),c=n*h;r.width=r.height=c;const l=r.getContext("2d");l.clearRect(0,0,c,c),l.fillStyle=1===a?pl(...o):1!=i?"#fff":"rgba(0,0,0,0)";return l.fillRect(0,0,c,c),l.globalCompositeOperation="source-over",t.forEach(t=>{const{params:e}=t,i=t.width*e.scaleX*h,n=t.height*e.scaleX*h,r=e.flipX?-1:1,a=e.flipY?-1:1,o=e.angle*Math.PI/180,s=e.centerX,c=e.centerY;l.save(),l.scale(r,a),l.rotate(o*r*a),void 0!==s&&void 0!==c&&(l.translate(Math.round(s*h),Math.round(c*h)),l.translate(-i/2,-n/2)),l.drawImage(t.url,0,0,i,n),l.setTransform(1,0,0,1,0,0),l.restore()}),r}(n,t.customBase,r,e)}));return n.map((t,e)=>({name:t.name,map:a[e]}))}function Tl({p1:t,p2:e,p3:i,p4:n},r){const a=([t,e])=>{const i=r/1200;return[t/i,e/i]};t=a(t.split(",")),e=a(e.split(",")),i=a(i.split(",")),n=a(n.split(","));const o=Math.min(t[0],e[0],i[0],n[0]),s=Math.min(t[1],e[1],i[1],n[1]);return{centerX:(o+Math.max(t[0],e[0],i[0],n[0]))/2,centerY:(s+Math.max(t[1],e[1],i[1],n[1]))/2}}let El=!1;class Al{constructor(t){this.canvas=document.createElement("canvas"),this._ctx=this.canvas.getContext("2d"),this.modelPreviewers=[],this.modelImgMaps=[],this.renderImgScale=2,this.canvasSize=600*this.renderImgScale,this.baseMats=[],this.destroyed=!1,this.mapQueue=[],this.type=t.type,this.modelControlDomId=t.modelControlDomId,this.partIds=t.partIds||[],this.modelOptions=t.modelOptions,this.faceListMap=t.faceListMap,this.mapLength=t.modelOptions.length,this.callback=t.callBack,this.baseWidth=t.baseWi
12dth,this.staticPath=t.staticPath,this.decoderPath=t.decoderPath,this.canvas.height=this.canvas.width=this.canvasSize,this.modelCanvas=t.canvas,this.container=t.container,this.isFlushing=!0,El||(bl(this.decoderPath),El=!0),this.modelOptions.find(t=>!t.detail3D)||this.startDraw()}async updateFaceListMap(t,e){this.destroyed||this.modelOptions.find(t=>!t.detail3D)||(this.mapQueue.push({baseMaps:this.modelOptions.map(t=>t.detail3D.textureMap),faceListMap:t,callback:e,modelOptions:this.modelOptions}),5===this.type&&this.isFlushing||this.flushQueue())}setUvUpdateState(t,e){const{uvList:i}=t.detail3D;i.forEach(t=>{const{faceList:i}=t;1===this.type?t.notChanged=!1:t.notChanged=!i.find(t=>e[t.view_id])})}async flushQueue(){if(!this.mapQueue.length)return;const t=this.mapQueue.shift(),{faceListMap:e,callback:i,modelOptions:n}=t;n.forEach(t=>{this.setUvUpdateState(t,e)}),this.callback=i,this.mapLength=n.reduce((t,i)=>{const{uvList:n}=i.detail3D;return n.find(t=>{const{faceList:i}=t;return i.find(t=>e[t.view_id])})&&t++,t},0),t.maps=await Promise.all(n.map(t=>(this.setUvUpdateState(t,e),Sl(t.detail3D,this.baseWidth,e)))),this.destroyed||this._createModelImgMap(t)}async startDraw(){this.maps=await Promise.all(this.modelOptions.map(t=>(this.setUvUpdateState(t,this.faceListMap),Sl(t.detail3D,this.baseWidth,this.faceListMap)))),this.modelOptions.map((t,e)=>this._createModelPreview(t,e).then(t=>this.modelPreviewers[e]=t))}_createModelPreview(t,e){let{detail3D:{width:i,height:n,angle:r,baseFiles:a,textureMap:o,renderParams:{lightLock:s,mainPointIntensity:h,mainPointPosition:c,aroundPointIntensity:l,ambientLightIntensity:u,lights:d,zoom:p,mainPointType:f,newLightModel:m,rotation:g},position:v,enable_hdr:y},distortParams:x}=t;const b=document.createElement("canvas");if(2!==this.type){if([4,5,6].includes(this.type)&&(b.width=i*this.renderImgScale,b.height=n*this.renderImgScale),1===this.type){const t=+getComputedStyle(this.container).width.slice(0,-2);b.width=t,b.height=t}if(3===this.type){const t=+getComputedStyle(this.container).width.slice(0,-2),{centerX:e,centerY:a}=Tl(x,this.baseWidth);b.width=i,b.height=n,this.ratio=t/600,b.style.left=(e-i/2)*this.ratio+"px",b.style.top=(a-n/2)*this.ratio+"px",b.style.transform=`rotate(${r}deg)`}[1,3].includes(this.type)&&(b.style.position="absolute",this.container.appendChild(b))}const _=a.find(t=>t.file_url.endsWith("glb")&&!t.file_name.includes("source")).file_url,w=a.find(t=>t.file_url.endsWith("json")).file_url,M=t=>new Promise(e=>{Ml.a.get(t).then(t=>{this.destroyed||((t=t.data).images&&(t.images=t.images.map(t=>({uri:a.find(e=>t.name===e.file_name).file_url}))),e(t))})});return new Promise(r=>{M(w).then(a=>{if(this.destroyed)return;const x=this.baseMats[e]=ml("base",a),w=dl(a);x.forEach(t=>{w[t]||(w[t]={}),w[t].map=o}),1==y&&(w.env={envMap:gl(f,this.staticPath)}),this.maps[e]&&this.maps[e].forEach(t=>{const{name:e,map:i}=t;w[e]||(w[e]={}),w[e].map=i});let M={el:this.modelCanvas||b,enableControl:[1,2].includes(this.type),needUpdateCb:![1,2,3].includes(this.type),GLTFPath:_,customLights:d,modelControlDomId:this.modelControlDomId,rotation:g,zoom:p,lightLock:s,onRendered:[4,6].includes(this.type)?t=>this.callback(t.toDataURL()):5===this.type?t=>{this.destroyed||(this.modelImgMaps[e]=t,0==--this.mapLength&&(this._drawImg(),this.isFlushing=!1,this.flushQueue()))}:()=>this.callback(),matsInfo:w,newLightModel:m,mainPointLight:{type:f,intensity:h,position:c&&c||void 0},aroundPointLight:{intensity:l},ambientLight:{intensity:u},cameraPosition:v&&v||void 0,partInfos:[]};this.partIds.forEach(e=>{const{partId:i,childPartId:n,colorId:r,partMap:a}=e,o=this.getPartInfo(t,i,n,r,a);if(o){const{spu_part_name:t,childMeshName:e,color:i,type:n}=o;M.partInfos.push({parentMeshName:t,childMeshName:e,color:i,type:n})}});let S=new _l(M);S.init(),3===this.type&&(b.style.height=n*this.ratio+"px",b.style.width=i*this.ratio+"px"),r(S)})})}_createModelImgMap(t){const{baseMats:e,modelPreviewers:i}=this;t.maps.forEach((t,e)=>{t.forEach(t=>{const{name:n,map:r}=t;r&&i[e].updateMap(r,n)})}),t.baseMaps.forEach((t,n)=>
12{t&&e[n].forEach(e=>{i[n].updateMap(t,e)})})}_drawImg(){const{modelImgMaps:t,callback:e,canvasSize:i,_ctx:n,canvas:r,baseWidth:a}=this;this.modelOptions.length>0&&this.modelOptions.forEach((e,i)=>{const r=t[i];let{detail3D:{width:o,height:s,angle:h},distortParams:c}=e;const{centerX:l,centerY:u}=Tl(c,a);h=h*Math.PI/180,n.save(),n.translate(l*this.renderImgScale,u*this.renderImgScale),n.rotate(h),n.translate(-o*this.renderImgScale/2,-s*this.renderImgScale/2),n.drawImage(r,0,0,o*this.renderImgScale,s*this.renderImgScale),n.setTransform(1,0,0,1,0,0),n.restore()}),e&&e(r.toDataURL("img/png")),this._ctx.clearRect(0,0,i,i)}destroy(){if(this.destroyed=!0,this.modelPreviewers&&this.modelPreviewers.length>0&&this.modelPreviewers.forEach(t=>t.destroy()),this.container){let t=this.container.lastElementChild;for(;t;)this.container.removeChild(t),t=this.container.lastElementChild}this.maps=null,this.faceListMap=null,this.modelPreviewers=null,this._ctx=null}resize(t,e){this.modelPreviewers&&this.modelPreviewers.length>0&&this.modelPreviewers.forEach(i=>i.resize(t,e))}setActive(t){this.modelPreviewers&&this.modelPreviewers.length>0&&(this.modelPreviewers[0].orbitControlsDom.enabled=t)}getImg(t){if(!this.destroyed){if(2==this.type){const e=this.modelCanvas.width,i=this.modelPreviewers[0].resize(t,t).getImg().toDataURL();return this.modelPreviewers[0].resize(e,e),i}return this.modelPreviewers[0].getImg().toDataURL()}}getPosition(){if(!this.destroyed)return this.modelPreviewers[0].getCameraPosition()}getRotate(){if(!this.destroyed)return this.modelPreviewers[0].getModelRotate()}getMainLightPos(){if(!this.destroyed)return this.modelPreviewers[0].mainPointLight.position}getPartInfo(t,e,i,n,r){const a=t.detail3D;if(!a)return;const o=a.parts.find(t=>t.part_id===e);if(!o)return;const{spu_part_name:s,detail_parts:h}=o,c=h.find(t=>t.part_detail_id===i),l=c.spu_part_detail_name,u=c.colors.find(t=>t.color_id===n);return{spu_part_name:s,childMeshName:l,color:u.color_code,type:u.type,partMap:r}}updatePart(t,e,i,n,r){this.modelPreviewers.forEach((r,a)=>{const o=this.getPartInfo(this.modelOptions[a],t,e,i,n);if(o){const{spu_part_name:t,childMeshName:e,color:i,type:n,partMap:s}=o;r.updatePart(t,e,n,i,s),this.modelImgMaps[a]=r.getImg()}}),[4,5,6].includes(this.type)&&(this.callback=r,this._drawImg())}updateAngle(t,e,i,n){let r="",a=t=>{this.modelOptions.map(e=>{e.detail3D.uvList.map(e=>{e.faceList.map(i=>{t==i.id&&(r=e.name)})})})};(e=JSON.parse(e)).x=parseFloat(e.x),e.y=parseFloat(e.y),e.z=parseFloat(e.z),i?this.modelPreviewers.forEach((t,a)=>{t.setSelectObject(r,e,i,n)}):(a(t),this.modelPreviewers.forEach((t,i)=>{t.setSelectObject(r,e)}))}}async function Pl(t){if(!t)return;const{baseFiles:e,textureMap:i}=t,n=e.find(t=>t.file_url.endsWith("glb")&&!t.file_name.includes("source")).file_url,r=e.find(t=>t.file_url.endsWith("json")).file_url;let a,o=await Ml.a.get(r);o=o.data,o.images&&(a=o.images.map(t=>Ml.a.get(e.find(e=>t.name===e.file_name).file_url))),await Promise.all([Ml.a.get(n),i&&Ml.a.get(i),a])}var Cl=i(0),Ll=i.n(Cl);let Rl=null;!function(t){if(!t.numeric){var e={dim:function(t){var i;return"object"==typeof t?"object"==typeof(i=t[0])?"object"==typeof i[0]?e._dim(t):[t.length,i.length]:[t.length]:[]},_foreach2:function t(e,i,n,r){if(n===i.length-1)return r(e);var a,o=i[n],s=Array(o);for(a=o-1;a>=0;a--)s[a]=t(e[a],i,n+1,r);return s},cloneV:function(t){var e,i=t.length,n=Array(i);for(e=i-1;-1!==e;--e)n[e]=t[e];return n},clone:function(t){if("object"!=typeof t)return t;var i=e.cloneV,n=e.dim(t);return e._foreach2(t,n,0,i)},diag:function(t){var e,i,n,r,a=t.length,o=Array(a);for(e=a-1;e>=0;e--){for(r=Array(a),i=e+2,n=a-1;n>=i;n-=2)r[n]=0,r[n-1]=0;for(n>e&&(r[n]=0),r[e]=t[e],n=e-1;n>=1;n-=2)r[n]=0,r[n-1]=0;0===n&&(r[0]=0),o[e]=r}return o},rep:function(t,i,n){void 0===n&&(n=0);var r,a=t[n],o=Array(a);if(n===t.length-1){for(r=a-2;r>=0;r-=2)o[r+1]=i,o[r]=i;return-1===r&&(o[0]=i),o}for(r=a-1;r>=0;r--)o[r]=e.rep(t,i,n+1);return o},identity:function(t){return e.diag(e.rep([t],1))},inv:function(t){var i,n,r,a,o,s,h,c,l=e.dim(t),u=Math.abs,d=l[0],p=l[1],f=e.clone(t),m=e.identity(d);for(s=0;s<p;++s){var g=-1,v=-1;for(o=s;o!==d;++o)(h=u(f[o][s]))>v&&(g=o,v=h);for(n=f[g],f[g]=f[s],f[s]=n,a=m[g],m[g]=m[s],m[s]=a,c=n[s],h=s;h!==p;++h)n[h]/=c;for(h=p-1;-1!==h;--h)a[h]/=c;for(o=d-1;-1!==o;
12--o)if(o!==s){for(i=f[o],r=m[o],c=i[s],h=s+1;h!==p;++h)i[h]-=n[h]*c;for(h=p-1;h>0;--h)r[h]-=a[h]*c,r[--h]-=a[h]*c;0===h&&(r[0]-=a[0]*c)}}return m},dotMMsmall:function(t,e){var i,n,r,a,o,s,h,c,l,u,d;for(a=t.length,o=e.length,s=e[0].length,h=Array(a),i=a-1;i>=0;i--){for(c=Array(s),l=t[i],r=s-1;r>=0;r--){for(u=l[o-1]*e[o-1][r],n=o-2;n>=1;n-=2)d=n-1,u+=l[n]*e[n][r]+l[d]*e[d][r];0===n&&(u+=l[0]*e[0][r]),c[r]=u}h[i]=c}return h},dotMV:function(t,i){var n,r=t.length,a=Array(r),o=e.dotVV;for(n=r-1;n>=0;n--)a[n]=o(t[n],i);return a},dotVV:function(t,e){var i,n,r=t.length,a=t[r-1]*e[r-1];for(i=r-2;i>=1;i-=2)n=i-1,a+=t[i]*e[i]+t[n]*e[n];return 0===i&&(a+=t[0]*e[0]),a},transpose:function(t){var e,i,n,r,a,o=t.length,s=t[0].length,h=Array(s);for(i=0;i<s;i++)h[i]=Array(o);for(e=o-1;e>=1;e-=2){for(r=t[e],n=t[e-1],i=s-1;i>=1;--i)(a=h[i])[e]=r[i],a[e-1]=n[i],(a=h[--i])[e]=r[i],a[e-1]=n[i];0===i&&((a=h[0])[e]=r[0],a[e-1]=n[0])}if(0===e){for(n=t[0],i=s-1;i>=1;--i)h[i][0]=n[i],h[--i][0]=n[i];0===i&&(h[0][0]=n[0])}return h}};t.zw_numeric=e}}(window),function(){function t(t,e,i){if(i){var n=e;e=t,t=n}var r,a=[[t[0],t[1],1,0,0,0,-1*e[0]*t[0],-1*e[0]*t[1]],[0,0,0,t[0],t[1],1,-1*e[1]*t[0],-1*e[1]*t[1]],[t[2],t[3],1,0,0,0,-1*e[2]*t[2],-1*e[2]*t[3]],[0,0,0,t[2],t[3],1,-1*e[3]*t[2],-1*e[3]*t[3]],[t[4],t[5],1,0,0,0,-1*e[4]*t[4],-1*e[4]*t[5]],[0,0,0,t[4],t[5],1,-1*e[5]*t[4],-1*e[5]*t[5]],[t[6],t[7],1,0,0,0,-1*e[6]*t[6],-1*e[6]*t[7]],[0,0,0,t[6],t[7],1,-1*e[7]*t[6],-1*e[7]*t[7]]],o=e;try{r=zw_numeric.inv(zw_numeric.dotMMsmall(zw_numeric.transpose(a),a))}catch(t){return[1,0,0,0,1,0,0,0]}for(var s,h=zw_numeric.dotMMsmall(r,zw_numeric.transpose(a)),c=zw_numeric.dotMV(h,o),l=0;l<c.length;l++)c[l]=(s=c[l],Math.round(1e10*s)/1e10);return c[8]=1,c}Rl=function(e,i){return"undefined"!=typeof window&&window===this||void 0===this?new Rl(e,i):(this.srcPts=e,this.dstPts=i,this.coeffs=t(this.srcPts,this.dstPts,!1),this.coeffsInv=t(this.srcPts,this.dstPts,!0),this)},Rl.prototype={transform:function(t,e){var i=[];return i[0]=(this.coeffs[0]*t+this.coeffs[1]*e+this.coeffs[2])/(this.coeffs[6]*t+this.coeffs[7]*e+1),i[1]=(this.coeffs[3]*t+this.coeffs[4]*e+this.coeffs[5])/(this.coeffs[6]*t+this.coeffs[7]*e+1),i},transformInverse:function(t,e){var i=[];return i[0]=(this.coeffsInv[0]*t+this.coeffsInv[1]*e+this.coeffsInv[2])/(this.coeffsInv[6]*t+this.coeffsInv[7]*e+1),i[1]=(this.coeffsInv[3]*t+this.coeffsInv[4]*e+this.coeffsInv[5])/(this.coeffsInv[6]*t+this.coeffsInv[7]*e+1),i}}}();class Il{constructor(t,e,i,n){this.x=t,this.y=e,this.u=i,this.v=n}clone(){return new Il(this.x,this.y,this.u,this.v)}}class Ol{constructor(t,e,i){this.p0=t,this.p1=e,this.p2=i}clone(){return new Ol(this.p0,this.p1,this.p2)}drawMeshLineToContext(t,e){var i=t[this.p0],n=t[this.p1],r=t[this.p2];e.moveTo(i.x,i.y),e.lineTo(n.x,n.y),e.lineTo(r.x,r.y),e.lineTo(i.x,i.y)}drawImageToContext(t,e,i,n){var r=t[this.p0],a=t[this.p1],o=t[this.p2];Ol.drawImageToContextWithPoints(e,i,r.x,r.y,a.x,a.y,o.x,o.y,r.u,r.v,a.u,a.v,o.u,o.v,n)}static extendVert(t,e,i,n,r,a){if(null==navigator.userAgent.toLowerCase().match(/version\/([\d.]+).*safari/)){var o=2*t-i-r,s=2*e-n-a,h=Math.sqrt(3/(o*o+s*s));return[t+o*h,e+s*h]}return[t,e]}static drawImageToContextWithPoints(t,e,i,n,r,a,o,s,h,c,l,u,d,p,f){h*=t.width,l*=t.width,d*=t.width,c*=t.height,u*=t.height,p*=t.height;var m=Ol.extendVert(i,n,r,a,o,s),g=Ol.extendVert(r,a,i,n,o,s),v=Ol.extendVert(o,s,r,a,i,n);e.beginPath(),e.moveTo(m[0],m[1]),e.lineTo(g[0],g[1]),e.lineTo(v[0],v[1]),e.closePath();var y=1/((l-=h)*(p-=c)-(d-=h)*(u-=c)),x=(p*(r-=i)-u*(o-=i))*y,b=(p*(a-=n)-u*(s-=n))*y,_=(l*o-d*r)*y,w=(l*s-d*a)*y,M=i-x*h-_*c,S=n-b*h-w*c;e.save(),e.transform(x,b,_,w,M,S),e.clip(),e.drawImage(t,0,0),e.restore()}}class Dl{constructor(){this.points=[],this.verts=[]}clone(){for(var t=new Dl,e=0;e<this.points.length;e++)t.points[e]=this.points[e].clone();for(e=0;e<this.verts.length;e++)t.verts[e]=this.verts[e];return t}move(t,e){for(var i=0;i<this.points.length;i++)this.points[i].x+=t,this.points[i].y+=e}changeByMatrix4(t){for(var e=0;e<this.points.length;e++)this.points[e].changeByMatrix4(t)}drawMeshHelper(t,e){t.save(),t.beginPath(),t.lineWidth=.5,t.strokeStyle="#0000ff",t.setLineDash([15,5]),t.moveTo(e[0].x,e[0].y),t.lineTo(e[1].x,e[1].y),t.lineTo(e[2].x,e[2].y),t.lineTo(e[3].x,e[3].y),t.lineTo(e[0].x,e[0].y),t.stroke(),t.restore(
12)}drawMeshLine(t){t.save(),t.lineWidth=.5,t.strokeStyle="#0000ff";for(var e=0;e<this.verts.length;e++)this.verts[e].drawMeshLineToContext(this.points,t);t.stroke(),t.restore()}drawImageToContext(t,e){for(var i=0;i<this.verts.length;i++)this.verts[i].drawImageToContext(this.points,t,e,i)}static createMapMesh(t,e,i,n){for(var r=new Dl,a=t/i,o=e/n,s=1/i,h=1/n,c=0;c<=n;c++)for(var l=0;l<=i;l++)r.points.push(new Il(l*a,c*o,l*s,c*h));for(c=0;c<n;c++)for(l=0;l<i;l++){var u=(i+1)*c+l;r.verts.push(new Ol(u+1,u,u+i+1)),r.verts.push(new Ol(u+i+1,u+i+2,u+1))}return r}}const Nl=function(t,e,i){return[t,e*i/((t=(2-e)*i)<1?t:2-t)||0,t/2]},kl=function(t,e){var i;"string"==typeof(i=t)&&-1!==i.indexOf(".")&&1===parseFloat(i)&&(t="100%");const n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)},Fl={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Gl={A:10,B:11,C:12,D:13,E:14,F:15},zl=function(t){return 2===t.length?16*(Gl[t[0].toUpperCase()]||+t[0])+(Gl[t[1].toUpperCase()]||+t[1]):Gl[t[1].toUpperCase()]||+t[1]},Ul=function(t,e,i){t=kl(t,255),e=kl(e,255),i=kl(i,255);const n=Math.max(t,e,i),r=Math.min(t,e,i);let a,o,s=n;const h=n-r;if(o=0===n?0:h/n,n===r)a=0;else{switch(n){case t:a=(e-i)/h+(e<i?6:0);break;case e:a=(i-t)/h+2;break;case i:a=(t-e)/h+4}a/=6}return{h:360*a,s:100*o,v:100*s}},Bl=function(t,e,i){t=6*kl(t,360),e=kl(e,100),i=kl(i,100);const n=Math.floor(t),r=t-n,a=i*(1-e),o=i*(1-r*e),s=i*(1-(1-r)*e),h=n%6,c=[i,o,a,a,s,i][h],l=[s,i,i,o,a,a][h],u=[a,a,s,i,i,o][h];return{r:Math.round(255*c),g:Math.round(255*l),b:Math.round(255*u)}};class Hl{constructor(t){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="",t=t||{};for(let e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this.doOnChange()}set(t,e){if(1!==arguments.length||"object"!=typeof t)this["_"+t]=e,this.doOnChange();else for(let e in t)t.hasOwnProperty(e)&&this.set(e,t[e])}get(t){return this["_"+t]}toRgb(){return Bl(this._hue,this._saturation,this._value)}fromString(t){if(!t)return this._hue=0,this._saturation=100,this._value=100,void this.doOnChange();const e=(t,e,i)=>{this._hue=Math.max(0,Math.min(360,t)),this._saturation=Math.max(0,Math.min(100,e)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(-1!==t.indexOf("hsl")){const i=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(t=>""!==t).map((t,e)=>e>2?parseFloat(t):parseInt(t,10));if(4===i.length?this._alpha=Math.floor(100*parseFloat(i[3])):3===i.length&&(this._alpha=100),i.length>=3){const{h:t,s:n,v:r}=function(t,e,i){i/=100;let n=e/=100;const r=Math.max(i,.01);let a,o;return n*=r<=1?r:2-r,o=((i*=2)+(e*=i<=1?i:2-i))/2,a=0===i?2*n/(r+n):2*e/(i+e),{h:t,s:100*a,v:100*o}}(i[0],i[1],i[2]);e(t,n,r)}}else if(-1!==t.indexOf("hsv")){const i=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(t=>""!==t).map((t,e)=>e>2?parseFloat(t):parseInt(t,10));4===i.length?this._alpha=Math.floor(100*parseFloat(i[3])):3===i.length&&(this._alpha=100),i.length>=3&&e(i[0],i[1],i[2])}else if(-1!==t.indexOf("rgb")){const i=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(t=>""!==t).map((t,e)=>e>2?parseFloat(t):parseInt(t,10));if(4===i.length?this._alpha=Math.floor(100*parseFloat(i[3])):3===i.length&&(this._alpha=100),i.length>=3){const{h:t,s:n,v:r}=Ul(i[0],i[1],i[2]);e(t,n,r)}}else if(-1!==t.indexOf("#")){const i=t.replace("#","").trim();if(!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(i))return;let n,r,a;3===i.length?(n=zl(i[0]+i[0]),r=zl(i[1]+i[1]),a=zl(i[2]+i[2])):6!==i.length&&8!==i.length||(n=zl(i.substring(0,2)),r=zl(i.substring(2,4)),a=zl(i.substring(4,6))),8===i.length?this._alpha=Math.floor(zl(i.substring(6))/255*100):3!==i.length&&6!==i.length||(this._alpha=100);const{h:o,s:s,v:h}=Ul(n,r,a);e(o,s,h)}}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:e,_value:i,_alpha:n,format:r}=this;if(this.enableAlpha)switch(r){case"hsl":const r=Nl(t,e/100,i/100);this.value=`hsla(${t}, ${Math.round(100*r[1])}%, ${Math.round(100*r[2])}%, ${n/100})`;break;case"hsv":this.value=`hsva(${t}, ${Math.round(e)}%, ${Math.round(i)}%, ${n/100})`;break;default:const{r:a,g:o,b:s}=Bl(t,e,i);this.value=`rgba(${a}, ${o}, ${s}, ${n/100})`}else switch(r){case"hsl":const n=Nl(t,e/100,i/100);this.value=`hsl(${t}, ${Math.round(100*n[1])}%, ${Math.round(100*n[2])}%)`;break;case"hsv":this.value=`hsv(${t}, ${Math.round(e)}%, ${Math.round(i)}%)`;break;case"rgb":const{r:r,g:a,b:o}=Bl(t,e,i);this.value=`rgb(${r}, ${a}, ${o})`;break;default:this.value=function({r:t,g:e,b:i}){const n=function(t){t=Math.min(Math.round(t),255);const e=Math.floor(t/16),i=t%16;return""+(Fl[e]||e)+(Fl[i]||i)};return isNaN(t)||isNaN(e)||isNaN(i)?"":"#"+n(t)+n(e)+n(i)}(Bl(t,e,i))}}}let jl="",Vl=new Image,Wl=null,Xl=null,Yl=[],ql=[];
12class Zl{constructor({container:t=null,productData:e,saveData:i,viewId:n=null,requestTarget:r="",associateProductView:a=null,templateData:o=null,type:s=1,staticImagePath:h="",callBack:c}){if(this.productData=[],this.stageObj={},this.ratio=0,this.saveData=[],this.konvaJson={},this.cacheProductPrintAreas=[],this.viewImgObj=[],this.viewNodeObj={childrens:[]},this.saveProductObj={is_overspread:1,is_vague:-1},this.threeDApp=[],this.associateProductView=null,this.cloneViewLength=0,this.needDetailImg=!1,this.useType=1,this.detailImgList=null,this.editImgConteiner=null,this.indexList=["master"],this.curColorId=0,this.isDestroy=!1,t)this.container=t;else{let t=document.createElement("div");t.style.width="600px",t.style.height="600px",t.style.position="fixed",t.style.left="10000px",document.body.appendChild(t),this.container=t}this.productData=JSON.parse(JSON.stringify(e)),this.useType=s,h&&(Vl.src=h+"btn-rotate.png"),1==s||(this.needDetailImg=!0),this.containerWidth=this.container.clientWidth,jl=r,this.init(c)}async init(t){for(let t of this.productData.views)await this.createStage(t);t&&t("")}createStage(t){return new Promise(async e=>{this.viewImgObj.push({id:t.id,name:t.name});let i=document.createElement("div");i.style.width="100%",i.style.height="100%",this.container.appendChild(i),this.stageObj["stage"+t.id]=new Ll.a.Stage({container:i,width:i.clientWidth,height:i.clientHeight}),await this.initDesignLayer(t.id,i.clientWidth);var n={id:t.printArea.id,defaultViews:t.id,printArea:t.printArea,config:this.convertDefaultConfig({width:t.printArea.width,height:t.printArea.height})};this.cacheProductPrintAreas.push(n),e()})}initDesignLayer(t,e){return new Promise(i=>{const n=this.productData.views.filter(e=>e.id==t)[0],r=n.width/e,a=this.stageObj["stage"+t],o=new Ll.a.Layer({x:0,y:0,name:"designLayer"});o.setAttrs({ratio:r,printAreaId:n.printArea.id,viewId:t,softSvg:n.printArea.soft_svg});const s=new Ll.a.Group({x:n.printArea.offset_x/r,y:n.printArea.offset_y/r,width:n.printArea.width/r,height:n.printArea.height/r,name:"designContainerGroup"}),h=new Ll.a.Rect({x:0,y:0,width:n.printArea.width/r,height:n.printArea.height/r,name:"print_area_border_outer"});s.add(h),o.add(s),a.add(o),o.batchDraw(),s.clip({x:0,y:0,width:s.width(),height:s.height()}),i()})}createStageForUpdateImage(t){return new Promise(async e=>{let i=document.createElement("div");i.setAttribute("id","controlImgCanvas"),i.style.width="100%",i.style.height="100%",this.editImgConteiner.appendChild(i),this.stageObj.updateImgStage=new Ll.a.Stage({container:i,width:i.clientWidth,height:i.clientHeight});const n=this.productData.views.filter(e=>e.id==t)[0],r=n.width/this.editImgConteiner.clientWidth,a=this.stageObj.updateImgStage,o=new Ll.a.Layer({x:0,y:0,name:"designLayer"});o.setAttrs({ratio:r,printAreaId:n.printArea.id,viewId:t,softSvg:n.printArea.soft_svg});const s=new Ll.a.Group({x:n.printArea.offset_x/r,y:n.printArea.offset_y/r,width:n.printArea.width/r,height:n.printArea.height/r,name:"designContainerGroup"}),h=new Ll.a.Rect({x:0,y:0,width:n.printArea.width/r,height:n.printArea.height/r,name:"print_area_border_outer"});s.add(h),o.add(s),a.add(o),o.batchDraw(),s.clip({x:0,y:0,width:s.width(),height:s.height()}),e()})}async updateImage({container:t,nodeId:e=0,src:i,callBack:n}){this.editImgConteiner=t,Yl=[];for(const t of this.productData.views){this.stageObj["stage"+t.id].findOne(".designLayer").find(".designImg").forEach(i=>{i.nodeIndex==e&&Yl.push({view:t,oldNode:i,oldNodeAttrs:JSON.parse(JSON.stringify(i.getAttrs())),oldNodeId:i.nodeIndex})})}this.stageObj.updateImgStage?this.destroyTransform({currentStage:this.stageObj.updateImgStage}):await this.createStageForUpdateImage(Yl[0].view.id),this.stageObj.updateImgStage.findOne(".designLayer").find(".designImg").forEach(t=>{t.destroy()});let r=null;if(await this.addImageForUpdateImage(0,Yl[0].oldNode.getAttrs()).then(t=>{r=t,i||this.drawRepeatType(t.getAttrs().tileType,t,t.getAttrs().spacingH,t.getAttrs().spacingV)}),i){let t=r.getAttrs().imageData;await new Promise(e=>{const n=new Image;n.src=i,n.crossOrigin="Anonymous",n.onload=async r=>{t.designImg3=i,t.size={width:n.width,height:n.height},e()}}),await this.replaceImage(r,t,Yl[0].view.id,!0,2,null).then(t=>{r=t}),await this.changeAllLayerImgForUpdateImage(!0,t)}n({node:r,canvasObj:this.viewImgObj})}updateText({nodeId:t=0,text:e,callBack:i}
12){for(const i of this.productData.views){this.stageObj["stage"+i.id].findOne(".designLayer").find(".designText").forEach(i=>{i.nodeIndex==t&&this._updateText(i,e)}),this.cloneStage({viewId:i.id})}i({canvasObj:this.viewImgObj})}async transformEndImage({callBack:t}){await this.changeAllLayerImgForUpdateImage(!1,null),t({canvasObj:this.viewImgObj})}async confirmUpdateImage({galleryData:t,callBack:e}){for(let e of Yl){const i=this.stageObj["stage"+e.view.id].findOne(".designLayer");for(let n of i.find(".designImg"))n.nodeIndex==e.oldNodeId&&await this.replaceImage(n,t,e.view.id,!1,1,null);this.cloneStage({viewId:e.view.id})}e({canvasObj:this.viewImgObj})}async cancelUpdateImage({callBack:t}){for(let t of Yl){const e=this.stageObj["stage"+t.view.id].findOne(".designLayer");for(let i of e.find(".designImg"))i.nodeIndex==t.oldNodeId&&await this.replaceImage(i,t.oldNodeAttrs.imageData,t.view.id,!1,1,t.oldNodeAttrs);this.cloneStage({viewId:t.view.id})}t({canvasObj:this.viewImgObj})}addImageForUpdateImage(t,e){return new Promise(i=>{let n=this.stageObj.updateImgStage,r=n.findOne(".designLayer"),a=r.findOne(".designContainerGroup");Ll.a.Image.fromURL(e.flipImgUrl,o=>{o.setAttrs(e);e.layerScale;const s=this.editImgConteiner.clientWidth/600;o.scaleX(e.scaleX*s),o.scaleY(e.scaleY*s),o.x(this.editImgConteiner.clientWidth/600*o.x()),o.y(this.editImgConteiner.clientWidth/600*o.y()),o.offsetX(o.width()/2),o.offsetY(o.height()/2),o.setAttrs({stageWidth:this.editImgConteiner.clientWidth,layerScale:r.scaleX()}),a.add(o),i(o),r.batchDraw(),this.addTransformer({currentStage:n,node:o,viewId:t}),o.on("transform dragmove",e=>{this.anchorGroupFourceupdate({node:e.target,viewId:t})})})})}async changeAllLayerImgForUpdateImage(t,e){let i=0;for(let n of Yl){i++;const r=this.stageObj["stage"+n.view.id].findOne(".designLayer");for(let a of r.find(".designImg"))if(a.nodeIndex==n.oldNodeId)if(t)await this.replaceImage(a,e,n.view.id,!0,1,null);else{const t=this.stageObj.updateImgStage.findOne(".designLayer").findOne(".designImg");this.diffViewTheSameDesign({currentView:Yl[0].view,associateProductView:n.view,currentRecordData:t.getAttrs(),associateNode:a,type:"image"}),1==i&&this.drawRepeatType(t.getAttrs().tileType,t,t.getAttrs().spacingH,t.getAttrs().spacingV),await this.drawRepeatType(a.getAttrs().tileType,a,a.getAttrs().spacingH,a.getAttrs().spacingV)}this.cloneStage({viewId:n.view.id})}}async restoreElement({viewId:t}){for(let e of this.productData.views)if(e.id==t){this.stageObj["stage"+e.id].findOne(".designLayer").find(".designImg").forEach(async e=>{let i=e.getAttrs().imageData;await this.replaceImage(e,i,t,!1,1,null)})}}destroy(){this.isDestroy=!0;for(let t in this.stageObj)this.stageObj[t].destroy();this.threeDApp.forEach(t=>{t.drawApp.destroy(),t.drawApp=null}),document.body.removeChild(this.container)}reCombinKonvaJson(t,e){return new Promise(async i=>{var n;if(t.length){let r=[],a=0;for(let e of t)e.image&&this.isRisk(e.image)?a++:r.push(e);if(a>0&&console.error("图片信息异常,无法使用"),(t=r)[0].konvaAttrs){for(let e of t)this.konvaJson[e.view_id]||(this.konvaJson[e.view_id]=[]),"design"==e.type&&(e.konvaAttrs.imageData.designImg||(e.konvaAttrs.imageData.designImg=e.image.designImg,e.konvaAttrs.imageData.designImg2=e.image.designImg2,this.needDetailImg?e.konvaAttrs.imageData.designImg3=e.image.designImg:e.konvaAttrs.imageData.designImg3=e.image.designImg3)),this.konvaJson[e.view_id].push({node:e.konvaAttrs,id:e.nodeId,item:e});const r=JSON.parse(JSON.stringify(this.konvaJson));if(e&&e.length)for(let t=0;t<this.productData.views.length;t++){let i=this.productData.views[t];this.konvaJson[i.id]||(this.konvaJson[i.id]=[]);let a=1===e.length?e[0].id:null===(n=e[t])||void 0===n?void 0:n.id;this.konvaJson[i.id]=r[a]?JSON.parse(JSON.stringify(r[a])):[],this.konvaJson[i.id].forEach(i=>{this.diffViewTheSameDesign({currentView:this.productData.views[t],associateProductView:1===e.length?e[0]:e[t],currentRecordData:i.node,associateNodeAttrs:i.node,fromCustomProducts:!0,type:i.node.name.indexOf("designText")?"text":"image"})})}i()}else await this.oldDataRestore(t,this.productData).then(t=>{for(let e of t)this.konvaJson[e.view_id]||(this.konvaJson[e.view_id]=[]),this.konvaJson[e.view_id].push({node:e.konvaAttrs,id:e.id});i()})}else i()})}oldDataRestore(t,e){for(let t of e.views)this.cacheProductPrintAreas.push({id:t.printArea.id,defaultViews:t.id,printArea:t.printArea,config:this.convertDefaultConfig({width:t.printArea.width,height:t.printArea.height})});return new Promise((i,n)=>{let r=[];for(let i of t)if("design"==i.type)this.isRisk(i.image)?console.error("图片信息异常,无法使用"):r.push(new Promise((t,n)=>{Ll.a.Image.fromURL(i.image.designImg3,n=>{let r=0;for(let t of e.views)t.id==i.view_id&&(r=t.width/547);let a=this.imgSizeCalculate({size:i.image.size},i.view_id),o=[];for(let t of i.image.transform.slice(7,i.image.transform.length-1).split(","))o.push(parseFloat(t));n.scaleX(o[0]),n.scaleY(o[3]),n.x(i.image.offset_x/r+i.image.width/r*n.scaleX()/2),n.y(i.image.offset_y/r+i.image.height/r*n.scaleY()/2),n.name("design designImg"),n.addName("design"+n._id),n.addName(""+(1==i.image.isBg?"isBg":"")),n.setAttrs({stageWidth:547,draggable:!0,tileType:i.image.tileType,spacingH:i.image.hspacing,spacingV:i.image.vspacing,xFlip:i.image.xFlip,yFlip:i.image.yFlip,rotation:i.image.rotate,flipImgUrl:i.image.designImg3,maxImgSize:a.viewer
12Size,imageData:Object.assign(i.image,{code:i.image.gallery_id}),render_id:i.image.render_id||"",rendercode:i.image.rendercode||"",historyId:n._id});let s=JSON.parse(JSON.stringify(n.getAttrs()));delete s.image,i.konvaAttrs=s,t()})}));else if("text"==i.type){let t=[],e=i.text.tspans[0];for(let e of i.text.tspans)t.push(e.content);let n=new Ll.a.Label({name:"design designText"});i.konvaAttrs=Object.assign(n.getAttrs(),{designText:t.join("\n"),designFill:i.text.textBg,proStrokeWidth:parseFloat(i.text.strokeWidth),proStroke:i.text.stroke,textColor:e.fill,proFontFamily:e.pFontFamily?e.pFontFamily.slice(1,-1):e.fontFamily.slice(1,-1),proFontSize:e.fontSize,proFontStyle:"",proTextDecoration:"",textAlign:e.textAnchor,stageWidth:547,strokeValue:i.text.strokeValue,oldData:!0,historyId:n._id})}else"bgColor"==i.type&&(i.konvaAttrs={name:"bgRect design",fill:i.color.value});Promise.all(r).finally(()=>{i(t)})})}async addElement(){for(let t of this.productData.views){if(this.konvaJson[t.id])for(let e of this.konvaJson[t.id]){const i=e.node;-1!=i.name.indexOf("designImg")?this.isRisk(i.imageData)?console.error("图片信息异常,无法使用"):(i.flipImgUrl=i.imageData.designImg3,await this.addImage({imageData:i.imageData,viewId:t.id,recordData:i,isSetBg:i.name.indexOf("isBg")>-1,konvaId:e.id,nodeItem:e.item}).then(async t=>{await this.drawRepeatType(t.getAttrs().tileType,t,t.getAttrs().spacingH,t.getAttrs().spacingV)})):-1!=i.name.indexOf("designText")?i.oldData?await this.addText({textNode:i,viewId:t.id,konvaId:e.id}):await this.addText({viewId:t.id,recordData:i,konvaId:e.id}):-1!=i.name.indexOf("bgRect")&&this.addBgColor({color:i.fill,viewId:t.id,konvaId:e.id})}await this.cloneStage({viewId:t.id})}}addImage({imageData:t,viewId:e,isSetBg:i=!1,recordData:n=null,konvaId:r=0,nodeItem:a=null}){return new Promise((o,s)=>{if(this.isDestroy)return;let h=this.stageObj["stage"+e].findOne(".designLayer"),c=h.findOne(".designContainerGroup"),l=h.getAttrs().ratio,u=0,d=0,p=n?n.flipImgUrl:t.designImg3;Ll.a.Image.fromURL(p,s=>{let p=this.imgSizeCalculate(t,e);if(u=p.width,d=p.height,n){s.setAttrs(n),s.setAttrs({widthMM:u,heightMM:d}),s.name(`design designImg design${s._id} template`);let t=n.layerScale||1;const i=this.containerWidth/100;let r=[];for(let t of a.image.transform.slice(7,a.image.transform.length-1).split(","))r.push(parseFloat(t));let o={w:u*r[0],h:d*r[3]};if(u==a.image.width&&d==a.image.height||(o.w=parseFloat(a.image.width)*r[0],o.h=parseFloat(a.image.height)*r[3]),s.scaleX(o.w/n.ratio/s.width()*i),s.scaleY(o.h/n.ratio/s.height()*i),s.x(this.containerWidth/(n.stageWidth/t)*s.x()),s.y(this.containerWidth/(n.stageWidth/t)*s.y()),null!=this.associateProductView){const t=this.productData.views.filter(t=>t.id==e)[0];this.diffViewTheSameDesign({currentView:t,associateProductView:this.associateProductView,currentRecordData:n,associateNode:s,t
12ype:"image"})}s.offsetX(s.width()/2),s.offsetY(s.height()/2),s.setAttrs({initScaleX:u/l/s.width(),initScaleY:d/l/s.height()})}if(i&&s.addName("isBg"),s.nodeIndex=r,c.add(s),!this.needDetailImg){let t=this.ncYSRemind({node:s});s.picException=t}o(s),h.batchDraw()})})}addText({textNode:t=null,viewId:e,recordData:i=null,konvaId:n=0}){return new Promise(async(t,r)=>{await Jl(i.proFontFamily);let a=this.getCurStageLayer({viewId:e}),o=a.layer,s=a.designContainerGroup,h=null,c=null,l=null;if(i){i.scaleX||(i.scaleX=1,i.scaleY=1),h=new Ll.a.Text({text:i.designText,fontSize:i.proFontSize,fill:i.textColor,wrap:"char",fontFamily:i.proFontFamily,fontStyle:i.proFontStyle,textDecoration:i.proTextDecoration,strokeWidth:i.proStrokeWidth,stroke:i.proStroke,verticalAlign:"bottom"}),c=new Ll.a.Group,c.name(`design designText design${c._id} template`);let t=i.layerScale||1,n=this.containerWidth/i.stageWidth;if(i.scaleX=i.scaleX*n*t/o.scaleX(),i.scaleY=i.scaleY*n*t/o.scaleX(),c.setAttrs(i),c.label=Kl({str:h.text(),type:3}),c.strokeValue=i.strokeValue,c.x(n*t*c.x()/o.scaleX()),c.y(n*t*c.y()/o.scaleX()),null!=this.associateProductView){const t=this.productData.views.filter(t=>t.id==e)[0];this.diffViewTheSameDesign({currentView:t,associateProductView:this.associateProductView,currentRecordData:i,associateNode:c,type:"text"})}l=new Ll.a.Rect({width:h.width(),height:h.height(),listening:!1,strokeScaleEnabled:!1,fill:i.designFill}),c.add(l),c.add(h)}c.nodeIndex=n,s.add(c),o.batchDraw(),t(c)})}addBgColor({color:t,viewId:e,konvaId:i=0}){return new Promise(n=>{if(this.isDestroy)return;let r=this.getCurStageLayer({viewId:e}),a=r.layer,o=r.designContainerGroup,s=null;a.findOne(".bgRect")?t&&"transparent"!=t?a.findOne(".bgRect").fill(t):a.findOne(".bgRect").destroy():(s=new Ll.a.Rect({x:0,y:0,width:a.findOne(".print_area_border_outer").width(),height:a.findOne(".print_area_border_outer").height(),fill:t,name:"bgRect design template",listening:!1}),s.addName("design"+s._id),o.add(s),s.moveToBottom(),s.nodeIndex=i),a.batchDraw(),n(a.findOne(".bgRect"))})}drawRepeatType(t,e,i,n){return new Promise((r,a)=>{if(this.isDestroy)return;e.setAttrs({tileType:t,spacingH:i,spacingV:n});let o=e.getLayer();const s=e.getStage();let h=s.findOne(".designContainerGroup");if(!t)return s.findOne(".repeatImgGroup"+e._id)&&(e.moveTo(h),e.zIndex(s.findOne(".repeatImgGroup"+e._id).getZIndex()),s.findOne(".repeatImgGroup"+e._id).destroy(),o.batchDraw()),void r();let c=this.getRotateNodePoint({node:e,layer:o}),l=document.createElement("canvas");l.width=3*s.findOne(".print_area_border_outer").width(),l.height=3*s.findOne(".print_area_border_outer").height();let u=3*Math.abs(e.width()*e.scaleX()),d=3*Math.abs(e.height()*e.scaleY()),p=l.getContext("2d"),f=new Image;f.setAttribute("crossOrigin","anonymous"),f.src=e.getAttrs().flipImgUrl,f.onload=function(){let a=o.getAttrs().ratio,m=i/a*3,g=n/a*3,v=m/2,y=g/2,x=document.createElement("canvas"),b=x.getContext("2d");"basicsTile"==t?(x.width=u+m,x.height=d+g,b.save(),b.drawImage(f,v,y,u,d),b.restore(),b.save(),b.drawImage(f,u+3*v,y,u,d),b.restore(),b.save(),b.drawImage(f,v,d+3*y,u,d),b.restore(),b.save(),b.drawImage(f,u+3*v,d+3*y,u,d),b.restore()):"Mirror"==t?(x.width=2*(u+m),x.height=2*(d+g),b.save(),b.drawImage(f,x.width/2+v,x.height/2+y,u,d),b.restore(),b.save(),b.scale(-1,1),b.drawImage(f,-x.width/2+v,x.height/2+y,u,d),b.restore(),b.save(),b.scale(1,-1),b.drawImage(f,x.width/2+v,-x.height/2+y,u,d),b.restore(),b.save(),b.scale(-1,-1),b.drawImage(f,-x.width/2+v,-x.height/2+y,u,d),b.restore()):"XSpacedTile"==t?(x.width=2*(u+m),x.height=2*(d+g),b.save(),b.drawImage(f,-u/2,y,u,d),b.restore(),b.save(),b.drawImage(f,u/2+2*v,y,u,d),b.restore(),b.save(),b.drawImage(f,1.5*u+4*v,y,u,d),b.restore(),b.save(),b.drawImage(f,v,d+3*y,u,d),b.restore(),b.save(),b.drawImage(f,u+3*v,d+3*y,u,d),b.restore()):"YSpacedTile"==t&&(x.width=2*(u+m),x.height=2*(d+g),b.save(),b.drawImage(f,v,-.5*d,u,d),b.restore(),b.save(),b.drawImage(f,v,.5*d+2*y,u,d),b.restore(),b.save(),b.drawImage(f,v,1.5*d+4*y,u,d),b.restore(),b.save(),b.drawImage(f,u+3*v,y,u,d),b.restore(),b.save(),b.drawImage(f,u+3*v,d+3*y,u,d),b.restore(
12));let _=p.createPattern(x,"repeat"),w=Math.sqrt(Math.pow(u,2)+Math.pow(d,2))/2,M=Math.atan(d/u),S=e.rotation()*Math.PI/180+M,T=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix();_.setTransform(T.translate(3*c.VCenter,3*c.HCenter).translate(w*Math.cos(S),w*Math.sin(S)).rotate(e.rotation()).translate(.5*m,.5*g)),p.fillStyle=_,p.fillRect(0,0,l.width,l.height);let E=l.toDataURL("image/png",1),A=new Image;A.src=E,A.onload=function(){s.findOne(".repeatImgGroup"+e._id)&&(e.moveTo(h),e.zIndex(s.findOne(".repeatImgGroup"+e._id).getZIndex()),s.findOne(".repeatImgGroup"+e._id).destroy());let t=new Ll.a.Image({x:0,y:0,image:A,name:"repeatImg"+e._id,scaleX:1/3,scaleY:1/3}),i=new Ll.a.Group({x:0,y:0,name:"repeatImgGroup repeatImgGroup"+e._id});h.add(i),i.add(t),i.zIndex(e.getZIndex()),e.moveTo(i),o.batchDraw(),r()}}})}async cloneStage({viewId:t,cloneViewLength:e=0}){return new Promise(async e=>{if(!this.isDestroy){for(let e of this.viewImgObj)if(e.id==t){let i=this.getCurStageLayer({viewId:t}).designContainerGroup.clone();i.findOne(".print_area_border_outer").destroy();let n=null,r=null;for(let e of this.productData.views)e.id==t&&(r=e,n=e.printArea);e.viewDesign=i.toDataURL({mimeType:"image/png",quality:1,x:i.x(),y:i.y(),width:i.width(),height:i.height()}),e.viewDesignCanvas=i.toCanvas({x:0,y:0,width:this.containerWidth,height:this.containerWidth}),i.destroy()}if(this.needDetailImg)if(this.cloneViewLength+=1,this.cloneViewLength==this.productData.views.length){let t=[];for(let e of this.indexList){let i=null;i=this.curColorId?this.productData.colors.find(t=>t.id==this.curColorId):this.productData.colors[0],await this.updateCurrentDetail(e,i).then(e=>{t.push(e)})}this.detailImgList=t,e(""),this.cloneViewLength=0}else e("");else e("")}})}updateCurrentDetail(t,e){return new Promise(async(i,n)=>{if(this.isDestroy)return;let r;if(e.detail)if("master"==t){const t=e.detail.findIndex(t=>1===t.master);r=-1!=t?e.detail[t]:e.detail[0]}else r=e.detail[t];else r="master"==t?e.views[0]:e.views[t];let a={};if(1==r.isUserDefined){a.boardArr=[],a.baseWidth=r.base_width,a.boardImg="";for(let t of r.detail)a.boardArr.push({maskImg:t.texture,image:t.image,bgColor:t.bgColor,type:t.parts?t.parts[0].type:null,transform:t.transform,left:0,top:0,width:r.base_width,height:r.base_width,radius:0,isText:3==t.type,detail:t,layoutId:t.layoutId})}if(this.productData.hasDetail)if(1==r.isUserDefined){let e=0;for(let i of r.detail)1!=i.type&&2!=i.type||i.parts&&await this.createDetailCanvas({detailImg:i,baseWidth:r.base_width,renderIndex:t,borderIndex:e}).then(t=>{a.boardArr[e].canvasImgArr=t.canvasArr}),e+=1;await this.drawBoardImg({detailImages:a,baseWidth:r.base_width}),i({isUserDefined:1,boardImg:a.boardImg})}else this.createDetailCanvas({detailImg:r,baseWidth:this.productData.base_width,renderIndex:t}).then(t=>{i(t)});else for(let t of this.viewImgObj)if(t.id==r.id){let t=this.getCurStageLayer({viewId:r.id}),e=t.layer,n=t.designContainerGroup.clone();n.findOne(".print_area_border_outer").destroy();let o=e.getAttrs().ratio,s=null,h=null;for(let t of this.productData.views)t.id==r.id&&(h=t,s=t.printArea);let c=700/(this.containerWidth/e.scaleX());s&&s.soft_svg&&await new Promise((t,e)=>{n.clipFunc(e=>{e.save(),e.translate(-n.x(),-n.y()),e.scale(1/o,1/o),new Ll.a.Path({data:s.soft_svg,stroke:"",strokeWidth:1})._sceneFunc(e),e.restore(),t()});let i=n.toCanvas();n._drawChildren("drawScene",i,"top")});let l=n.toDataURL({x:0,y:0,pixelRatio:c,width:this.containerWidth/e.scaleX(),height:this.containerWidth/e.scaleX()});if(n.destroy(),1==r.isUserDefined){let t=0;for(let e of r.detail)a.boardArr[t].canvasImgArr=[l],t+=1;await this.drawBoardImg({detailImages:a,baseWidth:r.base_width}),i({isUserDefined:1,boardImg:a.boardImg})}else i({image:r.image,maskImg:r.texture,canvasArr:[l]})}})}createDetailCanvas({detailImg:t,baseWidth:e,renderIndex:i,borderIndex:n=null}){return new Promise((r,a)=>{let o={image:t.image,maskImg:t.texture,canvasArr:[]},s=t.parts,h=[],c=[],l=!1;for(let r of s)if(0==r.type){for(let t of this.viewImgObj)if(t.id==r.target_view_id){let e=r.canvas_config,i=this.getViews(r.target_view_id);const n=this.initCanvas(e,t.viewDesign,i.printArea,r.mask.image_url,
12i).then(t=>{h.push(t)});c.push(n);break}}else if(1==r.type)o.maskImg=r.cover_img.image_url;else if(2==r.type&&r.detail3D){if(l)continue;l=!0;const r=this.create3DDetail(t,e,i,n).then(t=>{h.push(t)});c.push(r)}Promise.all(c).finally(()=>{o.canvasArr=h,r(o)})})}initCanvas(t,e,i,n,r){return new Promise((r,a)=>{let o=document.createElement("canvas");o.width=600,o.height=600;let s,h,c=o.getContext("2d"),l=[],u=new Image;u.setAttribute("crossOrigin","anonymous"),u.src=e,n&&(h=new Image,h.setAttribute("crossOrigin","anonymous"),h.src=n);let d=parseInt((i.width/i.viewWidth*600).toString()),p=parseInt((i.height/i.viewWidth*600).toString()),f=Dl.createMapMesh(d,p,16,16);function m(){let t=o.toDataURL("image/png",1);r(t)}function g(){c.save(),c.globalCompositeOperation="destination-in",c.drawImage(h,0,0,600,600),c.restore()}u.onload=function(){let e=d,r=p,a=parseInt((i.offset_x/i.viewWidth*600).toString()),v=parseInt((i.offset_y/i.viewWidth*600).toString())||.5;l=[{x:a,y:v},{x:a+e,y:v},{x:a+e,y:v+r},{x:a,y:v+r}],s=[{x:a,y:v},{x:a+e,y:v},{x:a+e,y:v+r},{x:a,y:v+r}],f.move(a,v),t&&(l=JSON.parse(t)),function(){let t,e,i;c.clearRect(0,0,o.width,o.height),t=[s[0].x,s[0].y,s[1].x,s[1].y,s[2].x,s[2].y,s[3].x,s[3].y],e=[l[0].x,l[0].y,l[1].x,l[1].y,l[2].x,l[2].y,l[3].x,l[3].y],i=Rl(t,e);for(let t=0;t<f.points.length;t++){let e=i.transform(f.points[t].x,f.points[t].y);f.points[t].x=e[0],f.points[t].y=e[1]}null==navigator.userAgent.toLowerCase().match(/version\/([\d.]+).*safari/)?c.globalCompositeOperation="destination-atop":c.globalCompositeOperation="lighter";f.drawImageToContext(u,c),n?h.complete?(g(),m()):h.onload=function(){g(),m()}:m()}()}})}async create3DDetail(t,e,i,n){const r=t.parts;let a={};for(let t of this.viewImgObj)a[t.id]=t.viewDesignCanvas;const o=r.length;let s=o;for(let t of this.threeDApp)s+=t.modelNum;let h=s-10;if(h>=0)for(let t=0;t<this.threeDApp.length;t++){const e=this.threeDApp[t];h-=e.modelNum;let i=e.drawApp;if(i.destroy(),i=null,this.threeDApp.splice(t,1),t--,h<=0)break}let c="";c=this.curColorId?this.productData.code+"-"+this.curColorId+"-"+i+"-"+n:this.productData.code+"-"+i+"-"+n;let l=null;for(let t of this.threeDApp)if(t.code==c){l=t.drawApp;break}return new Promise((t,i)=>{if(l)l.updateFaceListMap(a,e=>{t(e)});
12else{const i=new Al({baseWidth:e,canvasSize:600,modelOptions:r,faceListMap:a,staticPath:`//${location.host}/static/images/`,canvas:null,container:null,type:5,decoderPath:"/static/admin/plugin/three/draco/",callBack(e){t(e)}});this.threeDApp.push({code:c,drawApp:i,modelNum:o})}})}getViews(t){for(var e,i=0;i<this.productData.views.length;i++)if(this.productData.views[i].id==t){e=this.productData.views[i];break}return e}async drawBoardImg({detailImages:t,baseWidth:e}){let i=document.createElement("canvas");i.width=e,i.height=e;let n=i.getContext("2d");for(let e of t.boardArr){if(5==e.detail.type)break;if(n.save(),!e.bgColor&&!e.isText){const i=t.boardArr.findIndex(t=>5==t.detail.type);if(-1!=i)for(let r of t.boardArr[i].detail.layoutData)r.layoutId==e.layoutId&&(this.radiusRect(parseFloat(r.x),parseFloat(r.y),parseFloat(r.width),parseFloat(r.height),parseFloat(r.radius),n),n.clip())}e.transform||(e.transform="matrix(1,0,0,1,0,0)");let i=e.transform.substring(7,e.transform.length-1).split(",");if(n.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.bgColor)n.fillStyle=e.bgColor,n.fillRect(e.left,e.top,e.width,e.height);else if(e.isText)await this.drawText({data:e.detail,ctx:n});else{if(e.image&&await this.drawImage({url:e.image,data:e,ctx:n}),e.canvasImgArr)for(let t of e.canvasImgArr)await this.drawImage({url:t,data:e,ctx:n});e.maskImg&&await this.drawImage({url:e.maskImg,data:e,ctx:n})}n.restore()}t.boardImg=i.toDataURL()}radiusRect(t,e,i,n,r,a){const o=Math.PI;a.beginPath(),a.arc(t+r,e+r,r,-o,-o/2),a.arc(t+i-r,e+r,r,-o/2,0),a.arc(t+i-r,e+n-r,r,0,o/2),a.arc(t+r,e+n-r,r,o/2,o),a.closePath()}drawImage({url:t,data:e,ctx:i}){return new Promise((n,r)=>{let a=new Image;a.src=t,a.setAttribute("crossOrigin","anonymous"),a.onload=()=>{i.drawImage(a,0,0,e.width,e.height),n()},a.onerror=()=>{r()}})}drawText({data:t,ctx:e}){return new Promise(async i=>{await Jl(t.tspans[0].pFontFamily),e.textAlign=t.tspans[0].textAnchor,e.fillStyle=t.tspans[0].fill,e.strokeStyle=t.strokeValue,e.font=`${t.tspans[0].fontSize} ${t.tspans[0].fontFamily}`,e.lineWidth=t.strokeWidth,e.lineJoin="round",t.tspans.map((i,n)=>{e.fillText(i.content,i.x,i.y),parseFloat(t.strokeWidth)&&e.strokeText(i.content,i.x,i.y)}),i()})}flipImage({data:t,node:e,viewId:i,isReduction:n=!1,isClick:r=!1}){return new Promise((a,o)=>{const s=this;let h=e.width(),c=e.height(),l=document.createElement("canvas");l.width=h,l.height=c;let u=l.getContext("2d"),d=new Image;d.setAttribute("crossOrigin","anonymous"),d.src=e.getAttrs().flipImgUrl,d.onload=function(){"leftRightMirror"==t.data?(r&&e.setAttrs({xFlip:!e.getAttrs().xFlip}),u.scale(-1,1),u.drawImage(d,-l.width,0,l.width,l.height)):"upDownMirror"==t.data&&(r&&e.setAttrs({yFlip:!e.getAttrs().yFlip}),u.scale(1,-1),u.drawImage(d,0,-l.height,l.width,l.height));let o=l.toDataURL(),h=new Image;h.onload=function(){e.image(h);let t=JSON.parse(JSON.stringify(e.getAttrs().imageData));t.designImg=o,t.designImg3=o,e.setAttrs({flipImgUrl:o,imageData:t}),a(),n||(e.getLayer().batchDraw(),s.drawRepeatType(e.getAttrs().tileType,e,e.getAttrs().spacingH,e.getAttrs().spacingV).then(()=>{s.cloneStage({viewId:i})}))},h.src=o}})}changeImageFilter(t){return new Promise((e,i)=>
12{let{render_code:n,params:r,node:a}=t;n?Ml.a.get(`${jl}/v1/Render/${n}`,{params:r}).then(t=>{"success"==t.data.code&&(a.setAttrs({filterType:n,rendercode:n,render_id:t.data.data.render_id}),e(t.data))}):(a.setAttrs({filterType:"",rendercode:"",render_id:""}),e(null))})}replaceFilter({viewId:t=this.viewId,node:e,url:i}){return new Promise((n,r)=>{let a=this.getCurStageLayer({viewId:t}),o=a.layer,s=new Image;s.src=i,s.crossOrigin="Anonymous",s.onload=()=>{let r=e.width(),h=e.height();e.image(s),e.setAttrs({flipImgUrl:i,scaleX:e.scaleX()/(s.width/r),scaleY:e.scaleY()/(s.height/h),initScaleX:e.getAttrs().widthMM/o.getAttrs().ratio/s.width,initScaleY:e.getAttrs().heightMM/o.getAttrs().ratio/s.height,offsetX:s.width/2,offsetY:s.height/2}),o.batchDraw(),n({node:e,curS:a,viewId:t})}})}replaceImage(t=null,e,i,n,r,a){return new Promise(o=>{if(this.isDestroy)return;const s=this,h=(1==r?this.stageObj["stage"+i]:this.stageObj.updateImgStage).findOne(".designLayer").getAttrs().ratio,c=t.getAttrs(),l=e,u=this.imgSizeCalculate(l,i),d=u.width||0,p=u.height||0,f=t.width()*t.scaleX(),m=t.height()*t.scaleY(),g=(f>m?f:m)/((d>p?d:p)/h),v=new Image;v.src=l.designImg3,v.crossOrigin="Anonymous",v.onload=async()=>{if(t.image(v),t.scaleX(g*(d/h/v.width)),t.scaleY(g*(p/h/v.height)),t.offsetX(v.width/2),t.offsetY(v.height/2),t.setAttrs({flipImgUrl:l.designImg3}),a&&(t.scaleX(a.scaleX),t.scaleY(a.scaleY),t.x(a.x),t.y(a.y),t.rotation(a.rotation)),n||t.setAttrs({initScaleX:d/h/v.width,initScaleY:p/h/v.height,widthMM:d,heightMM:p,maxImgSize:u.viewerSize,imageData:l}),c.xFlip&&(await s.flipImage({data:{data:"leftRightMirror"},node:t,viewId:i,isReduction:!0}),t.setAttr("xFlip",!0)),c.yFlip&&(await s.flipImage({data:{data:"upDownMirror"},node:t,viewId:i,isReduction:!0}),t.setAttr("yFlip",!0)),!n&&c.render_id){let e=await s.changeImageFilter({node:t,render_code:c.rendercode,params:{gallery_id:l.code,xFlip:c.xFlip?1:0,yFlip:c.yFlip?1:0}});e&&e.data&&e.data.url2&&await s.replaceFilter({url:e.data.url2,viewId:i,node:t})}await this.drawRepeatType(t.getAttrs().tileType,t,t.getAttrs().spacingH,t.getAttrs().spacingV),o(t)}})}_updateText(t=null,e){let i=t.findOne("Text");i.text(e.trim()),t.width(i.width()),t.height(i.height()),t.offsetX(i.width()/2),t.offsetY(i.height()/2),t.findOne("Rect").width(i.width()),t.findOne("Rect").height(i.height()),t.label=Kl({str:t.findOne("Text").text(),type:3})}addTemplate({templateData:t,indexList:e,colorId:i,callBack:n}){e&&(this.indexList=e,this.curColorId=i);let r=[];this.deleteTemplateNode(),this.konvaJson={},this.reCombinKonvaJson(t.cfg,t.views),r.push(this.addElement()),Promise.all(r).then(async()=>{if(1==this.useType)n(this.viewImgObj);else if(e){let t=[];for(let e of this.detailImgList)if(e.isUserDefined)t.push(e.boardImg);else{let i=document.createElement("canvas");i.width=600,i.height=600;let n=i.getContext("2d");await this.imageOnload(e.image,n);for(let t of e.canvasArr)await this.imageOnload(t,n);await this.imageOnload(e.maskImg,n),t.push(i.toDataURL())}n(t)}else{for(let t of this.detailImgList){let e=document.createElement("canvas");e.width=600,e.height=600;let i=e.getContext("2d");i.fillStyle="rgba(0,0,0,.04)",i.fillRect(0,0,e.width,e.height),await this.imageOnload(t.image,i);for(let e of t.canvasArr)await this.imageOnload(e,i);await this.imageOnload(t.maskImg,i),t.image="",t.maskImg="",t.canvasArr=[e.toDataURL()]}n(this.detailImgList)}})}imageOnload(t,e){return new Promise(i=>{if(""!=t){const n=new Image;n.src=t,n.setAttribute("crossOrigin","anonymous"),n.onload=function(t){e&&e.drawImage(n,0,0,600,600),i("")},n.onerror=function(){i("")}}else i("")})}async getDetailImage({indexList:t,colorId:e,callBack:i}){this.indexList=t,this.curColorId=e;for(let t of this.productData.views)await this.cloneStage({viewId:t.id});let n=[];for(let t of this.detailImgList)if(t.isUserDefined)n.push(t.boardImg);else{let e=document.createElement("canvas");e.width=600,e.height=600;let i=e.getContext("2d");await this.imageOnload(t.image,i);for(let e of t.canvasArr)await this.imageOnload(e,i);await this.imageOnload(t.maskImg,i),n.push(e.toDataURL())}i(n)}diffViewTheSameDesign({currentView:t,associateProductView:e,currentRecordData:i,associateNode:n=null,associateNodeAttrs:r=null,fromCustomProducts:a=!1,type:o="image"}){let s=i.layerScale||1;const h=t,c=a?1:this.containerWidth/i.stageWidth,l=e.width/(i.stageWidth/s),u=e.printArea.offset_x-h.printArea.offset_x*(e.width/h.width),d=e.printArea.offset_y-h.printArea.offset_y*(e.width/h.width),p={scaleX:"text"==o?i.scaleX:i.scaleX*c,scaleY:"text"==o?i.scaleY:i.scaleY*c,x:(i.x+u/l)*c,y:(i.y+d/l)*c,rotation:i.rotation};n?n.setAttrs({scaleX:p.scaleX,scaleY:p.scaleY,x:p.x,y:p.y,rotation:p.rotation}):r&&(r.scaleX=p.scaleX,r.scaleY=p.scaleY,r.x=p.x,r.y=p.y,r.rotation=p.rotation,r.ratio=e.width/100)}ncYSRemind({node:t}){if(!t.getLayer())return;const e=t.getLayer().getAttrs(),i=Math.abs(t.scaleX()),n=Math.abs(t.scaleY());let r=t.getAttrs().maxImgSize,a=t.width()*i*e.ratio,o=t.height()*n*e.ratio,s={text:"",title:"",bgColor:"",type:0},h={text:"",title:"",bgColor:"",type:0};if(a>r.width||o>r.height){var c=a/r.width,l=o/r.height,u=Math.max(c,l);u>1.01&&u<=1.5?(s.text="图片像素不足放大,轻微影响生产印刷清晰度!",s.title="图片轻微模糊",s.bgColor="#f5cf52",s.type=1):u>1.5&&u<=2?(s.text="图片像素不足放大,比较影响生产印刷清晰度!",s.title="图片比较模糊",s.bgColor="#ff9902",s.type=2):u>2&&(s.text="图片像素不足放大,严重影响生产印刷清晰度!",s.title="图片严重模糊",s.bgColor="#fe2c25",s.type=3)}var d,p=r.width/r.height,f=a/o;return(d=p>f?p/f:f/p)>=1.09&&d<1.5?(h.text="图片拉伸变形指数1-1.5倍,请注意已经导致图案变形!",h.title="图片轻微变形",h.bgColor="#f5cf52",h.type=1):d>=1.5&&d<2?(h.text="图片拉伸变形指数1.5-2倍,请注意已经导致图案变形!",h.title="图片比较变形",h.bgColor="#ff9902",h.type=2):d>=2&&(h.text="图片拉伸变形指数2倍以上,请注意图案变形严重!",h.title="图片严重变形",h.bgColor="#fe2c25",h.type=3),{isVagueData:s,transformData:h}}textAttrToLabel({node:t}){let e=t.getLayer(),i=JSON.parse(JSON.stringify(t.getAttrs())),n=t.findOne("Text");return i.designText=n.text(),i.designFill=t.findOne("Rect").fill(),i.proStrokeWidth=n.strokeWidth(),i.proStroke=n.stroke(),i.textColor=n.fill(),i.proFontFamily=n.fontFamily(),i.proFontSize=n.fontSize(),i.proFontStyle=n.fontStyle(),i.proTextDecoration=n.textDecoration(),i.textAlign=n.align(),i.stageWidth=this.containerWidth*e.scaleX(),i.layerScale=e.scaleX(),i.strokeValue=t.strokeValue,i}
12getSaveData({isSaveProduct:t=!0,callBack:e}){this.imgFullAllDesign();let i=this.getProductConfiguration({viewId:this.viewId,isSaveProduct:t});i.is_overspread=this.saveProductObj.is_overspread,i.is_vague=this.saveProductObj.is_vague;let n=i.cfgs||[];for(let t=0;t<n.length;t++){let e=n[t];"design"==e.type&&(e.image.designImg2="")}e(i)}deleteTemplateNode(){for(let t in this.stageObj){let e=this.stageObj[t].findOne(".designLayer");e.find(".design").forEach(t=>{t.destroy(),e.find(".repeatImgGroup"+t._id).destroy()})}}imgFullAllDesign(){return new Promise((t,e)=>{let i=this.getProductConfiguration(),n=this.productData.views.length,r=[],a=[],o={},s=JSON.parse(JSON.stringify(i.cfgs));for(let t=0;t<n;t++){let e=this.productData.views[t].id,i=this.productData.views[t].name,n=this.getCurStageLayer({viewId:e}).layer,a=n.findOne(".print_area_border_outer");n.find(".designImg").forEach(t=>{t.picException.isVagueData&&t.picException.isVagueData.text&&r.push(e)});for(let t of n.find(".designImg"))if(t.visible()&&1==this.productData.imgFull){let r=this.getRotateNodePoint({node:t,layer:n}),h=r.VStart,c=r.HStart,l=r.VEnd,u=r.HEnd;null==o[e]&&(o[e]={viewName:i,leftNum:h,topNum:c,rightNum:l,bottomNum:u,printAreaWidth:a.width(),printAreaHeight:a.height()});let d=s.findIndex(t=>t.view_id==e);-1!=d&&("bgColor"==s[d].type||s[d].image&&""!=s[d].image.tileType)&&(o[e].leftNum=0,o[e].topNum=0,o[e].rightNum=a.width(),o[e].bottomNum=a.height()),h<o[e].leftNum&&(o[e].leftNum=h),c<o[e].topNum&&(o[e].topNum=c),l>o[e].rightNum&&(o[e].rightNum=l),u>o[e].bottomNum&&(o[e].bottomNum=u),s.splice(d,1)}}let h=[];for(let t in o){o[t].leftNum<0&&(o[t].leftNum=0),o[t].topNum<0&&(o[t].topNum=0),o[t].rightNum>o[t].printAreaWidth&&(o[t].rightNum=o[t].printAreaWidth),o[t].bottomNum>o[t].printAreaHeight&&(o[t].bottomNum=o[t].printAreaHeight);let e=(o[t].rightNum-o[t].leftNum)/o[t].printAreaWidth,i=(o[t].bottomNum-o[t].topNum)/o[t].printAreaHeight;(e<.98||i<.98)&&h.push(""+o[t].viewName.substr(0,1))}h.length>0&&(this.saveProductObj.is_overspread=-1);for(let t of this.productData.views)r.some(e=>t.id==e)&&a.push(""+t.name.substr(0,1));a.length>0&&(this.saveProductObj.is_vague=1),t()})}getProductConfiguration({viewId:t=0,isSaveProduct:e=!0}={}){var i=this.productData.views,n=[],r={color_id:"",view_id:"",product_type_id:"",cfgs:[]};for(let t of i){let i=this.stageObj["stage"+t.id].findOne(".designLayer"),r=i.find(".designImg")||[],a=i.find(".designText")||[],o=i.find(".bgRect")||[];if(r.length+a.length+o.length>0){for(let e of o)if(e.visible()){let r=Ql({color:e.fill()}),a=Object.assign({},e.getAttrs(),{stageWidth:this.containerWidth*i.scaleX(),layerScale:i.scaleX()});n.push({color:{value:r.value,fillOpacity:r.alpha},print_area_id:i.getAttrs().printAreaId,view_id:t.id,type:"bgColor",konvaAttrs:a})}for(let r of i.find(".design"))r.visible()&&r.hasName("designImg")?n.push(this.getDesignesConfiguration({node:r,viewId:t.id,layer:i,isSaveProduct:e})):r.visible()&&r.hasName("designText")&&n.push(this.getTextConfiguration({node:r,viewId:t.id,layer:i}))}}return r.cfgs=n,r}getDesignesConfiguration({node:t,viewId:e,layer:i,isSaveProduct:n}){let r=JSON.parse(JSON.stringify(t.getAttrs())),a=i.getAttrs();const o=a.ratio*t.width()/r.widthMM,s=a.ratio*t.height()/r.heightMM;let h=t.getTransform().copy();h.scale(o,s),h.m[4]=h.m[4]*a.ratio,h.m[5]=h.m[5]*a.ratio;let c=function(t,e){let i=new Ll.a.Transform;i.rotate(e);let n=i.copy().invert().multiply(t);return{gTransform:`matrix(${i.m[0]}, ${i.m[1]}, ${i.m[2]}, ${i.m[3]}, ${i.m[4]}, ${i.m[5]})`,transform:`matrix(${n.m[0]}, ${n.m[1]}, ${n.m[2]}, ${n.m[3]}, ${n.m[4]}, ${n.m[5]})`}}(h,t.rotation()*Math.PI/180);delete r.image,n&&(r.imageData.designImg="",r.imageData.designImg2="",r.imageData.designImg3=""),r.stageWidth=this.containerWidth*i.scaleX(),r.layerScale=i.scaleX();let l={image:{gallery_id:r.imageData.code,designImg2:r.flipImgUrl,transform:c.transform,gTransform:c.gTransform,height:r.heightMM,width:r.widthMM,opacity:1,tileType:r.tileType,hspacing:r.spacingH,vspacing:r.spacingV,isBg:t.hasName("isBg")?1:0,offset_x:(t.x()-t.width()*Math.abs(t.scaleX())/2)*a.ratio,offset_y:(t.y()-t.height()*Math.abs(t.scaleY())/2)*a.ratio,rotate:t.rotation(),name:r.imageData.name,size:r.imageData.size,rendercode:r.rendercode||"",render_id:r.render_id||"",xFlip:r.xFlip,yFlip:r.yFlip,risk_gallery:r.imageData.risk_gallery,risk_
12word:[]},dpi:100,view_id:e,print_area_id:a.printAreaId,type:"design",konvaAttrs:r};return n&&(r.flipImgUrl=""),l}getTextConfiguration({node:t,viewId:e,layer:i}){let n=t.findOne("Text");t.setAttrs(this.textAttrToLabel({node:t}));let r=JSON.parse(JSON.stringify(t.getAttrs())),a=i.getAttrs(),o=t.getTransform(),s=this.getRotateNodePoint({node:t,layer:i}),h=JSON.parse(JSON.stringify(o.m)),c=t.rotation()*Math.PI/180;r.stageWidth=this.containerWidth*i.scaleX(),r.layerScale=i.scaleX();let l=[],u=0,d="start";for(let e=0;e<n.text().split("\n").length;e++){let i=n.text().split("\n")[e],o=new Ll.a.Text({text:i,scaleX:r.scaleX,scaleY:r.scaleY,fontSize:n.fontSize()});0==e&&(h[4]=(h[4]-o.height()*t.scaleY()*Math.sin(c))*a.ratio,h[5]=(h[5]+o.height()*t.scaleY()*Math.cos(c))*a.ratio);let s=r.width;switch(n.align()){case"left":u=0,d="start";break;case"center":u=s/2*a.ratio,d="middle";break;case"right":u=s*a.ratio,d="end"}let p=Ql({color:n.fill()});l.push({content:i,fill:p.value,fillOpacity:p.alpha,fontFamily:n.fontFamily(),fontSize:n.fontSize()*a.ratio+"px",fontStyle:-1!=n.fontStyle().indexOf("italic")?"italic":"",fontWeight:-1!=n.fontStyle().indexOf("bold")?"bold":"",textDecoration:n.textDecoration(),textAnchor:d,x:u,y:0==e?0:o.height()*Math.abs(t.scaleY())*e*a.ratio/Math.abs(t.scaleY())})}let p=Ql({color:n.stroke()});return{text:{tspans:l,x:0,y:0,transform:`matrix(${h.join(",")})`,gTransform:"matrix(1,0,0,1,0,0)",handleGroupTransform:"matrix(1,0,0,1,0,0)",width:s.width*a.ratio,height:s.height*a.ratio,textBg:Ql({color:t.findOne("Rect").fill()}).value,textBgX:0,textBgY:0,textBgWidth:0,textBgheight:0,stroke:p.value,strokeOpacity:p.alpha,strokeWidth:n.strokeWidth()*a.ratio+"px",strokeValue:t.strokeValue,strokeMiterLimit:10},dpi:100,print_area_id:a.printAreaId,view_id:e,type:"text",konvaAttrs:r}}addTransformer({currentStage:t,node:e,viewId:i}){let n=t.findOne(".designLayer"),r=n.findOne(".designContainerGroup"),a=this.getRotateNodePoint({node:e,layer:t.findOne(".designLayer")});Wl=new Ll.a.Group({x:a.VCenter+r.x(),y:a.HCenter+r.y(),rotation:e.rotation(),name:"anchorGroup"}),Xl=new Ll.a.Image({x:e.width()*Math.abs(e.scaleX())/2+10/n.scaleX(),y:-12/n.scaleY(),image:Vl,width:24/n.scaleX(),height:24/n.scaleY(),name:"anchorRotate",listening:!1});let o=new Ll.a.Transformer({borderStroke:"#6CD0FF",borderStrokeWidth:1,rotateAnchorOffset:10,ignoreStroke:!0,anchorSize:12,anchorStroke:"#ADB8BF",anchorCornerRadius:12,keepRatio:!0,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(t,e)=>e.width<20||e.height<20?t:e});Wl.add(Xl),n.add(o),n.add(Wl),o.nodes([e])}anchorGroupFourceupdate({node:t,viewId:e}){let i=this.stageObj.updateImgStage.findOne(".designLayer"),n=i.findOne(".designContainerGroup");if(!i.findOne(".anchorGroup"))return;let r=this.getRotateNodePoint({node:t,layer:i});Wl.rotation(t.rotation()),Wl.x(r.VCenter+n.x()),Wl.y(r.HCenter+n.y()),Xl.x(t.width()*Math.abs(t.scaleX())/2+10/i.scaleX()),Xl.y(-12/i.scaleY()),Xl.width(24/i.scaleX()),Xl.height(24/i.scaleY())}destroyTransform({currentStage:t}){t.find("Transformer").destroy(),t.find(".anchorGroup").destroy(),t.findOne(".designLayer").batchDraw()}isRisk(t){const e=[1,3,4,6];let i=t.risk_gallery.risk.reduce((t,i)=>t||e.includes(i.id),!1);return t.risk_word.length&&5==t.risk_word[0].level||i}convertDefaultConfig({width:t,height:e}){let i,n;this.productData.design_width||(this.productData.design_width="100"),i=Number(this.productData.design_width)/100,this.productData.design_height||(this.productData.design_height="0"),n=1-Math.abs(Number(this.productData.design_height))/100;var r=parseInt(t),a=parseInt(e),o=r*i,s=a*n;let h;return h=-1==this.productData.design_height.indexOf("-")?"top":"bottom",{defaultWidth:r,defaultHeight:a,width:o,height:s,x:(r-o)/2,y:a-s,flag:h}}imgSizeCalculate(t,e){let i=this.convertSizeToMm({width:t.size.width,height:t.size.height},this.productData.dpi);var n=this.getDesigneConfiguration({viewId:e}),r=this.convertDefaultScale(i,n.config),a=this.convertDefaultScaleHeight(i.height*r,n.config.height);return{width:i.width*r*a>n.config.width?n.config.width:i.width*r*a,height:i.height*r*a>
12n.config.height?n.config.height:i.height*r*a,viewerSize:i}}getDesigneConfiguration({viewId:t}){let e,i=this.cacheProductPrintAreas;for(var n=0,r=i.length;n<r;n++)if(i[n].defaultViews==t){e=i[n];break}return e}convertDefaultScale(t,e){return t.width>e.width?e.width/t.width:1}convertDefaultScaleHeight(t,e){return t>e?e/t:1}convertSizeToMm(t,e){var i=function(t,e){return 25.4*t/e};return{height:i(t.height,e),width:i(t.width,e)}}getCurStageLayer({viewId:t}){let e=this.stageObj["stage"+t],i=e.findOne(".designLayer"),n=e.findOne(".layerBg"),r=i.findOne(".print_area_border_outer"),a=i.findOne(".designContainerGroup");return{stage:e,layer:i,layerBg:n,designRect:r,designContainerGroup:a}}getRotateNodePoint({node:t,layer:e=null}){let i;if(e){let n=e.findOne(".designContainerGroup");i=t.getClientRect({relativeTo:n})}else i=t.getClientRect();return{HStart:i.y,HCenter:i.y+i.height/2,HEnd:i.y+i.height,VStart:i.x,VCenter:i.x+i.width/2,VEnd:i.x+i.width,width:i.width,height:i.height}}}function Jl(t){return new Promise(async(e,i)=>{await new Promise(t=>{if(ql.length)t();else{const e=setInterval(()=>{ql.length&&(t(),clearInterval(e))},100)}});const n=ql.find(e=>e.value==t);if(document.fonts&&!function(t){let e=document.fonts.values(),i=!1,n=e.next();for(;!n.done&&!i;){n.value.family==t&&(i=!0),n=e.next()}return i}(n.value)){new FontFace(n.value,n.src,{weight:n.weight,style:n.style}).load().then((function(t){document.fonts.add(t),t.family==n.value&&e()})).catch(t=>{}).finally(()=>{e()})}else e()})}function Kl({str:t,type:e}){switch(e){case 1:t=(t=t.replace(/<\/?.+?>/g,"")).replace(/[\r\n]/g,"");break;case 2:t=t.replace(/\s+/g,"");break;default:t=(t=(t=t.replace(/<\/?.+?>/g,"")).replace(/[\r\n]/g,"")).replace(/\s+/g,"")}return t}function Ql({color:t}){if(t&&"transparent"!=t){const e=new Hl({enableAlpha:!1,format:"hex"});return e.fromString(t),{value:e.value,alpha:e._alpha/100,color:t}}return{value:"",alpha:"",color:""}}async function $l(t){for(let e=0;e<t.length;e++){const{productData:i,cfg:n=[]}=t[e],r=i.colors[0].detail;if(!r)return;const a=r[0].parts.map(t=>t.detail3D);await Promise.all([Promise.all(a.map(t=>Pl(t))),Promise.all(n.map(t=>t.image&&t.image.designImg?Ml.a.get(t.image.designImg):void 0)),r.image&&Ml.a.get(r.image),r.texture&&Ml.a.get(r.texture)])}}new Promise(t=>{Ml.a.get(jl+"/v1/FontFamily?mediaType=json").then(e=>{let i=Object.values(e.data.data),n=[];for(let t of i){let e={hasNormalFontType:"",hasBoldFontType:"",hasItalicFontType:"",hasBoldAndItalicFontType:"",id:0,label:"",value:"",src:"",weight:"",style:""},i=t.id;e.id=i,e.label=t.name;const r=t.fonts[0];let{id:a,name:o,style:s,ttf:h,weight:c,woff:l}=r,u=o+"_"+i+"_"+a+"_"+r.name;"normal"==s&&"normal"==c?e.hasNormalFontType=u:"normal"==s&&"bold"==c?e.hasBoldFontType=u:"italic"==s&&"normal"==c?e.hasItalicFontType=u:"italic"==s&&"bold"==c&&(e.hasBoldAndItalicFontType=u);let d="";h&&l?d='url("'+l+'") format("woff"),url("'+h+'") format("truetype")':h&&!l?d='url("'+h+'") format("truetype")':!h&&l&&(d='url("'+l+'") format("woff")'),e.value=u,e.src=d,e.weight=c,e.style=s,n.push(e)}ql=n,t()})})}])}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.