diff --git a/CNAME b/CNAME deleted file mode 100644 index 3b8ea59..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -jamesharvey.io \ No newline at end of file diff --git a/asset-manifest.json b/asset-manifest.json index 82e5d05..2685b27 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,8 +1,9 @@ { "files": { - "main.css": "/static/css/main.e3435d0e.css", - "main.js": "/static/js/main.1daf5eab.js", + "main.css": "/static/css/main.0d5aec65.css", + "main.js": "/static/js/main.0724d0a5.js", "static/media/editor.png": "/static/media/editor.b7c500124e8682d3af2d.png", + "static/media/three.png": "/static/media/three.7c862b1bad8407d307b0.png", "static/media/logo.jpg": "/static/media/logo.3b54437bed7886024a3b.jpg", "static/media/8thwall.png": "/static/media/8thwall.e9ac601386c9f1ec6b92.png", "static/media/sheffield.png": "/static/media/sheffield.73d90ea4df3a6d15b639.png", @@ -15,11 +16,11 @@ "static/media/menu.svg": "/static/media/menu.807ba0c70b4ac257a749b96b8a85cc1c.svg", "index.html": "/index.html", "static/media/github.svg": "/static/media/github.3b21c250a99986431958daaa9246a45a.svg", - "main.e3435d0e.css.map": "/static/css/main.e3435d0e.css.map", - "main.1daf5eab.js.map": "/static/js/main.1daf5eab.js.map" + "main.0d5aec65.css.map": "/static/css/main.0d5aec65.css.map", + "main.0724d0a5.js.map": "/static/js/main.0724d0a5.js.map" }, "entrypoints": [ - "static/css/main.e3435d0e.css", - "static/js/main.1daf5eab.js" + "static/css/main.0d5aec65.css", + "static/js/main.0724d0a5.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 073db73..962a751 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
>>4;if(!$)throw"invalid distance";A+=15&$;D=I[ee];if(ee>3){q=s[ee];D+=w(e,A)&(1<x){if(u)throw"unexpected EOF";break}a&&g(h+131072);for(var te=h+j;h>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function E(e,t){return x((k(e),e.subarray(2,-4)),t)}var M="undefined"!=typeof TextDecoder&&new TextDecoder;try{M.decode(R,{stream:!0}),1}catch(N){}},888:function(e,t,n){"use strict";var r=n(9047);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},2007:function(e,t,n){e.exports=n(888)()},9047:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4463:function(e,t,n){"use strict";var r=n(2791),i=n(5585);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!c.call(I,e)||!c.call(A,e)&&(d.test(e)?I[e]=!0:(A[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(f,p);C[t]=new h(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(f,p);C[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(f,p);C[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){C[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)})),C.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){C[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)}));var v=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for("react.element"),b=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),S=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),M=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var N=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var W=Symbol.iterator;function F(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=W&&e[W]||e["@@iterator"])?e:null}var V,T=Object.assign;function L(e){if(void 0===V)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);V=t&&t[1]||""}return"\n"+V+e}var H=!1;function X(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var i=u.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes(" ")&&(l=l.replace(" ",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function Y(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=X(e.type,!1);case 11:return e=X(e.type.render,!1);case 1:return e=X(e.type,!0);default:return""}}function _(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case B:return"Fragment";case b:return"Portal";case w:return"Profiler";case G:return"StrictMode";case R:return"Suspense";case k:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case S:return(e.displayName||"Context")+".Consumer";case Z:return(e._context.displayName||"Context")+".Provider";case x:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case E:return null!==(t=e.displayName||null)?t:_(e.type)||"Memo";case M:t=e._payload,e=e._init;try{return _(e(t))}catch(n){}}return null}function K(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _(t);case 8:return t===G?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function U(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function D(e){e._valueTracker||(e._valueTracker=function(e){var t=z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function P(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Q(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function O(e,t){var n=t.checked;return T({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function J(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=U(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function j(e,t){null!=(t=t.checked)&&m(e,"checked",t,!1)}function q(e,t){j(e,t);var n=U(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,U(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&Q(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i "+t.valueOf().toString()+"",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ge(e,t)}))}:ge);function de(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Ae={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ie=["Webkit","ms","Moz","O"];function he(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||Ae.hasOwnProperty(e)&&Ae[e]?(""+t).trim():t+"px"}function Ce(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=he(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(Ae).forEach((function(e){Ie.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ae[t]=Ae[e]}))}));var fe=T({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pe(e,t){if(t){if(fe[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function me(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ve=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var be=null,Be=null,Ge=null;function we(e){if(e=mi(e)){if("function"!==typeof be)throw Error(a(280));var t=e.stateNode;t&&(t=yi(t),be(e.stateNode,e.type,t))}}function Ze(e){Be?Ge?Ge.push(e):Ge=[e]:Be=e}function Se(){if(Be){var e=Be,t=Ge;if(Ge=Be=null,we(e),t)for(e=0;e >>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ut=64,gt=4194304;function ct(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=ct(s):0!==(a&=o)&&(r=ct(a))}else 0!==(o=n&~i)?r=ct(o):0!==a&&(r=ct(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!==(4194240&a)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0 n;n++)t.push(e);return t}function ft(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ot(t)]=n}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1< =Fn),Ln=String.fromCharCode(32),Hn=!1;function Xn(e,t){switch(e){case"keyup":return-1!==Nn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var _n=!1;var Kn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Kn[e.type]:"textarea"===t}function zn(e,t,n,r){Ze(r),0<(t=Dr(t,"onChange")).length&&(n=new gn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dn=null,Pn=null;function Qn(e){Lr(e,0)}function On(e){if(P(vi(e)))return e}function Jn(e,t){if("change"===e)return t}var jn=!1;if(g){var qn;if(g){var $n="oninput"in document;if(!$n){var er=document.createElement("div");er.setAttribute("oninput","return;"),$n="function"===typeof er.oninput}qn=$n}else qn=!1;jn=qn&&(!document.documentMode||9 =t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function cr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?cr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dr(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Q((e=t.contentWindow).document)}return t}function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function Ir(e){var t=dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&cr(n.ownerDocument.documentElement,n)){if(null!==r&&Ar(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=void 0===r.end?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=gr(n,a);var o=gr(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n =document.documentMode,Cr=null,fr=null,pr=null,mr=!1;function vr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==Cr||Cr!==Q(r)||("selectionStart"in(r=Cr)&&Ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&lr(pr,r)||(pr=r,0<(r=Dr(fr,"onSelect")).length&&(t=new gn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var br={animationend:yr("Animation","AnimationEnd"),animationiteration:yr("Animation","AnimationIteration"),animationstart:yr("Animation","AnimationStart"),transitionend:yr("Transition","TransitionEnd")},Br={},Gr={};function wr(e){if(Br[e])return Br[e];if(!br[e])return e;var t,n=br[e];for(t in n)if(n.hasOwnProperty(t)&&t in Gr)return Br[e]=n[t];return e}g&&(Gr=document.createElement("div").style,"AnimationEvent"in window||(delete br.animationend.animation,delete br.animationiteration.animation,delete br.animationstart.animation),"TransitionEvent"in window||delete br.transitionend.transition);var Zr=wr("animationend"),Sr=wr("animationiteration"),xr=wr("animationstart"),Rr=wr("transitionend"),kr=new Map,Er="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,t){kr.set(e,t),l(t,[e])}for(var Nr=0;Nr Bi||(e.current=bi[Bi],bi[Bi]=null,Bi--)}function Zi(e,t){Bi++,bi[Bi]=e.current,e.current=t}var Si={},xi=Gi(Si),Ri=Gi(!1),ki=Si;function Ei(e,t){var n=e.type.contextTypes;if(!n)return Si;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Mi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ni(){wi(Ri),wi(xi)}function Wi(e,t,n){if(xi.current!==Si)throw Error(a(168));Zi(xi,t),Zi(Ri,n)}function Fi(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(a(108,K(e)||"Unknown",i));return T({},n,r)}function Vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Si,ki=xi.current,Zi(xi,e),Zi(Ri,Ri.current),!0}function Ti(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Fi(e,t,ki),r.__reactInternalMemoizedMergedChildContext=e,wi(Ri),wi(xi),Zi(xi,e)):wi(Ri),Zi(Ri,n)}var Li=null,Hi=!1,Xi=!1;function Yi(e){null===Li?Li=[e]:Li.push(e)}function _i(){if(!Xi&&null!==Li){Xi=!0;var e=0,t=mt;try{var n=Li;for(mt=1;e >=o,i-=o,Ji=1<<32-ot(t)+i|n<h?(C=c,c=null):C=c.sibling;var f=A(i,c,s[h],l);if(null===f){null===c&&(c=C);break}e&&c&&null===f.alternate&&t(i,c),a=o(f,a,h),null===g?u=f:g.sibling=f,g=f,c=C}if(h===s.length)return n(i,c),ia&&qi(i,h),u;if(null===c){for(;h C?(f=h,h=null):f=h.sibling;var m=A(i,h,p.value,u);if(null===m){null===h&&(h=f);break}e&&h&&null===m.alternate&&t(i,h),s=o(m,s,C),null===c?g=m:c.sibling=m,c=m,h=f}if(p.done)return n(i,h),ia&&qi(i,C),g;if(null===h){for(;!p.done;C++,p=l.next())null!==(p=d(i,p.value,u))&&(s=o(p,s,C),null===c?g=p:c.sibling=p,c=p);return ia&&qi(i,C),g}for(h=r(i,h);!p.done;C++,p=l.next())null!==(p=I(h,i,C,p.value,u))&&(e&&null!==p.alternate&&h.delete(null===p.key?C:p.key),s=o(p,s,C),null===c?g=p:c.sibling=p,c=p);return e&&h.forEach((function(e){return t(i,e)})),ia&&qi(i,C),g}return function e(r,a,o,l){if("object"===typeof o&&null!==o&&o.type===B&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case y:e:{for(var u=o.key,g=a;null!==g;){if(g.key===u){if((u=o.type)===B){if(7===g.tag){n(r,g.sibling),(a=i(g,o.props.children)).return=r,r=a;break e}}else if(g.elementType===u||"object"===typeof u&&null!==u&&u.$$typeof===M&&Qa(u)===g.type){n(r,g.sibling),(a=i(g,o.props)).ref=Da(r,g,o),a.return=r,r=a;break e}n(r,g);break}t(r,g),g=g.sibling}o.type===B?((a=Vu(o.props.children,r.mode,l,o.key)).return=r,r=a):((l=Fu(o.type,o.key,o.props,null,r.mode,l)).ref=Da(r,a,o),l.return=r,r=l)}return s(r);case b:e:{for(g=o.key;null!==a;){if(a.key===g){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=Hu(o,r.mode,l)).return=r,r=a}return s(r);case M:return e(r,a,(g=o._init)(o._payload),l)}if(te(o))return h(r,a,o,l);if(F(o))return C(r,a,o,l);Pa(r,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=Lu(o,r.mode,l)).return=r,r=a),s(r)):n(r,a)}}var Ja=Oa(!0),ja=Oa(!1),qa={},$a=Gi(qa),eo=Gi(qa),to=Gi(qa);function no(e){if(e===qa)throw Error(a(174));return e}function ro(e,t){switch(Zi(to,t),Zi(eo,e),Zi($a,qa),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}wi($a),Zi($a,t)}function io(){wi($a),wi(eo),wi(to)}function ao(e){no(to.current);var t=no($a.current),n=le(t,e.type);t!==n&&(Zi(eo,e),Zi($a,n))}function oo(e){eo.current===e&&(wi($a),wi(eo))}var so=Gi(0);function lo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=[];function go(){for(var e=0;e n?n:4,e(!0);var r=Ao.transition;Ao.transition={};try{e(!1),t()}finally{mt=n,Ao.transition=r}}function es(){return So().memoizedState}function ts(e,t,n){var r=nu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rs(e))is(t,n);else if(null!==(n=xa(e,t,n,r))){ru(n,e,r,tu()),as(n,t,r)}}function ns(e,t,n){var r=nu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rs(e))is(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,sr(s,o)){var l=t.interleaved;return null===l?(i.next=i,Sa(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(u){}null!==(n=xa(e,t,i,r))&&(ru(n,e,r,i=tu()),as(n,t,r))}}function rs(e){var t=e.alternate;return e===ho||null!==t&&t===ho}function is(e,t){mo=po=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function as(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,pt(e,n)}}var os={readContext:wa,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useInsertionEffect:bo,useLayoutEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useMutableSource:bo,useSyncExternalStore:bo,useId:bo,unstable_isNewReconciler:!1},ss={readContext:wa,useCallback:function(e,t){return Zo().memoizedState=[e,void 0===t?null:t],e},useContext:wa,useEffect:Ko,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Yo(4194308,4,Po.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yo(4,2,e,t)},useMemo:function(e,t){var n=Zo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ts.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Zo().memoizedState=e},useState:Lo,useDebugValue:Oo,useDeferredValue:function(e){return Zo().memoizedState=e},useTransition:function(){var e=Lo(!1),t=e[0];return e=$o.bind(null,e[1]),Zo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ho,i=Zo();if(ia){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===kl)throw Error(a(349));0!==(30&Io)||No(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Ko(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Ho(9,Wo.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Zo(),t=kl.identifierPrefix;if(ia){var n=ji;t=":"+t+"R"+(n=(Ji&~(1<<32-ot(Ji)-1)).toString(32)+n),0<(n=vo++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=yo++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ls={readContext:wa,useCallback:Jo,useContext:wa,useEffect:Uo,useImperativeHandle:Qo,useInsertionEffect:zo,useLayoutEffect:Do,useMemo:jo,useReducer:Ro,useRef:Xo,useState:function(){return Ro(xo)},useDebugValue:Oo,useDeferredValue:function(e){return qo(So(),Co.memoizedState,e)},useTransition:function(){return[Ro(xo)[0],So().memoizedState]},useMutableSource:Eo,useSyncExternalStore:Mo,useId:es,unstable_isNewReconciler:!1},us={readContext:wa,useCallback:Jo,useContext:wa,useEffect:Uo,useImperativeHandle:Qo,useInsertionEffect:zo,useLayoutEffect:Do,useMemo:jo,useReducer:ko,useRef:Xo,useState:function(){return ko(xo)},useDebugValue:Oo,useDeferredValue:function(e){var t=So();return null===Co?t.memoizedState=e:qo(t,Co.memoizedState,e)},useTransition:function(){return[ko(xo)[0],So().memoizedState]},useMutableSource:Eo,useSyncExternalStore:Mo,useId:es,unstable_isNewReconciler:!1};function gs(e,t){try{var n="",r=t;do{n+=Y(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i,digest:null}}function cs(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ds(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var As="function"===typeof WeakMap?WeakMap:Map;function Is(e,t,n){(n=Na(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zl||(zl=!0,Dl=r),ds(0,t)},n}function hs(e,t,n){(n=Na(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ds(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){ds(0,t),"function"!==typeof r&&(null===Pl?Pl=new Set([this]):Pl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Cs(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new As;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function fs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ps(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Na(-1,1)).tag=2,Wa(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var ms=v.ReactCurrentOwner,vs=!1;function ys(e,t,n,r){t.child=null===e?ja(t,null,n,r):Ja(t,e.child,n,r)}function bs(e,t,n,r,i){n=n.render;var a=t.ref;return Ga(t,i),r=Go(e,t,n,r,a,i),n=wo(),null===e||vs?(ia&&n&&ea(t),t.flags|=1,ys(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zs(e,t,i))}function Bs(e,t,n,r,i){if(null===e){var a=n.type;return"function"!==typeof a||Nu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Fu(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Gs(e,t,a,r,i))}if(a=e.child,0===(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(o,r)&&e.ref===t.ref)return zs(e,t,i)}return t.flags|=1,(e=Wu(a,r)).ref=t.ref,e.return=t,t.child=e}function Gs(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(lr(a,r)&&e.ref===t.ref){if(vs=!1,t.pendingProps=r=a,0===(e.lanes&i))return t.lanes=e.lanes,zs(e,t,i);0!==(131072&e.flags)&&(vs=!0)}}return Ss(e,t,n,r,i)}function ws(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zi(Wl,Nl),Nl|=n;else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Zi(Wl,Nl),Nl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,Zi(Wl,Nl),Nl|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,Zi(Wl,Nl),Nl|=r;return ys(e,t,i,n),t.child}function Zs(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ss(e,t,n,r,i){var a=Mi(n)?ki:xi.current;return a=Ei(t,a),Ga(t,i),n=Go(e,t,n,r,a,i),r=wo(),null===e||vs?(ia&&r&&ea(t),t.flags|=1,ys(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,zs(e,t,i))}function xs(e,t,n,r,i){if(Mi(n)){var a=!0;Vi(t)}else a=!1;if(Ga(t,i),null===t.stateNode)Us(e,t),Ka(t,n,r),za(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;"object"===typeof u&&null!==u?u=wa(u):u=Ei(t,u=Mi(n)?ki:xi.current);var g=n.getDerivedStateFromProps,c="function"===typeof g||"function"===typeof o.getSnapshotBeforeUpdate;c||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||l!==u)&&Ua(t,o,r,u),ka=!1;var d=t.memoizedState;o.state=d,Ta(t,r,o,i),l=t.memoizedState,s!==r||d!==l||Ri.current||ka?("function"===typeof g&&(Xa(t,n,g,r),l=t.memoizedState),(s=ka||_a(t,n,s,r,d,l,u))?(c||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Ma(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ca(t.type,s),o.props=u,c=t.pendingProps,d=o.context,"object"===typeof(l=n.contextType)&&null!==l?l=wa(l):l=Ei(t,l=Mi(n)?ki:xi.current);var A=n.getDerivedStateFromProps;(g="function"===typeof A||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==c||d!==l)&&Ua(t,o,r,l),ka=!1,d=t.memoizedState,o.state=d,Ta(t,r,o,i);var I=t.memoizedState;s!==c||d!==I||Ri.current||ka?("function"===typeof A&&(Xa(t,n,A,r),I=t.memoizedState),(u=ka||_a(t,n,u,r,d,I,l)||!1)?(g||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,I,l),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,I,l)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=I),o.props=r,o.state=I,o.context=l,r=u):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Rs(e,t,n,r,a,i)}function Rs(e,t,n,r,i,a){Zs(e,t);var o=0!==(128&t.flags);if(!r&&!o)return i&&Ti(t,n,!1),zs(e,t,a);r=t.stateNode,ms.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=Ja(t,e.child,null,a),t.child=Ja(t,null,s,a)):ys(e,t,s,a),t.memoizedState=r.state,i&&Ti(t,n,!0),t.child}function ks(e){var t=e.stateNode;t.pendingContext?Wi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Wi(0,t.context,!1),ro(e,t.containerInfo)}function Es(e,t,n,r,i){return Aa(),Ia(i),t.flags|=256,ys(e,t,n,r),t.child}var Ms,Ns,Ws,Fs,Vs={dehydrated:null,treeContext:null,retryLane:0};function Ts(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ls(e,t,n){var r,i=t.pendingProps,o=so.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&o)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Zi(so,1&o),null===e)return ua(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=Tu(l,i,0,null),e=Vu(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ts(n),t.memoizedState=Vs,e):Hs(t,l));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,i,o,s){if(n)return 256&t.flags?(t.flags&=-257,Xs(e,t,s,r=cs(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Tu({mode:"visible",children:r.children},i,0,null),(o=Vu(o,i,s,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,0!==(1&t.mode)&&Ja(t,e.child,null,s),t.child.memoizedState=Ts(s),t.memoizedState=Vs,o);if(0===(1&t.mode))return Xs(e,t,s,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var l=r.dgst;return r=l,Xs(e,t,s,r=cs(o=Error(a(419)),r,void 0))}if(l=0!==(s&e.childLanes),vs||l){if(null!==(r=kl)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|s))?0:i)&&i!==o.retryLane&&(o.retryLane=i,Ra(e,i),ru(r,e,i,-1))}return Cu(),Xs(e,t,s,r=cs(Error(a(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=xu.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ra=ui(i.nextSibling),na=t,ia=!0,aa=null,null!==e&&(Pi[Qi++]=Ji,Pi[Qi++]=ji,Pi[Qi++]=Oi,Ji=e.id,ji=e.overflow,Oi=t),t=Hs(t,r.children),t.flags|=4096,t)}(e,t,l,i,r,o,n);if(s){s=i.fallback,l=t.mode,r=(o=e.child).sibling;var u={mode:"hidden",children:i.children};return 0===(1&l)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=u,t.deletions=null):(i=Wu(o,u)).subtreeFlags=14680064&o.subtreeFlags,null!==r?s=Wu(r,s):(s=Vu(s,l,n,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?Ts(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Vs,i}return e=(s=e.child).sibling,i=Wu(s,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Hs(e,t){return(t=Tu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Xs(e,t,n,r){return null!==r&&Ia(r),Ja(t,e.child,null,n),(e=Hs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ys(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ba(e.return,t,n)}function _s(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Ks(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(ys(e,t,r.children,n),0!==(2&(r=so.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ys(e,n,t);else if(19===e.tag)Ys(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Zi(so,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===lo(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),_s(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===lo(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}_s(t,!0,n,null,a);break;case"together":_s(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Us(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Tl|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Wu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Wu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ds(e,t){if(!ia)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ps(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Qs(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ps(t),null;case 1:case 17:return Mi(t.type)&&Ni(),Ps(t),null;case 3:return r=t.stateNode,io(),wi(Ri),wi(xi),go(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ca(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==aa&&(su(aa),aa=null))),Ns(e,t),Ps(t),null;case 5:oo(t);var i=no(to.current);if(n=t.type,null!==e&&null!=t.stateNode)Ws(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return Ps(t),null}if(e=no($a.current),ca(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[di]=t,r[Ai]=o,e=0!==(1&t.mode),n){case"dialog":Hr("cancel",r),Hr("close",r);break;case"iframe":case"object":case"embed":Hr("load",r);break;case"video":case"audio":for(i=0;i <\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[di]=t,e[Ai]=r,Ms(e,t,!1,!1),t.stateNode=e;e:{switch(l=me(n,r),n){case"dialog":Hr("cancel",e),Hr("close",e),i=r;break;case"iframe":case"object":case"embed":Hr("load",e),i=r;break;case"video":case"audio":for(i=0;i Kl&&(t.flags|=128,r=!0,Ds(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=lo(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Ds(o,!0),null===o.tail&&"hidden"===o.tailMode&&!l.alternate&&!ia)return Ps(t),null}else 2*je()-o.renderingStartTime>Kl&&1073741824!==n&&(t.flags|=128,r=!0,Ds(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=o.last)?n.sibling=l:t.child=l,o.last=l)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=je(),t.sibling=null,n=so.current,Zi(so,r?1&n|2:1&n),t):(Ps(t),null);case 22:case 23:return du(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Nl)&&(Ps(t),6&t.subtreeFlags&&(t.flags|=8192)):Ps(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function Os(e,t){switch(ta(t),t.tag){case 1:return Mi(t.type)&&Ni(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return io(),wi(Ri),wi(xi),go(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return oo(t),null;case 13:if(wi(so),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Aa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return wi(so),null;case 4:return io(),null;case 10:return ba(t.type._context),null;case 22:case 23:return du(),null;default:return null}}Ms=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ns=function(){},Ws=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,no($a.current);var a,o=null;switch(n){case"input":i=O(e,i),r=O(e,r),o=[];break;case"select":i=T({},i,{value:void 0}),r=T({},r,{value:void 0}),o=[];break;case"textarea":i=re(e,i),r=re(e,r),o=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=$r)}for(g in pe(n,r),n=null,i)if(!r.hasOwnProperty(g)&&i.hasOwnProperty(g)&&null!=i[g])if("style"===g){var l=i[g];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==g&&"children"!==g&&"suppressContentEditableWarning"!==g&&"suppressHydrationWarning"!==g&&"autoFocus"!==g&&(s.hasOwnProperty(g)?o||(o=[]):(o=o||[]).push(g,null));for(g in r){var u=r[g];if(l=null!=i?i[g]:void 0,r.hasOwnProperty(g)&&u!==l&&(null!=u||null!=l))if("style"===g)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(o||(o=[]),o.push(g,n)),n=u;else"dangerouslySetInnerHTML"===g?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(o=o||[]).push(g,u)):"children"===g?"string"!==typeof u&&"number"!==typeof u||(o=o||[]).push(g,""+u):"suppressContentEditableWarning"!==g&&"suppressHydrationWarning"!==g&&(s.hasOwnProperty(g)?(null!=u&&"onScroll"===g&&Hr("scroll",e),o||l===u||(o=[])):(o=o||[]).push(g,u))}n&&(o=o||[]).push("style",n);var g=o;(t.updateQueue=g)&&(t.flags|=4)}},Fs=function(e,t,n,r){n!==r&&(t.flags|=4)};var Js=!1,js=!1,qs="function"===typeof WeakSet?WeakSet:Set,$s=null;function el(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){wu(e,t,r)}else n.current=null}function tl(e,t,n){try{n()}catch(r){wu(e,t,r)}}var nl=!1;function rl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&tl(t,n,a)}i=i.next}while(i!==r)}}function il(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function al(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function ol(e){var t=e.alternate;null!==t&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[di],delete t[Ai],delete t[hi],delete t[Ci],delete t[fi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sl(e){return 5===e.tag||3===e.tag||4===e.tag}function ll(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||sl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ul(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=$r));else if(4!==r&&null!==(e=e.child))for(ul(e,t,n),e=e.sibling;null!==e;)ul(e,t,n),e=e.sibling}function gl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(gl(e,t,n),e=e.sibling;null!==e;)gl(e,t,n),e=e.sibling}var cl=null,dl=!1;function Al(e,t,n){for(n=n.child;null!==n;)Il(e,t,n),n=n.sibling}function Il(e,t,n){if(at&&"function"===typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(it,n)}catch(s){}switch(n.tag){case 5:js||el(n,t);case 6:var r=cl,i=dl;cl=null,Al(e,t,n),dl=i,null!==(cl=r)&&(dl?(e=cl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cl.removeChild(n.stateNode));break;case 18:null!==cl&&(dl?(e=cl,n=n.stateNode,8===e.nodeType?li(e.parentNode,n):1===e.nodeType&&li(e,n),_t(e)):li(cl,n.stateNode));break;case 4:r=cl,i=dl,cl=n.stateNode.containerInfo,dl=!0,Al(e,t,n),cl=r,dl=i;break;case 0:case 11:case 14:case 15:if(!js&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,void 0!==o&&(0!==(2&a)||0!==(4&a))&&tl(n,t,o),i=i.next}while(i!==r)}Al(e,t,n);break;case 1:if(!js&&(el(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){wu(n,t,s)}Al(e,t,n);break;case 21:Al(e,t,n);break;case 22:1&n.mode?(js=(r=js)||null!==n.memoizedState,Al(e,t,n),js=r):Al(e,t,n);break;default:Al(e,t,n)}}function hl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new qs),t.forEach((function(t){var r=Ru.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Cl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r i&&(i=s),r&=~o}if(r=i,10<(r=(120>(r=je()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*wl(r/1960))-r)){e.timeoutHandle=ri(bu.bind(null,e,Yl,Ul),r);break}bu(e,Yl,Ul);break;default:throw Error(a(329))}}}return iu(e,je()),e.callbackNode===n?au.bind(null,e):null}function ou(e,t){var n=Xl;return e.current.memoizedState.isDehydrated&&(Au(e,t).flags|=256),2!==(e=fu(e,t))&&(t=Yl,Yl=n,null!==t&&su(t)),e}function su(e){null===Yl?Yl=e:Yl.push.apply(Yl,e)}function lu(e,t){for(t&=~Hl,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0 e?16:e,null===Ol)var r=!1;else{if(e=Ol,Ol=null,Jl=0,0!==(6&Rl))throw Error(a(331));var i=Rl;for(Rl|=4,$s=e.current;null!==$s;){var o=$s,s=o.child;if(0!==(16&$s.flags)){var l=o.deletions;if(null!==l){for(var u=0;u je()-_l?Au(e,0):Hl|=n),iu(e,t)}function Su(e,t){0===t&&(0===(1&e.mode)?t=1:(t=gt,0===(130023424&(gt<<=1))&&(gt=4194304)));var n=tu();null!==(e=Ra(e,t))&&(ft(e,t,n),iu(e,n))}function xu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Su(e,n)}function Ru(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),Su(e,n)}function ku(e,t){return Pe(e,t)}function Eu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mu(e,t,n,r){return new Eu(e,t,n,r)}function Nu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Wu(e,t){var n=e.alternate;return null===n?((n=Mu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fu(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Nu(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case B:return Vu(n.children,i,o,t);case G:s=8,i|=8;break;case w:return(e=Mu(12,n,t,2|i)).elementType=w,e.lanes=o,e;case R:return(e=Mu(13,n,t,i)).elementType=R,e.lanes=o,e;case k:return(e=Mu(19,n,t,i)).elementType=k,e.lanes=o,e;case N:return Tu(n,i,o,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case Z:s=10;break e;case S:s=9;break e;case x:s=11;break e;case E:s=14;break e;case M:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Mu(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Vu(e,t,n,r){return(e=Mu(7,e,r,t)).lanes=n,e}function Tu(e,t,n,r){return(e=Mu(22,e,r,t)).elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function Lu(e,t,n){return(e=Mu(6,e,null,t)).lanes=n,e}function Hu(e,t,n){return(t=Mu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ct(0),this.expirationTimes=Ct(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ct(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Yu(e,t,n,r,i,a,o,s,l){return e=new Xu(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Mu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ea(a),e}function _u(e){if(!e)return Si;e:{if(_e(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Mi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(Mi(n))return Fi(e,n,t)}return t}function Ku(e,t,n,r,i,a,o,s,l){return(e=Yu(n,r,!0,e,0,a,0,s,l)).context=_u(null),n=e.current,(a=Na(r=tu(),i=nu(n))).callback=void 0!==t&&null!==t?t:null,Wa(n,a,i),e.current.lanes=i,ft(e,i,r),iu(e,r),e}function Uu(e,t,n,r){var i=t.current,a=tu(),o=nu(i);return n=_u(n),null===t.context?t.context=n:t.pendingContext=n,(t=Na(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Wa(i,t,o))&&(ru(e,i,o,a),Fa(e,i,o)),o}function zu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Du(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n >>1,i=e[r];if(!(0>>1;r a(l,n))ua(g,l)?(e[r]=g,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(ua(g,n)))break e;e[r]=g,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],g=[],c=1,d=null,A=3,I=!1,h=!1,C=!1,f="function"===typeof setTimeout?setTimeout:null,p="function"===typeof clearTimeout?clearTimeout:null,m="undefined"!==typeof setImmediate?setImmediate:null;function v(e){for(var t=r(g);null!==t;){if(null===t.callback)i(g);else{if(!(t.startTime<=e))break;i(g),t.sortIndex=t.expirationTime,n(u,t)}t=r(g)}}function y(e){if(C=!1,v(e),!h)if(null!==r(u))h=!0,N(b);else{var t=r(g);null!==t&&W(y,t.startTime-e)}}function b(e,n){h=!1,C&&(C=!1,p(Z),Z=-1),I=!0;var a=A;try{for(v(n),d=r(u);null!==d&&(!(d.expirationTime>n)||e&&!R());){var o=d.callback;if("function"===typeof o){d.callback=null,A=d.priorityLevel;var s=o(d.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?d.callback=s:d===r(u)&&i(u),v(n)}else i(u);d=r(u)}if(null!==d)var l=!0;else{var c=r(g);null!==c&&W(y,c.startTime-n),l=!1}return l}finally{d=null,A=a,I=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var B,G=!1,w=null,Z=-1,S=5,x=-1;function R(){return!(t.unstable_now()-x e||125o?(e.sortIndex=a,n(g,e),null===r(u)&&e===r(g)&&(C?(p(Z),Z=-1):C=!0,W(y,a-o))):(e.sortIndex=s,n(u,e),h||I||(h=!0,N(b))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},5585:function(e,t,n){"use strict";e.exports=n(67)},8105:function(e,t,n){"use strict";n.r(t),n.d(t,{InView:function(){return h},default:function(){return h},defaultFallbackInView:function(){return g},observe:function(){return d},useInView:function(){return C}});var r=n(2791);function i(){return i=Object.assign||function(e){for(var t=1;t =e}));e.trackVisibility&&"undefined"===typeof t.isVisible&&(t.isVisible=a),null==(n=i.get(t.target))||n.forEach((function(e){e(a,t)}))}))}),e);r=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:i},o.set(t,n)}return n}(n),s=a.id,l=a.observer,g=a.elements,d=g.get(e)||[];return g.has(e)||g.set(e,d),d.push(t),l.observe(e),function(){d.splice(d.indexOf(t),1),0===d.length&&(g.delete(e),l.unobserve(e)),0===g.size&&(l.disconnect(),o.delete(s))}}var A=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function I(e){return"function"!==typeof e.children}var h=function(e){var t,n;function o(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),I(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,a(t,n);var s=o.prototype;return s.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},s.componentWillUnmount=function(){this.unobserve(),this.node=null},s.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,i=e.trackVisibility,a=e.delay,o=e.fallbackInView;this._unobserveCb=d(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:i,delay:a},o)}},s.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},s.render=function(){if(!I(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var a=this.props,o=a.children,s=a.as,l=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r =0||(i[n]=e[n]);return i}(a,A);return r.createElement(s||"div",i({ref:this.handleNode},l),o)},o}(r.Component);function C(e){var t=void 0===e?{}:e,n=t.threshold,i=t.delay,a=t.trackVisibility,o=t.rootMargin,s=t.root,l=t.triggerOnce,u=t.skip,g=t.initialInView,c=t.fallbackInView,A=r.useRef(),I=r.useState({inView:!!g}),h=I[0],C=I[1],f=r.useCallback((function(e){void 0!==A.current&&(A.current(),A.current=void 0),u||e&&(A.current=d(e,(function(e,t){C({inView:e,entry:t}),t.isIntersecting&&l&&A.current&&(A.current(),A.current=void 0)}),{root:s,rootMargin:o,threshold:n,trackVisibility:a,delay:i},c))}),[Array.isArray(n)?n.toString():n,s,o,l,u,a,c,i]);(0,r.useEffect)((function(){A.current||!h.entry||l||u||C({inView:!!g})}));var p=[f,h.inView,h.entry];return p.ref=p[0],p.inView=p[1],p.entry=p[2],p}h.displayName="InView",h.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}},4976:function(e,t){"use strict";t.ConcurrentRoot=1,t.ContinuousEventPriority=4,t.DefaultEventPriority=16,t.DiscreteEventPriority=1},3721:function(e,t,n){e.exports=function(e){var t={},r=n(2791),i=n(5296),a=Object.assign;function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n --s||i[o]!==a[s]){var l="\n"+i[o].replace(" at new "," at ");return e.displayName&&l.includes(" ")&&(l=l.replace(" ",e.displayName)),l}}while(1<=o&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?et(e):""}var rt=Object.prototype.hasOwnProperty,it=[],at=-1;function ot(e){return{current:e}}function st(e){0>at||(e.current=it[at],it[at]=null,at--)}function lt(e,t){at++,it[at]=e.current,e.current=t}var ut={},gt=ot(ut),ct=ot(!1),dt=ut;function At(e,t){var n=e.type.contextTypes;if(!n)return ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function It(e){return null!==(e=e.childContextTypes)&&void 0!==e}function ht(){st(ct),st(gt)}function Ct(e,t,n){if(gt.current!==ut)throw Error(o(168));lt(gt,t),lt(ct,n)}function ft(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(o(108,G(e)||"Unknown",i));return a({},n,r)}function pt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ut,dt=gt.current,lt(gt,e),lt(ct,ct.current),!0}function mt(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=ft(e,t,dt),r.__reactInternalMemoizedMergedChildContext=e,st(ct),st(gt),lt(gt,e)):st(ct),lt(ct,n)}var vt=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(yt(e)/bt|0)|0},yt=Math.log,bt=Math.LN2;var Bt=64,Gt=4194304;function wt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=wt(s):0!==(a&=o)&&(r=wt(a))}else 0!==(o=n&~i)?r=wt(o):0!==a&&(r=wt(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!==(4194240&a)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0 n;n++)t.push(e);return t}function kt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-vt(t)]=n}function Et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-vt(n),i=1< >=o,i-=o,Vn=1<<32-vt(t)+i|n<d?(A=c,c=null):A=c.sibling;var I=C(i,c,s[d],l);if(null===I){null===c&&(c=A);break}e&&c&&null===I.alternate&&t(i,c),o=a(I,o,d),null===g?u=I:g.sibling=I,g=I,c=A}if(d===s.length)return n(i,c),Un&&Ln(i,d),u;if(null===c){for(;d A?(I=d,d=null):I=d.sibling;var m=C(i,d,p.value,u);if(null===m){null===d&&(d=I);break}e&&d&&null===m.alternate&&t(i,d),s=a(m,s,A),null===c?g=m:c.sibling=m,c=m,d=I}if(p.done)return n(i,d),Un&&Ln(i,A),g;if(null===d){for(;!p.done;A++,p=l.next())null!==(p=h(i,p.value,u))&&(s=a(p,s,A),null===c?g=p:c.sibling=p,c=p);return Un&&Ln(i,A),g}for(d=r(i,d);!p.done;A++,p=l.next())null!==(p=f(d,i,A,p.value,u))&&(e&&null!==p.alternate&&d.delete(null===p.key?A:p.key),s=a(p,s,A),null===c?g=p:c.sibling=p,c=p);return e&&d.forEach((function(e){return t(i,e)})),Un&&Ln(i,A),g}return function e(r,a,o,c){if("object"===typeof o&&null!==o&&o.type===g&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case l:e:{for(var d=o.key,A=a;null!==A;){if(A.key===d){if((d=o.type)===g){if(7===A.tag){n(r,A.sibling),(a=i(A,o.props.children)).return=r,r=a;break e}}else if(A.elementType===d||"object"===typeof d&&null!==d&&d.$$typeof===m&&rr(d)===A.type){n(r,A.sibling),(a=i(A,o.props)).ref=tr(r,A,o),a.return=r,r=a;break e}n(r,A);break}t(r,A),A=A.sibling}o.type===g?((a=ns(o.props.children,r.mode,c,o.key)).return=r,r=a):((c=ts(o.type,o.key,o.props,null,r.mode,c)).ref=tr(r,a,o),c.return=r,r=c)}return s(r);case u:e:{for(A=o.key;null!==a;){if(a.key===A){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=as(o,r.mode,c)).return=r,r=a}return s(r);case m:return e(r,a,(A=o._init)(o._payload),c)}if(M(o))return p(r,a,o,c);if(b(o))return v(r,a,o,c);nr(r,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=is(o,r.mode,c)).return=r,r=a),s(r)):n(r,a)}}var ar=ir(!0),or=ir(!1),sr={},lr=ot(sr),ur=ot(sr),gr=ot(sr);function cr(e){if(e===sr)throw Error(o(174));return e}function dr(e,t){lt(gr,t),lt(ur,e),lt(lr,sr),e=W(t),st(lr),lt(lr,e)}function Ar(){st(lr),st(ur),st(gr)}function Ir(e){var t=cr(gr.current),n=cr(lr.current);n!==(t=F(n,e.type,t))&&(lt(ur,e),lt(lr,t))}function hr(e){ur.current===e&&(st(lr),st(ur))}var Cr=ot(0);function fr(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Ve(n)||Te(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var pr=[];function mr(){for(var e=0;e n?n:4,e(!0);var r=yr.transition;yr.transition={};try{e(!1),t()}finally{Mt=n,yr.transition=r}}function oi(){return Fr().memoizedState}function si(e,t,n){var r=bo(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ui(e)?gi(t,n):(ci(e,t,n),null!==(e=Bo(e,r,n=yo()))&&di(e,t,r))}function li(e,t,n){var r=bo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ui(e))gi(t,i);else{ci(e,t,i);var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,zt(s,o))return}catch(l){}null!==(e=Bo(e,r,n=yo()))&&di(e,t,r)}}function ui(e){var t=e.alternate;return e===Br||null!==t&&t===Br}function gi(e,t){Sr=Zr=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ci(e,t,n){null!==Qa&&0!==(1&e.mode)&&0===(2&Pa)?(null===(e=t.interleaved)?(n.next=n,null===dn?dn=[t]:dn.push(t)):(n.next=e.next,e.next=n),t.interleaved=n):(null===(e=t.pending)?n.next=n:(n.next=e.next,e.next=n),t.pending=n)}function di(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Et(e,n)}}var Ai={readContext:cn,useCallback:kr,useContext:kr,useEffect:kr,useImperativeHandle:kr,useInsertionEffect:kr,useLayoutEffect:kr,useMemo:kr,useReducer:kr,useRef:kr,useState:kr,useDebugValue:kr,useDeferredValue:kr,useTransition:kr,useMutableSource:kr,useSyncExternalStore:kr,useId:kr,unstable_isNewReconciler:!1},Ii={readContext:cn,useCallback:function(e,t){return Wr().memoizedState=[e,void 0===t?null:t],e},useContext:cn,useEffect:Jr,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Qr(4194308,4,ei.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qr(4,2,e,t)},useMemo:function(e,t){var n=Wr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=si.bind(null,Br,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Wr().memoizedState=e},useState:zr,useDebugValue:ni,useDeferredValue:function(e){var t=zr(e),n=t[0],r=t[1];return Jr((function(){var t=yr.transition;yr.transition={};try{r(e)}finally{yr.transition=t}}),[e]),n},useTransition:function(){var e=zr(!1),t=e[0];return e=ai.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Br,i=Wr();if(Un){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Qa)throw Error(o(349));0!==(30&br)||Yr(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Jr(Kr.bind(null,r,a,e),[e]),r.flags|=2048,Dr(9,_r.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Wr(),t=Qa.identifierPrefix;if(Un){var n=Tn;t=":"+t+"R"+(n=(Vn&~(1<<32-vt(Vn)-1)).toString(32)+n),0<(n=xr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Rr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hi={readContext:cn,useCallback:ri,useContext:cn,useEffect:jr,useImperativeHandle:ti,useInsertionEffect:qr,useLayoutEffect:$r,useMemo:ii,useReducer:Tr,useRef:Pr,useState:function(){return Tr(Vr)},useDebugValue:ni,useDeferredValue:function(e){var t=Tr(Vr),n=t[0],r=t[1];return jr((function(){var t=yr.transition;yr.transition={};try{r(e)}finally{yr.transition=t}}),[e]),n},useTransition:function(){return[Tr(Vr)[0],Fr().memoizedState]},useMutableSource:Hr,useSyncExternalStore:Xr,useId:oi,unstable_isNewReconciler:!1},Ci={readContext:cn,useCallback:ri,useContext:cn,useEffect:jr,useImperativeHandle:ti,useInsertionEffect:qr,useLayoutEffect:$r,useMemo:ii,useReducer:Lr,useRef:Pr,useState:function(){return Lr(Vr)},useDebugValue:ni,useDeferredValue:function(e){var t=Lr(Vr),n=t[0],r=t[1];return jr((function(){var t=yr.transition;yr.transition={};try{r(e)}finally{yr.transition=t}}),[e]),n},useTransition:function(){return[Lr(Vr)[0],Fr().memoizedState]},useMutableSource:Hr,useSyncExternalStore:Xr,useId:oi,unstable_isNewReconciler:!1};function fi(e,t){try{var n="",r=t;do{n+=$t(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i}}function pi(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var mi,vi,yi,bi,Bi="function"===typeof WeakMap?WeakMap:Map;function Gi(e,t,n){(n=Cn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){go||(go=!0,co=r),pi(0,t)},n}function wi(e,t,n){(n=Cn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){pi(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){pi(0,t),"function"!==typeof r&&(null===Ao?Ao=new Set([this]):Ao.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function Zi(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Bi;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Do.bind(null,e,t,n),t.then(e,e))}function Si(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function xi(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Cn(-1,1)).tag=2,fn(n,t))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}function Ri(e){e.flags|=4}function ki(e,t){if(null!==e&&e.child===t.child)return!0;if(0!==(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!==(12854&e.flags)||0!==(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Q)mi=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)H(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},vi=function(){},yi=function(e,t,n,r,i){if((e=e.memoizedProps)!==r){var a=t.stateNode,o=cr(lr.current);n=Y(a,n,e,r,i,o),(t.updateQueue=n)&&Ri(t)}},bi=function(e,t,n,r){n!==r&&Ri(t)};else if(O){mi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=Ee(a,i.type,i.memoizedProps,i)),H(e,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=Me(a,i.memoizedProps,i)),H(e,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),mi(e,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var Ei=function e(t,n,r,i){for(var a=n.child;null!==a;){if(5===a.tag){var o=a.stateNode;r&&i&&(o=Ee(o,a.type,a.memoizedProps,a)),xe(t,o)}else if(6===a.tag)o=a.stateNode,r&&i&&(o=Me(o,a.memoizedProps,a)),xe(t,o);else if(4!==a.tag)if(22===a.tag&&null!==a.memoizedState)null!==(o=a.child)&&(o.return=a),e(t,a,!0,!0);else if(null!==a.child){a.child.return=a,a=a.child;continue}if(a===n)break;for(;null===a.sibling;){if(null===a.return||a.return===n)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};vi=function(e,t){var n=t.stateNode;if(!ki(e,t)){e=n.containerInfo;var r=Se(e);Ei(r,t,!1,!1),n.pendingChildren=r,Ri(t),Re(e,r)}},yi=function(e,t,n,r,i){var a=e.stateNode,o=e.memoizedProps;if((e=ki(e,t))&&o===r)t.stateNode=a;else{var s=t.stateNode,l=cr(lr.current),u=null;o!==r&&(u=Y(s,n,o,r,i,l)),e&&null===u?t.stateNode=a:(a=Ze(a,u,n,o,r,t,e,s),X(a,n,r,i,l)&&Ri(t),t.stateNode=a,e?Ri(t):mi(a,t,!1,!1))}},bi=function(e,t,n,r){n!==r?(e=cr(gr.current),n=cr(lr.current),t.stateNode=K(r,e,n,t),Ri(t)):t.stateNode=e.stateNode}}else vi=function(){},yi=function(){},bi=function(){};function Mi(e,t){if(!Un)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ni(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Wi(e,t,n){var r=t.pendingProps;switch(Yn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ni(t),null;case 1:case 17:return It(t.type)&&ht(),Ni(t),null;case 3:return r=t.stateNode,Ar(),st(ct),st(gt),mr(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(qn(t)?Ri(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==Dn&&(xo(Dn),Dn=null))),vi(e,t),Ni(t),null;case 5:hr(t),n=cr(gr.current);var i=t.type;if(null!==e&&null!=t.stateNode)yi(e,t,i,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(o(166));return Ni(t),null}if(e=cr(lr.current),qn(t)){if(!J)throw Error(o(175));e=Ke(t.stateNode,t.type,t.memoizedProps,n,e,t,!zn),t.updateQueue=e,null!==e&&Ri(t)}else{var a=L(i,r,n,e,t);mi(a,t,!1,!1),t.stateNode=a,X(a,i,r,n,e)&&Ri(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ni(t),null;case 6:if(e&&null!=t.stateNode)bi(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(o(166));if(e=cr(gr.current),n=cr(lr.current),qn(t)){if(!J)throw Error(o(176));if(e=t.stateNode,r=t.memoizedProps,(n=Ue(e,r,t,!zn))&&null!==(i=_n))switch(a=0!==(1&i.mode),i.tag){case 3:qe(i.stateNode.containerInfo,e,r,a);break;case 5:$e(i.type,i.memoizedProps,i.stateNode,e,r,a)}n&&Ri(t)}else t.stateNode=K(r,e,n,t)}return Ni(t),null;case 13:if(st(Cr),r=t.memoizedState,Un&&null!==Kn&&0!==(1&t.mode)&&0===(128&t.flags)){for(e=Kn;e;)e=He(e);return $n(),t.flags|=98560,t}if(null!==r&&null!==r.dehydrated){if(r=qn(t),null===e){if(!r)throw Error(o(318));if(!J)throw Error(o(344));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(o(317));ze(e,t)}else $n(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;return Ni(t),null}return null!==Dn&&(xo(Dn),Dn=null),0!==(128&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?qn(t):n=null!==e.memoizedState,r&&!n&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&Cr.current)?0===$a&&($a=3):Vo())),null!==t.updateQueue&&(t.flags|=4),Ni(t),null);case 4:return Ar(),vi(e,t),null===e&&q(t.stateNode.containerInfo),Ni(t),null;case 10:return ln(t.type._context),Ni(t),null;case 19:if(st(Cr),null===(i=t.memoizedState))return Ni(t),null;if(r=0!==(128&t.flags),null===(a=i.rendering))if(r)Mi(i,!1);else{if(0!==$a||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=fr(e))){for(t.flags|=128,Mi(i,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,r=t.child;null!==r;)i=e,(n=r).flags&=14680066,null===(a=n.alternate)?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,i=a.dependencies,n.dependencies=null===i?null:{lanes:i.lanes,firstContext:i.firstContext}),r=r.sibling;return lt(Cr,1&Cr.current|2),t.child}e=e.sibling}null!==i.tail&&Lt()>so&&(t.flags|=128,r=!0,Mi(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=fr(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),Mi(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!Un)return Ni(t),null}else 2*Lt()-i.renderingStartTime>so&&1073741824!==n&&(t.flags|=128,r=!0,Mi(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Lt(),t.sibling=null,e=Cr.current,lt(Cr,r?1&e|2:1&e),t):(Ni(t),null);case 22:case 23:return Mo(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&ja)&&(Ni(t),Q&&6&t.subtreeFlags&&(t.flags|=8192)):Ni(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}var Fi=s.ReactCurrentOwner,Vi=!1;function Ti(e,t,n,r){t.child=null===e?or(t,null,n,r):ar(t,e.child,n,r)}function Li(e,t,n,r,i){n=n.render;var a=t.ref;return gn(t,i),r=Mr(e,t,n,r,a,i),n=Nr(),null===e||Vi?(Un&&n&&Xn(t),t.flags|=1,Ti(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ia(e,t,i))}function Hi(e,t,n,r,i){if(null===e){var a=n.type;return"function"!==typeof a||$o(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ts(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Xi(e,t,a,r,i))}if(a=e.child,0===(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:qt)(o,r)&&e.ref===t.ref)return ia(e,t,i)}return t.flags|=1,(e=es(a,r)).ref=t.ref,e.return=t,t.child=e}function Xi(e,t,n,r,i){if(null!==e&&qt(e.memoizedProps,r)&&e.ref===t.ref){if(Vi=!1,0===(e.lanes&i))return t.lanes=e.lanes,ia(e,t,i);0!==(131072&e.flags)&&(Vi=!0)}return Ki(e,t,n,r,i)}function Yi(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null},lt(qa,ja),ja|=n;else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,lt(qa,ja),ja|=e,null;t.memoizedState={baseLanes:0,cachePool:null},r=null!==a?a.baseLanes:n,lt(qa,ja),ja|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,lt(qa,ja),ja|=r;return Ti(e,t,i,n),t.child}function _i(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ki(e,t,n,r,i){var a=It(n)?dt:gt.current;return a=At(t,a),gn(t,i),n=Mr(e,t,n,r,a,i),r=Nr(),null===e||Vi?(Un&&r&&Xn(t),t.flags|=1,Ti(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ia(e,t,i))}function Ui(e,t,n,r,i){if(It(n)){var a=!0;pt(t)}else a=!1;if(gn(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),Zn(t,n,r),xn(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;"object"===typeof u&&null!==u?u=cn(u):u=At(t,u=It(n)?dt:gt.current);var g=n.getDerivedStateFromProps,c="function"===typeof g||"function"===typeof o.getSnapshotBeforeUpdate;c||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||l!==u)&&Sn(t,o,r,u),An=!1;var d=t.memoizedState;o.state=d,vn(t,r,o,i),l=t.memoizedState,s!==r||d!==l||ct.current||An?("function"===typeof g&&(Bn(t,n,g,r),l=t.memoizedState),(s=An||wn(t,n,s,r,d,l,u))?(c||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,hn(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:en(t.type,s),o.props=u,c=t.pendingProps,d=o.context,"object"===typeof(l=n.contextType)&&null!==l?l=cn(l):l=At(t,l=It(n)?dt:gt.current);var A=n.getDerivedStateFromProps;(g="function"===typeof A||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==c||d!==l)&&Sn(t,o,r,l),An=!1,d=t.memoizedState,o.state=d,vn(t,r,o,i);var I=t.memoizedState;s!==c||d!==I||ct.current||An?("function"===typeof A&&(Bn(t,n,A,r),I=t.memoizedState),(u=An||wn(t,n,u,r,d,I,l)||!1)?(g||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,I,l),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,I,l)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=I),o.props=r,o.state=I,o.context=l,r=u):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return zi(e,t,n,r,a,i)}function zi(e,t,n,r,i,a){_i(e,t);var o=0!==(128&t.flags);if(!r&&!o)return i&&mt(t,n,!1),ia(e,t,a);r=t.stateNode,Fi.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=ar(t,e.child,null,a),t.child=ar(t,null,s,a)):Ti(e,t,s,a),t.memoizedState=r.state,i&&mt(t,n,!0),t.child}function Di(e){var t=e.stateNode;t.pendingContext?Ct(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ct(0,t.context,!1),dr(e,t.containerInfo)}function Pi(e,t,n,r,i){return $n(),er(i),t.flags|=256,Ti(e,t,n,r),t.child}var Qi={dehydrated:null,treeContext:null,retryLane:0};function Oi(e){return{baseLanes:e,cachePool:null}}function Ji(e,t,n){var r,i=t.pendingProps,a=Cr.current,s=!1,l=0!==(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),lt(Cr,1&a),null===e)return Jn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:Te(e)?t.lanes=8:t.lanes=1073741824,null):(a=i.children,e=i.fallback,s?(i=t.mode,s=t.child,a={mode:"hidden",children:a},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=a):s=rs(a,i,0,null),e=ns(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Oi(n),t.memoizedState=Qi,e):ji(t,a));if(null!==(a=e.memoizedState)){if(null!==(r=a.dehydrated)){if(l)return 256&t.flags?(t.flags&=-257,ea(e,t,n,Error(o(422)))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=i.fallback,a=t.mode,i=rs({mode:"visible",children:i.children},a,0,null),(s=ns(s,a,n,null)).flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,0!==(1&t.mode)&&ar(t,e.child,null,n),t.child.memoizedState=Oi(n),t.memoizedState=Qi,s);if(0===(1&t.mode))t=ea(e,t,n,null);else if(Te(r))t=ea(e,t,n,Error(o(419)));else if(i=0!==(n&e.childLanes),Vi||i){if(null!==(i=Qa)){switch(n&-n){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}0!==(i=0!==(s&(i.suspendedLanes|n))?0:s)&&i!==a.retryLane&&(a.retryLane=i,Bo(e,i,-1))}Vo(),t=ea(e,t,n,Error(o(421)))}else Ve(r)?(t.flags|=128,t.child=e.child,t=Qo.bind(null,e),Le(r,t),t=null):(n=a.treeContext,J&&(Kn=_e(r),_n=t,Un=!0,Dn=null,zn=!1,null!==n&&(Nn[Wn++]=Vn,Nn[Wn++]=Tn,Nn[Wn++]=Fn,Vn=n.id,Tn=n.overflow,Fn=t)),(t=ji(t,t.pendingProps.children)).flags|=4096);return t}return s?(i=$i(e,t,i.children,i.fallback,n),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?Oi(n):{baseLanes:a.baseLanes|n,cachePool:null},s.childLanes=e.childLanes&~n,t.memoizedState=Qi,i):(n=qi(e,t,i.children,n),t.memoizedState=null,n)}return s?(i=$i(e,t,i.children,i.fallback,n),s=t.child,a=e.child.memoizedState,s.memoizedState=null===a?Oi(n):{baseLanes:a.baseLanes|n,cachePool:null},s.childLanes=e.childLanes&~n,t.memoizedState=Qi,i):(n=qi(e,t,i.children,n),t.memoizedState=null,n)}function ji(e,t){return(t=rs({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function qi(e,t,n,r){var i=e.child;return e=i.sibling,n=es(i,{mode:"visible",children:n}),0===(1&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n}function $i(e,t,n,r,i){var a=t.mode,o=(e=e.child).sibling,s={mode:"hidden",children:n};return 0===(1&a)&&t.child!==e?((n=t.child).childLanes=0,n.pendingProps=s,t.deletions=null):(n=es(e,s)).subtreeFlags=14680064&e.subtreeFlags,null!==o?r=es(o,r):(r=ns(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ea(e,t,n,r){return null!==r&&er(r),ar(t,e.child,null,n),(e=ji(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ta(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),un(e.return,t,n)}function na(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ra(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ti(e,t,r.children,n),0!==(2&(r=Cr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ta(e,n,t);else if(19===e.tag)ta(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(lt(Cr,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===fr(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),na(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===fr(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}na(t,!0,n,null,a);break;case"together":na(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ia(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),to|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=es(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=es(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function aa(e,t){switch(Yn(t),t.tag){case 1:return It(t.type)&&ht(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ar(),st(ct),st(gt),mr(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return hr(t),null;case 13:if(st(Cr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));$n()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return st(Cr),null;case 4:return Ar(),null;case 10:return ln(t.type._context),null;case 22:case 23:return Mo(),null;default:return null}}var oa=!1,sa=!1,la="function"===typeof WeakSet?WeakSet:Set,ua=null;function ga(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){zo(e,t,r)}else n.current=null}function ca(e,t,n){try{n()}catch(r){zo(e,t,r)}}var da=!1;function Aa(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&ca(t,n,a)}i=i.next}while(i!==r)}}function Ia(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ha(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=N(n);else e=n;"function"===typeof t?t(e):t.current=e}}function Ca(e,t,n){if(Ut&&"function"===typeof Ut.onCommitFiberUnmount)try{Ut.onCommitFiberUnmount(Kt,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var i=r,a=i.destroy;i=i.tag,void 0!==a&&(0!==(2&i)||0!==(4&i))&&ca(t,n,a),r=r.next}while(r!==e)}break;case 1:if(ga(t,n),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){zo(t,n,o)}break;case 5:ga(t,n);break;case 4:Q?Ga(e,t,n):O&&O&&(t=t.stateNode.containerInfo,n=Se(t),ke(t,n))}}function fa(e,t,n){for(var r=t;;)if(Ca(e,r,n),null===r.child||Q&&4===r.tag){if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}else r.child.return=r,r=r.child}function pa(e){var t=e.alternate;null!==t&&(e.alternate=null,pa(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&ee(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ma(e){return 5===e.tag||3===e.tag||4===e.tag}function va(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ma(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ya(e){if(Q){e:{for(var t=e.return;null!==t;){if(ma(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(n.tag){case 5:t=n.stateNode,32&n.flags&&(ve(t),n.flags&=-33),Ba(e,n=va(e),t);break;case 3:case 4:t=n.stateNode.containerInfo,ba(e,n=va(e),t);break;default:throw Error(o(161))}}}function ba(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?fe(n,e,t):de(n,e);else if(4!==r&&null!==(e=e.child))for(ba(e,t,n),e=e.sibling;null!==e;)ba(e,t,n),e=e.sibling}function Ba(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?Ce(n,e,t):ce(n,e);else if(4!==r&&null!==(e=e.child))for(Ba(e,t,n),e=e.sibling;null!==e;)Ba(e,t,n),e=e.sibling}function Ga(e,t,n){for(var r,i,a=t,s=!1;;){if(!s){s=a.return;e:for(;;){if(null===s)throw Error(o(160));switch(r=s.stateNode,s.tag){case 5:i=!1;break e;case 3:case 4:r=r.containerInfo,i=!0;break e}s=s.return}s=!0}if(5===a.tag||6===a.tag)fa(e,a,n),i?me(r,a.stateNode):pe(r,a.stateNode);else if(18===a.tag)i?Je(r,a.stateNode):Oe(r,a.stateNode);else if(4===a.tag){if(null!==a.child){r=a.stateNode.containerInfo,i=!0,a.child.return=a,a=a.child;continue}}else if(Ca(e,a,n),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(s=!1)}a.sibling.return=a.return,a=a.sibling}}function wa(e,t){if(Q){switch(t.tag){case 0:case 11:case 14:case 15:return Aa(3,t,t.return),Ia(3,t),void Aa(5,t,t.return);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&he(n,a,i,e,r,t)}return;case 6:if(null===t.stateNode)throw Error(o(162));return n=t.memoizedProps,void Ae(t.stateNode,null!==e?e.memoizedProps:n,n);case 3:return void(J&&null!==e&&e.memoizedState.isDehydrated&&Pe(t.stateNode.containerInfo));case 13:case 19:return void Za(t)}throw Error(o(163))}switch(t.tag){case 0:case 11:case 14:case 15:return Aa(3,t,t.return),Ia(3,t),void Aa(5,t,t.return);case 12:case 22:case 23:return;case 13:case 19:return void Za(t);case 3:J&&null!==e&&e.memoizedState.isDehydrated&&Pe(t.stateNode.containerInfo)}e:if(O){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,ke(t.containerInfo,t.pendingChildren);break e}throw Error(o(163))}}function Za(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new la),t.forEach((function(t){var r=Oo.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Sa(e,t,n){ua=e,xa(e,t,n)}function xa(e,t,n){for(var r=0!==(1&e.mode);null!==ua;){var i=ua,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||oa;if(!o){var s=i.alternate,l=null!==s&&null!==s.memoizedState||sa;s=oa;var u=sa;if(oa=o,(sa=l)&&!u)for(ua=i;null!==ua;)l=(o=ua).child,22===o.tag&&null!==o.memoizedState?Ea(i):null!==l?(l.return=o,ua=l):Ea(i);for(;null!==a;)ua=a,xa(a,t,n),a=a.sibling;ua=i,oa=s,sa=u}Ra(e)}else 0!==(8772&i.subtreeFlags)&&null!==a?(a.return=i,ua=a):Ra(e)}}function Ra(e){for(;null!==ua;){var t=ua;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:sa||Ia(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!sa)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:en(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&yn(t,a,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:n=N(t.child.stateNode);break;case 1:n=t.child.stateNode}yn(t,s,n)}break;case 5:var l=t.stateNode;null===n&&4&t.flags&&Ie(l,t.type,t.memoizedProps,t);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:break;case 13:if(J&&null===t.memoizedState){var u=t.alternate;if(null!==u){var g=u.memoizedState;if(null!==g){var c=g.dehydrated;null!==c&&Qe(c)}}}break;default:throw Error(o(163))}sa||512&t.flags&&ha(t)}catch(d){zo(t,t.return,d)}}if(t===e){ua=null;break}if(null!==(n=t.sibling)){n.return=t.return,ua=n;break}ua=t.return}}function ka(e){for(;null!==ua;){var t=ua;if(t===e){ua=null;break}var n=t.sibling;if(null!==n){n.return=t.return,ua=n;break}ua=t.return}}function Ea(e){for(;null!==ua;){var t=ua;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ia(4,t)}catch(l){zo(t,n,l)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(l){zo(t,i,l)}}var a=t.return;try{ha(t)}catch(l){zo(t,a,l)}break;case 5:var o=t.return;try{ha(t)}catch(l){zo(t,o,l)}}}catch(l){zo(t,t.return,l)}if(t===e){ua=null;break}var s=t.sibling;if(null!==s){s.return=t.return,ua=s;break}ua=t.return}}var Ma=0,Na=1,Wa=2,Fa=3,Va=4;if("function"===typeof Symbol&&Symbol.for){var Ta=Symbol.for;Ma=Ta("selector.component"),Na=Ta("selector.has_pseudo_class"),Wa=Ta("selector.role"),Fa=Ta("selector.test_id"),Va=Ta("selector.text")}function La(e){var t=j(e);if(null!=t){if("string"!==typeof t.memoizedProps["data-testname"])throw Error(o(364));return t}if(null===(e=ie(e)))throw Error(o(362));return e.stateNode.current}function Ha(e,t){switch(t.$$typeof){case Ma:if(e.type===t.value)return!0;break;case Na:e:{t=t.value,e=[e,0];for(var n=0;n ";case Na:return":has("+(Xa(e)||"")+")";case Wa:return'[role="'+e.value+'"]';case Va:return'"'+e.value+'"';case Fa:return'[data-testname="'+e.value+'"]';default:throw Error(o(365))}}function Ya(e,t){var n=[];e=[e,0];for(var r=0;r i&&(i=s),r&=~a}if(r=i,10<(r=(120>(r=Lt()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ka(r/1960))-r)){e.timeoutHandle=U(_o.bind(null,e,ao),r);break}_o(e,ao);break;default:throw Error(o(329))}}}return wo(e,Lt()),e.callbackNode===n?Zo.bind(null,e):null}function So(e,t){var n=io;return e.current.memoizedState.isDehydrated&&(No(e,t).flags|=256),2!==(e=To(e,t))&&(t=ao,ao=n,null!==t&&xo(t)),e}function xo(e){null===ao?ao=e:ao.push.apply(ao,e)}function Ro(e,t){for(t&=~ro,t&=~no,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0 e?16:e,null===ho)var r=!1;else{if(e=ho,ho=null,Co=0,0!==(6&Pa))throw Error(o(331));var i=Pa;for(Pa|=4,ua=e.current;null!==ua;){var a=ua,s=a.child;if(0!==(16&ua.flags)){var l=a.deletions;if(null!==l){for(var u=0;u Lt()-oo?No(e,0):ro|=n),wo(e,t)}function Po(e,t){0===t&&(0===(1&e.mode)?t=1:(t=Gt,0===(130023424&(Gt<<=1))&&(Gt=4194304)));var n=yo();null!==(e=Go(e,t))&&(kt(e,t,n),wo(e,n))}function Qo(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Po(e,n)}function Oo(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(t),Po(e,n)}function Jo(e,t){return Wt(e,t)}function jo(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qo(e,t,n,r){return new jo(e,t,n,r)}function $o(e){return!(!(e=e.prototype)||!e.isReactComponent)}function es(e,t){var n=e.alternate;return null===n?((n=qo(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ts(e,t,n,r,i,a){var s=2;if(r=e,"function"===typeof e)$o(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case g:return ns(n.children,i,a,t);case c:s=8,i|=8;break;case d:return(e=qo(12,n,t,2|i)).elementType=d,e.lanes=a,e;case C:return(e=qo(13,n,t,i)).elementType=C,e.lanes=a,e;case f:return(e=qo(19,n,t,i)).elementType=f,e.lanes=a,e;case v:return rs(n,i,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case A:s=10;break e;case I:s=9;break e;case h:s=11;break e;case p:s=14;break e;case m:s=16,r=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=qo(s,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function ns(e,t,n,r){return(e=qo(7,e,r,t)).lanes=n,e}function rs(e,t,n,r){return(e=qo(22,e,r,t)).elementType=v,e.lanes=n,e.stateNode={},e}function is(e,t,n){return(e=qo(6,e,null,t)).lanes=n,e}function as(e,t,n){return(t=qo(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function os(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=D,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rt(0),this.expirationTimes=Rt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.identifierPrefix=r,this.onRecoverableError=i,J&&(this.mutableSourceEagerHydrationData=null)}function ss(e,t,n,r,i,a,o,s,l){return e=new os(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=qo(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null},In(a),e}function ls(e){if(!e)return ut;e:{if(w(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(It(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(It(n))return ft(e,n,t)}return t}function us(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return null===(e=x(t))?null:e.stateNode}function gs(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n =g&&a>=d&&i<=c&&s<=A){e.splice(t,1);break}if(!(r!==g||n.width!==u.width||As)){d>a&&(u.height+=d-a,u.y=a),A i)){g>r&&(u.width+=g-r,u.x=r),cn&&(n=s)),s")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?N(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:ds,findFiberByHostInstance:e.findFiberByHostInstance||As,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},"undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Kt=t.inject(e),Ut=t}catch(n){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!re)throw Error(o(363));e=_a(e,t);var i=ge(e,n,r).disconnect;return{disconnect:function(){i()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Mt;try{return Mt=e,t()}finally{Mt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var i=t.current,a=yo(),o=bo(i);return n=ls(n),null===t.context?t.context=n:t.pendingContext=n,(t=Cn(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),fn(i,t),null!==(e=Bo(i,o,a))&&pn(e,i,o),o},t}},4585:function(e,t,n){"use strict";e.exports=n(4976)},258:function(e,t,n){"use strict";e.exports=n(3721)},503:function(e,t,n){"use strict";t.Z=void 0;var r=o(n(2791)),i=o(n(2007)),a=o(n(1694));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var t=e.animate,n=void 0===t||t,i=e.className,o=void 0===i?"":i,s=e.layout,l=void 0===s?"2-columns":s,u=e.lineColor,g=void 0===u?"#FFF":u,c=e.children;return"object"===typeof window&&document.documentElement.style.setProperty("--line-color",g),r.default.createElement("div",{className:(0,a.default)(o,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":"2-columns"===l,"vertical-timeline--one-column-left":"1-column"===l||"1-column-left"===l,"vertical-timeline--one-column-right":"1-column-right"===l})},c)};s.propTypes={children:i.default.oneOfType([i.default.arrayOf(i.default.node),i.default.node]).isRequired,className:i.default.string,animate:i.default.bool,layout:i.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:i.default.string};var l=s;t.Z=l},5953:function(e,t,n){"use strict";t.Z=void 0;var r=s(n(2791)),i=s(n(2007)),a=s(n(1694)),o=n(8105);function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){var t=e.children,n=void 0===t?"":t,i=e.className,s=void 0===i?"":i,l=e.contentArrowStyle,u=void 0===l?null:l,g=e.contentStyle,c=void 0===g?null:g,d=e.date,A=void 0===d?"":d,I=e.dateClassName,h=void 0===I?"":I,C=e.icon,f=void 0===C?null:C,p=e.iconClassName,m=void 0===p?"":p,v=e.iconOnClick,y=void 0===v?null:v,b=e.onTimelineElementClick,B=void 0===b?null:b,G=e.iconStyle,w=void 0===G?null:G,Z=e.id,S=void 0===Z?"":Z,x=e.position,R=void 0===x?"":x,k=e.style,E=void 0===k?null:k,M=e.textClassName,N=void 0===M?"":M,W=e.intersectionObserverProps,F=void 0===W?{rootMargin:"0px 0px -40px 0px",triggerOnce:!0}:W,V=e.visible,T=void 0!==V&&V;return r.default.createElement(o.InView,F,(function(e){var t=e.inView,i=e.ref;return r.default.createElement("div",{ref:i,id:S,className:(0,a.default)(s,"vertical-timeline-element",{"vertical-timeline-element--left":"left"===R,"vertical-timeline-element--right":"right"===R,"vertical-timeline-element--no-children":""===n}),style:E},r.default.createElement(r.default.Fragment,null,r.default.createElement("span",{style:w,onClick:y,className:(0,a.default)(m,"vertical-timeline-element-icon",{"bounce-in":t||T,"is-hidden":!(t||T)})},f),r.default.createElement("div",{style:c,onClick:B,className:(0,a.default)(N,"vertical-timeline-element-content",{"bounce-in":t||T,"is-hidden":!(t||T)})},r.default.createElement("div",{style:u,className:"vertical-timeline-element-content-arrow"}),n,r.default.createElement("span",{className:(0,a.default)(h,"vertical-timeline-element-date")},A))))}))};l.propTypes={children:i.default.oneOfType([i.default.arrayOf(i.default.node),i.default.node]),className:i.default.string,contentArrowStyle:i.default.shape({}),contentStyle:i.default.shape({}),date:i.default.node,dateClassName:i.default.string,icon:i.default.element,iconClassName:i.default.string,iconStyle:i.default.shape({}),iconOnClick:i.default.func,onTimelineElementClick:i.default.func,id:i.default.string,position:i.default.string,style:i.default.shape({}),textClassName:i.default.string,visible:i.default.bool,intersectionObserverProps:i.default.shape({root:i.default.object,rootMargin:i.default.string,threshold:i.default.number,triggerOnce:i.default.bool})};var u=l;t.Z=u},7562:function(e,t,n){"use strict";e.exports={VerticalTimeline:n(503).Z,VerticalTimelineElement:n(5953).Z}},6374:function(e,t,n){"use strict";var r=n(2791),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,a={},u=null,g=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(g=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:g,props:a,_owner:s.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},9117:function(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),A=Symbol.iterator;var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,C={};function f(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||I}function p(){}function m(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||I}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},p.prototype=f.prototype;var v=m.prototype=new p;v.constructor=m,h(v,f.prototype),v.isPureReactComponent=!0;var y=Array.isArray,b=Object.prototype.hasOwnProperty,B={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function w(e,t,r){var i,a={},o=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)b.call(t,i)&&!G.hasOwnProperty(i)&&(a[i]=t[i]);var l=arguments.length-2;if(1===l)a.children=r;else if(1 >>1,i=e[r];if(!(0>>1;r a(l,n))ua(g,l)?(e[r]=g,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(ua(g,n)))break e;e[r]=g,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],g=[],c=1,d=null,A=3,I=!1,h=!1,C=!1,f="function"===typeof setTimeout?setTimeout:null,p="function"===typeof clearTimeout?clearTimeout:null,m="undefined"!==typeof setImmediate?setImmediate:null;function v(e){for(var t=r(g);null!==t;){if(null===t.callback)i(g);else{if(!(t.startTime<=e))break;i(g),t.sortIndex=t.expirationTime,n(u,t)}t=r(g)}}function y(e){if(C=!1,v(e),!h)if(null!==r(u))h=!0,N(b);else{var t=r(g);null!==t&&W(y,t.startTime-e)}}function b(e,n){h=!1,C&&(C=!1,p(Z),Z=-1),I=!0;var a=A;try{for(v(n),d=r(u);null!==d&&(!(d.expirationTime>n)||e&&!R());){var o=d.callback;if("function"===typeof o){d.callback=null,A=d.priorityLevel;var s=o(d.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?d.callback=s:d===r(u)&&i(u),v(n)}else i(u);d=r(u)}if(null!==d)var l=!0;else{var c=r(g);null!==c&&W(y,c.startTime-n),l=!1}return l}finally{d=null,A=a,I=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var B,G=!1,w=null,Z=-1,S=5,x=-1;function R(){return!(t.unstable_now()-x e||125o?(e.sortIndex=a,n(g,e),null===r(u)&&e===r(g)&&(C?(p(Z),Z=-1):C=!0,W(y,a-o))):(e.sortIndex=s,n(u,e),h||I||(h=!0,N(b))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},5296:function(e,t,n){"use strict";e.exports=n(6813)},907:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n =e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}},9388:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1120),i=n(8814),a=n(2963);function o(e){var t=(0,i.Z)();return function(){var n,i=(0,r.Z)(e);if(t){var o=(0,r.Z)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return(0,a.Z)(this,n)}}},4942:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9142);function i(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},1752:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1120);function i(){return i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=(0,r.Z)(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},i.apply(this,arguments)}},1120:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:function(){return r}})},136:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.Z)(e,t)}},8814:function(e,t,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}n.d(t,{Z:function(){return r}})},9199:function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,{Z:function(){return r}})},5267:function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{Z:function(){return r}})},1413:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(4942);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t =0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),u=a.call(o,"finallyLoc");if(l&&u){if(this.prev =0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev =0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}},9611:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:function(){return r}})},9439:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3878);var i=n(181),a=n(5267);function o(e,t){return(0,r.Z)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||(0,i.Z)(e,t)||(0,a.Z)()}},3433:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(907);var i=n(9199),a=n(181);function o(e){return function(e){if(Array.isArray(e))return(0,r.Z)(e)}(e)||(0,i.Z)(e)||(0,a.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},9142:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1002);function i(e){var t=function(e,t){if("object"!==(0,r.Z)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==(0,r.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===(0,r.Z)(t)?t:String(t)}},1002:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:function(){return r}})},181:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(907);function i(e,t){if(e){if("string"===typeof e)return(0,r.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(e,t):void 0}}},8664:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1120),i=n(9611);var a=n(5647);function o(e){var t="function"===typeof Map?new Map:void 0;return o=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"===typeof e}}(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return(0,a.Z)(e,arguments,(0,r.Z)(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(n,e)},o(e)}},3037:function(e,t,n){"use strict";n.d(t,{EPV:function(){return Yo},I7w:function(){return Vd},_wu:function(){return OI},eei:function(){return Mr},kGY:function(){return Kl},xr3:function(){return Md},z$f:function(){return HC}});var r=n(4942),i=n(3433),a=n(8664),o=n(9439),s=n(2963),l=n(1413),u=n(4165),g=n(5861),c=n(7762),d=n(7326),A=n(1752),I=n(1120),h=n(5671),C=n(3144),f=n(136),p=n(9388),m=n(7760),v=n(1617),y,b,B,G=null,w=Object.defineProperty,Z=function(e,t,n){return t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},S=function(e,t,n){return Z(e,"symbol"!==typeof t?t+"":t,n),n},x=null,R=null,k=null,E=null,M=0,N=1,W=new m.Vector3,F=new m.Line3,V=new m.Plane,T=new m.Vector3,L=new m.Triangle,H=null,X=null,Y=null,_=null,K=null,U=null,z=new m.Vector3,D=null,P=null,Q=new m.Vector3,O=new m.Quaternion,J=new m.Vector3,j=new m.Vector3,q=new m.Quaternion,$=new m.Vector3,ee=null,te=null,ne=null,re=null,ie=null,ae=null,oe=null,se=null,le,ue;function ge(){!1===document.hidden&&this.reset()}function ce(){var e;if(void 0!==le)return le;try{var t,n=document.createElement("canvas");return le=!(!window.WebGLRenderingContext||!(t=n.getContext("webgl"))),t&&(null==(e=t.getExtension("WEBGL_lose_context"))||e.loseContext()),le}catch(r){return le=!1}}function de(){var e;if(void 0!==ue)return ue;try{var t,n=document.createElement("canvas");return ue=!(!window.WebGL2RenderingContext||!(t=n.getContext("webgl2"))),t&&(null==(e=t.getExtension("WEBGL_lose_context"))||e.loseContext()),ue}catch(r){return ue=!1}}function Ae(){return he(1)}function Ie(){return he(2)}function he(e){var t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},n=document.createElement("div");n.id="webglmessage",n.style.fontFamily="monospace",n.style.fontSize="13px",n.style.fontWeight="normal",n.style.textAlign="center",n.style.background="#fff",n.style.color="#000",n.style.padding="1.5em",n.style.width="400px",n.style.margin="5em auto 0";var r='Your $0 does not seem to support $1';return r=(r=t[e]?r.replace("$0","graphics card"):r.replace("$0","browser")).replace("$1",{1:"WebGL",2:"WebGL 2"}[e]),n.innerHTML=r,n}var Ce=null,fe=null;function pe(){var e=3e6,t=new BufferAttribute(new Float32Array(e),3);t.usage=DynamicDrawUsage;var n=new BufferAttribute(new Float32Array(e),3);n.usage=DynamicDrawUsage;var r=new BufferAttribute(new Float32Array(e),3);r.usage=DynamicDrawUsage;var i=new BufferGeometry;i.setAttribute("position",t),i.setAttribute("normal",n),i.setAttribute("color",r),i.drawRange.count=0;var a=new MeshStandardMaterial({vertexColors:!0}),o=new Mesh(i,a);o.frustumCulled=!1;var s=new Vector3,l=new Vector3,u=new Vector3,g=new Vector3,c=new Color(16777215),d=1;function A(e,a,o,A){if(0!==e.distanceToSquared(a)){for(var I=i.drawRange.count,h=function(e){for(var t=2*Math.PI,n=[],r=.01*e,i=0;i<10;i++){var a=i/10*t;n.push(new Vector3(Math.sin(a)*r,Math.cos(a)*r,0))}return n}(d),C=0,f=h.length;C 0&&void 0!==arguments[0]?arguments[0]:1,t=new Float32Array(De*Pe*e*ze),n=new DataTexture(t,De,Pe*e,RGBAFormat,FloatType);return n.wrapS=RepeatWrapping,n.wrapT=RepeatWrapping,n.magFilter=NearestFilter,n.needsUpdate=!0,n},Oe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.floor(De*(Pe/4));t.arcLengthDivisions=r/2,t.updateArcLengths();for(var i=t.getSpacedPoints(r),a=t.computeFrenetFrames(r,!0),o=0;o 2&&void 0!==arguments[2]?arguments[2]:1;e.__ok||(e.__ok=!0,e.onBeforeCompile=function(e){if(!e.__modified){e.__modified=!0,Object.assign(e.uniforms,t);var r="\n\t\tuniform sampler2D spineTexture;\n\t\tuniform float pathOffset;\n\t\tuniform float pathSegment;\n\t\tuniform float spineOffset;\n\t\tuniform float spineLength;\n\t\tuniform int flow;\n\n\t\tfloat textureLayers = ".concat(Pe*n,".;\n\t\tfloat textureStacks = ").concat(Pe/4,".;\n\n\t\t").concat(e.vertexShader,"\n\t\t").replace("#include ","").replace("#include ","").replace("#include ","").replace(/void\s*main\s*\(\)\s*\{/,"\n void main() {\n #include \n\n vec4 worldPos = modelMatrix * vec4(position, 1.);\n\n bool bend = flow > 0;\n float xWeight = bend ? 0. : 1.;\n\n #ifdef USE_INSTANCING\n float pathOffsetFromInstanceMatrix = instanceMatrix[3][2];\n float spineLengthFromInstanceMatrix = instanceMatrix[3][0];\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLengthFromInstanceMatrix : 0.;\n float mt = (spinePortion * pathSegment + pathOffset + pathOffsetFromInstanceMatrix)*textureStacks;\n #else\n float spinePortion = bend ? (worldPos.x + spineOffset) / spineLength : 0.;\n float mt = (spinePortion * pathSegment + pathOffset)*textureStacks;\n #endif\n\n mt = mod(mt, textureStacks);\n float rowOffset = floor(mt);\n\n #ifdef USE_INSTANCING\n rowOffset += instanceMatrix[3][1] * ".concat(Pe,".;\n #endif\n\n vec3 spinePos = texture2D(spineTexture, vec2(mt, (0. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 a = texture2D(spineTexture, vec2(mt, (1. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 b = texture2D(spineTexture, vec2(mt, (2. + rowOffset + 0.5) / textureLayers)).xyz;\n vec3 c = texture2D(spineTexture, vec2(mt, (3. + rowOffset + 0.5) / textureLayers)).xyz;\n mat3 basis = mat3(a, b, c);\n\n vec3 transformed = basis\n * vec3(worldPos.x * xWeight, worldPos.y * 1., worldPos.z * 1.)\n + spinePos;\n\n vec3 transformedNormal = normalMatrix * (basis * objectNormal);\n\t\t\t")).replace("#include ","vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\t\t\t\tgl_Position = projectionMatrix * mvPosition;");e.vertexShader=r}})}var $e=null,et=new m.Matrix4,tt=null,nt=function(e,t){return e[t]},rt=function(e,t){var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=e[0].morphTargetsRelative,l=new m.BufferGeometry,u=0;if(e.forEach((function(e,g){var c=0;if(n!==(null!==e.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+g+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var d in e.attributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+g+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[d]&&(a[d]=[]),a[d].push(e.attributes[d]),c++}if(c!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+g+". Make sure all geometries have the same number of attributes."),null;if(s!==e.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+g+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var A in e.morphAttributes){if(!i.has(A))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+g+". .morphAttributes must be consistent throughout all geometries."),null;void 0===o[A]&&(o[A]=[]),o[A].push(e.morphAttributes[A])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(e.userData),t){var I;if(e.index)I=e.index.count;else{if(void 0===e.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+g+". The geometry must have either an index or a position attribute"),null;I=e.attributes.position.count}l.addGroup(u,I,g),u+=I}})),n){var g=0,c=[];e.forEach((function(e){for(var t=e.index,n=0;n 1&&void 0!==arguments[1]?arguments[1]:1e-4;t=Math.max(t,Number.EPSILON);for(var n={},r=e.getIndex(),i=e.getAttribute("position"),a=r?r.count:i.count,o=0,s=Object.keys(e.attributes),l={},u={},g=[],c=["getX","getY","getZ","getW"],d=0,A=s.length;d1&&void 0!==arguments[1]?arguments[1]:Math.PI/3,n=Math.cos(t),r=100*(1+1e-10),i=[new m.Vector3,new m.Vector3,new m.Vector3],a=new m.Vector3,o=new m.Vector3,s=new m.Vector3,l=new m.Vector3;function u(e){var t=~~(e.x*r),n=~~(e.y*r),i=~~(e.z*r);return"".concat(t,",").concat(n,",").concat(i)}for(var g=e.index?e.toNonIndexed():e,c=g.attributes.position,d={},A=0,I=c.count/3;An&&l.add(F)}l.normalize(),G.setXYZ(S+E,l.x,l.y,l.z)}}return g.setAttribute("normal",G),g}var ct=Object.freeze(Object.defineProperty({__proto__:null,computeMorphedAttributes:ut,estimateBytesUsed:ot,interleaveAttributes:at,mergeBufferAttributes:it,mergeBufferGeometries:rt,mergeVertices:st,toCreasedNormals:gt,toTrianglesDrawMode:lt},Symbol.toStringTag,{value:"Module"})),dt=new m.Vector3,At=new m.Vector3;function It(e,t){-1===e.indexOf(t)&&e.push(t)}function ht(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var Ct=null,ft=null,pt=null,mt=null,vt=null,yt=parseInt(m.REVISION.replace(/\D+/g,"")),bt,Bt,Gt,wt;function Zt(e){return St.apply(this,arguments)}function St(){return(St=(0,g.Z)((0,u.Z)().mark((function e(t){var n,r;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.arrayBuffer();case 2:return n=e.sent,r=btoa(String.fromCharCode.apply(String,(0,i.Z)(new Uint8Array(n)))),e.abrupt("return","data:".concat(t.type||"",";base64,").concat(r));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Bt||(Bt=new m.PlaneGeometry(2,2,1,1)),Gt||(Gt=new m.ShaderMaterial({uniforms:{blitTexture:new m.Uniform(e)},vertexShader:"\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = vec4(position.xy * 1.0,0.,.999999);\n }\n ",fragmentShader:"\n uniform sampler2D blitTexture; \n varying vec2 vUv;\n\n void main(){ \n gl_FragColor = vec4(vUv.xy, 0, 1);\n \n #ifdef IS_SRGB\n gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n #else\n gl_FragColor = texture2D( blitTexture, vUv);\n #endif\n }\n "})),Gt.uniforms.blitTexture.value=e,Gt.defines.IS_SRGB="colorSpace"in e?"srgb"===e.colorSpace:3001===e.encoding,Gt.needsUpdate=!0,wt||((wt=new m.Mesh(Bt,Gt)).frustrumCulled=!1);var r=new m.PerspectiveCamera,i=new m.Scene;i.add(wt),n||(n=bt=new m.WebGLRenderer({antialias:!1})),n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(i,r);var a=new m.Texture(n.domElement);return a.minFilter=e.minFilter,a.magFilter=e.magFilter,a.wrapS=e.wrapS,a.wrapT=e.wrapT,a.name=e.name,bt&&(bt.dispose(),bt=null),a}var Rt={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},kt=function(){function e(){(0,h.Z)(this,e),this.pluginCallbacks=[],this.register((function(e){return new jt(e)})),this.register((function(e){return new qt(e)})),this.register((function(e){return new tn(e)})),this.register((function(e){return new nn(e)})),this.register((function(e){return new rn(e)})),this.register((function(e){return new an(e)})),this.register((function(e){return new $t(e)})),this.register((function(e){return new en(e)})),this.register((function(e){return new on(e)})),this.register((function(e){return new sn(e)})),this.register((function(e){return new ln(e)}))}return(0,C.Z)(e,[{key:"register",value:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}},{key:"unregister",value:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}},{key:"parse",value:function(e,t,n,r){for(var i=new Jt,a=[],o=0,s=this.pluginCallbacks.length;o 4?o=e.array[i*e.itemSize+a]:(0===a?o=e.getX(i):1===a?o=e.getY(i):2===a?o=e.getZ(i):3===a&&(o=e.getW(i)),!0===e.normalized&&(o=m.MathUtils.normalize(o,e.array))),r.min[a]=Math.min(r.min[a],o),r.max[a]=Math.max(r.max[a],o)}return r}function Dt(e){return 4*Math.ceil(e/4)}function Pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Dt(e.byteLength);if(n!==e.byteLength){var r=new Uint8Array(n);if(r.set(new Uint8Array(e)),0!==t)for(var i=e.byteLength;i2&&void 0!==A[2]?A[2]:{},this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(t),e.next=6,Promise.all(this.pending);case 6:a=(i=this).buffers,o=i.json,r=i.options,s=i.extensionsUsed,l=i.extensionsRequired,g=new Blob(a,{type:"application/octet-stream"}),c=Object.keys(s),d=Object.keys(l),c.length>0&&(o.extensionsUsed=c),d.length>0&&(o.extensionsRequired=d),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=g.size),!0===r.binary?g.arrayBuffer().then((function(e){var t=Pt(e),r=new DataView(new ArrayBuffer(Ht));r.setUint32(0,t.byteLength,!0),r.setUint32(4,Yt,!0);var i=Pt(Kt(JSON.stringify(o)),32),a=new DataView(new ArrayBuffer(Ht));a.setUint32(0,i.byteLength,!0),a.setUint32(4,Xt,!0);var s=new ArrayBuffer(Vt),l=new DataView(s);l.setUint32(0,Tt,!0),l.setUint32(4,Lt,!0);var u=Vt+a.byteLength+i.byteLength+r.byteLength+t.byteLength;l.setUint32(8,u,!0),new Blob([s,a,i,r,t],{type:"application/octet-stream"}).arrayBuffer().then(n)})):(o.buffers&&o.buffers.length>0&&Zt(g).then((function(e){o.buffers[0].uri=e})),n(o));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"serializeUserData",value:function(e,t){if(0!==Object.keys(e.userData).length){var n=this.options,r=this.extensionsUsed;try{var i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){for(var a in void 0===t.extensions&&(t.extensions={}),i.gltfExtensions)t.extensions[a]=i.gltfExtensions[a],r[a]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}}},{key:"getUID",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!1===this.uids.has(e)){var n=new Map;n.set(!0,this.uid++),n.set(!1,this.uid++),this.uids.set(e,n)}return this.uids.get(e).get(t)}},{key:"isNormalizedNormalAttribute",value:function(e){if(this.cache.attributesNormalized.has(e))return!1;for(var t=new m.Vector3,n=0,r=e.count;n 5e-4)return!1;return!0}},{key:"createNormalizedNormalAttribute",value:function(e){var t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);for(var n=e.clone(),r=new m.Vector3,i=0,a=n.count;i4?d=e.array[g*e.itemSize+c]:(0===c?d=e.getX(g):1===c?d=e.getY(g):2===c?d=e.getZ(g):3===c&&(d=e.getW(g)),!0===e.normalized&&(d=m.MathUtils.normalize(d,e.array))),t===Et.FLOAT?l.setFloat32(u,d,!0):t===Et.INT?l.setInt32(u,d,!0):t===Et.UNSIGNED_INT?l.setUint32(u,d,!0):t===Et.SHORT?l.setInt16(u,d,!0):t===Et.UNSIGNED_SHORT?l.setUint16(u,d,!0):t===Et.BYTE?l.setInt8(u,d):t===Et.UNSIGNED_BYTE&&l.setUint8(u,d),u+=a}var A={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:s};return void 0!==i&&(A.target=i),i===Et.ARRAY_BUFFER&&(A.byteStride=e.itemSize*a),this.byteOffset+=s,o.bufferViews.push(A),{id:o.bufferViews.length-1,byteLength:0}}},{key:"processBufferViewImage",value:function(e){var t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),e.arrayBuffer().then((function(e){var r=Pt(e),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1}))}},{key:"processAccessor",value:function(e,t,n,r){var i,a=this.json;if(e.array.constructor===Float32Array)i=Et.FLOAT;else if(e.array.constructor===Int32Array)i=Et.INT;else if(e.array.constructor===Uint32Array)i=Et.UNSIGNED_INT;else if(e.array.constructor===Int16Array)i=Et.SHORT;else if(e.array.constructor===Uint16Array)i=Et.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)i=Et.BYTE;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);i=Et.UNSIGNED_BYTE}if(void 0===n&&(n=0),void 0===r&&(r=e.count),0===r)return null;var o,s=zt(e,n,r);void 0!==t&&(o=e===t.index?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER);var l=this.processBufferView(e,i,n,r,o),u={bufferView:l.id,byteOffset:l.byteOffset,componentType:i,count:r,max:s.max,min:s.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(u.normalized=!0),a.accessors||(a.accessors=[]),a.accessors.push(u)-1}},{key:"processImage",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(null!==e){var i=this,a=i.cache,o=i.json,s=i.options,l=i.pending;a.images.has(e)||a.images.set(e,{});var u=a.images.get(e),g=r+":flipY/"+n.toString();if(void 0!==u[g])return u[g];o.images||(o.images=[]);var c={mimeType:r},d=Qt();d.width=Math.min(e.width,s.maxTextureSize),d.height=Math.min(e.height,s.maxTextureSize);var A=d.getContext("2d");if(!0===n&&(A.translate(0,d.height),A.scale(1,-1)),void 0!==e.data){t!==m.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>s.maxTextureSize||e.height>s.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);for(var I=new Uint8ClampedArray(e.height*e.width*4),h=0;h 0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){var u={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),r.emissiveTexture=u}}if(e.normalMap){var g={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(g.scale=e.normalScale.x),this.applyTextureTransform(g,e.normalMap),r.normalTexture=g}if(e.aoMap){var c={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(c.strength=e.aoMapIntensity),this.applyTextureTransform(c,e.aoMap),r.occlusionTexture=c}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===m.DoubleSide&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,r)}));var d=n.materials.push(r)-1;return t.materials.set(e,d),d}},{key:"processMesh",value:function(e){var t=this.cache,n=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(var i=0,a=e.material.length;i=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"}),{},{color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"}),h=u.getAttribute("normal");void 0===h||this.isNormalizedNormalAttribute(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),u.setAttribute("normal",this.createNormalizedNormalAttribute(h)));var C=null;for(var f in u.attributes)if("morph"!==f.slice(0,5)){var p=u.attributes[f];f=I[f]||f.toUpperCase();if(/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f)||(f="_"+f),t.attributes.has(this.getUID(p)))c[f]=t.attributes.get(this.getUID(p));else{C=null;var v=p.array;"JOINTS_0"!==f||v instanceof Uint16Array||v instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),C=new m.BufferAttribute(new Uint16Array(v),p.itemSize,p.normalized));var y=this.processAccessor(C||p,u);null!==y&&(f.startsWith("_")||this.detectMeshQuantization(f,p),c[f]=y,t.attributes.set(this.getUID(p),y))}}if(void 0!==h&&u.setAttribute("normal",h),0===Object.keys(c).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){var b=[],B=[],G={};if(void 0!==e.morphTargetDictionary)for(var w in e.morphTargetDictionary)G[e.morphTargetDictionary[w]]=w;for(var Z=0;Z 0&&(g.extras={},g.extras.targetNames=B)}var T=Array.isArray(e.material);if(T&&0===u.groups.length)return null;for(var L=T?e.material:[e.material],H=T?u.groups:[{materialIndex:0,start:void 0,count:void 0}],X=0,Y=H.length;X 0&&(_.targets=A),null!==u.index){var K=this.getUID(u.index);void 0===H[X].start&&void 0===H[X].count||(K+=":"+H[X].start+":"+H[X].count),t.attributes.has(K)?_.indices=t.attributes.get(K):(_.indices=this.processAccessor(u.index,u,H[X].start,H[X].count),t.attributes.set(K,_.indices)),null===_.indices&&delete _.indices}var U=this.processMaterial(L[H[X].materialIndex]);null!==U&&(_.material=U),d.push(_)}g.primitives=d,n.meshes||(n.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,g)}));var z=n.meshes.push(g)-1;return t.meshes.set(o,z),z}},{key:"detectMeshQuantization",value:function(e,t){if(!this.extensionsUsed[Mt]){var n=void 0;switch(t.array.constructor){case Int8Array:n="byte";break;case Uint8Array:n="unsigned byte";break;case Int16Array:n="short";break;case Uint16Array:n="unsigned short";break;default:return}t.normalized&&(n+=" normalized");var r=e.split("_",1)[0];Rt[r]&&Rt[r].includes(n)&&(this.extensionsUsed[Mt]=!0,this.extensionsRequired[Mt]=!0)}}},{key:"processCamera",value:function(e){var t=this.json;t.cameras||(t.cameras=[]);var n=e.isOrthographicCamera,r={type:n?"orthographic":"perspective"};return n?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:m.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),t.cameras.push(r)-1}},{key:"processAnimation",value:function(e,t){var n=this.json,r=this.nodeMap;n.animations||(n.animations=[]);for(var i=(e=kt.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,a=[],o=[],s=0;s 0){for(var u=[],g=0,c=e.children.length;g 0&&(i.children=u)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,i)}));var I=t.nodes.push(i)-1;return r.set(e,I),I}},{key:"processScene",value:function(e){var t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);var r={};""!==e.name&&(r.name=e.name),t.scenes.push(r);for(var i=[],a=0,o=e.children.length;a 0&&(r.nodes=i),this.serializeUserData(e,r)}},{key:"processObjects",value:function(e){var t=new m.Scene;t.name="AuxScene";for(var n=0;n 0&&this.processObjects(n);for(var i=0;i 0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),!e.target||e.target.parent===e&&0===e.target.position.x&&0===e.target.position.y&&-1===e.target.position.z||console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},i[this.name]=!0);var o=r.extensions[this.name].lights;o.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:o.length-1}}else console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e)}}]),e}(),qt=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_unlit"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshBasicMaterial){var n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}}]),e}(),$t=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_clearcoat"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&0!==e.clearcoat){var n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){var a={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(a,e.clearcoatMap),i.clearcoatTexture=a}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){var o={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){var s={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(s,e.clearcoatNormalMap),i.clearcoatNormalTexture=s}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),en=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_iridescence"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&0!==e.iridescence){var n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){var a={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(a,e.iridescenceMap),i.iridescenceTexture=a}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){var o={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(o,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),tn=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_transmission"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&0!==e.transmission){var n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){var a={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(a,e.transmissionMap),i.transmissionTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),nn=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_volume"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&0!==e.transmission){var n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){var a={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(a,e.thicknessMap),i.thicknessTexture=a}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),rn=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_ior"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&1.5!==e.ior){var n=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}}}]),e}(),an=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_specular"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&(1!==e.specularIntensity||!e.specularColor.equals(Ft)||e.specularIntensityMap||e.specularColorTexture)){var n=this.writer,r=n.extensionsUsed,i={};if(e.specularIntensityMap){var a={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(a,e.specularIntensityMap),i.specularTexture=a}if(e.specularColorMap){var o={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(o,e.specularColorMap),i.specularColorTexture=o}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),on=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_sheen"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&0!=e.sheen){var n=this.writer,r=n.extensionsUsed,i={};if(e.sheenRoughnessMap){var a={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(a,e.sheenRoughnessMap),i.sheenRoughnessTexture=a}if(e.sheenColorMap){var o={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(o,e.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),sn=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_anisotropy"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshPhysicalMaterial&&0!=e.anisotropy){var n=this.writer,r=n.extensionsUsed,i={};if(e.anisotropyMap){var a={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(a,e.anisotropyMap),i.anisotropyTexture=a}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}}}]),e}(),ln=function(){function e(t){(0,h.Z)(this,e),this.writer=t,this.name="KHR_materials_emissive_strength"}return(0,C.Z)(e,[{key:"writeMaterial",value:function(e,t){if(e.isMeshStandardMaterial&&1!==e.emissiveIntensity){var n=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}}}]),e}(),un=null,gn=null,cn=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{decodeSpeed:5,encodeSpeed:5,encoderMethod:e.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1};if(t instanceof m.BufferGeometry&&t.isBufferGeometry)throw new Error("DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.");if(void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");var r,i,a=t.geometry,o=DracoEncoderModule(),s=new o.Encoder;if(!a.isBufferGeometry)throw new Error("THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.");if(t instanceof m.Mesh&&t.isMesh){r=new o.MeshBuilder,i=new o.Mesh;var l=a.getAttribute("position");r.AddFloatAttributeToMesh(i,o.POSITION,l.count,l.itemSize,l.array);var u=a.getIndex();if(null!==u)r.AddFacesToMesh(i,u.count/3,u.array);else{for(var g=new(l.count>65535?Uint32Array:Uint16Array)(l.count),c=0;c =On.length&&On.push(new Quaternion),On[Jn++]}var qn=new Map;function $n(e,t,n,r){var i=e.skeleton.bones,a=e.geometry.userData.MMD.bones[t],o=i[t];if(!qn.has(t)){var s=jn();if(qn.set(t,s.copy(o.quaternion)),r&&a.grant&&!a.grant.isLocal&&a.grant.affectRotation){var l=a.grant.parentIndex,u=a.grant.ratio;qn.has(l)||$n(e,l,n,r),r.addGrantRotation(o,qn.get(l),u)}if(n&&a.ik){e.updateMatrixWorld(!0),n.updateOne(a.ik);for(var g=a.ik.links,c=0,d=g.length;c 1&&void 0!==arguments[1]?arguments[1]:{};(0,h.Z)(this,n),(r=t.call(this,e)).isReflector=!0,r.type="Reflector",r.camera=new m.PerspectiveCamera;var a=(0,d.Z)(r),o=void 0!==i.color?new m.Color(i.color):new m.Color(8355711),s=i.textureWidth||512,l=i.textureHeight||512,u=i.clipBias||0,g=i.shader||n.ReflectorShader,c=void 0!==i.multisample?i.multisample:4,A=new m.Plane,I=new m.Vector3,C=new m.Vector3,f=new m.Vector3,p=new m.Matrix4,v=new m.Vector3(0,0,-1),y=new m.Vector4,b=new m.Vector3,B=new m.Vector3,G=new m.Vector4,w=new m.Matrix4,Z=r.camera,S=new m.WebGLRenderTarget(s,l,{samples:c,type:m.HalfFloatType}),x=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(g.uniforms),fragmentShader:g.fragmentShader,vertexShader:g.vertexShader});return x.uniforms.tDiffuse.value=S.texture,x.uniforms.color.value=o,x.uniforms.textureMatrix.value=w,r.material=x,r.onBeforeRender=function(e,t,n){if(C.setFromMatrixPosition(a.matrixWorld),f.setFromMatrixPosition(n.matrixWorld),p.extractRotation(a.matrixWorld),I.set(0,0,1),I.applyMatrix4(p),b.subVectors(C,f),!(b.dot(I)>0)){b.reflect(I).negate(),b.add(C),p.extractRotation(n.matrixWorld),v.set(0,0,-1),v.applyMatrix4(p),v.add(f),B.subVectors(C,v),B.reflect(I).negate(),B.add(C),Z.position.copy(b),Z.up.set(0,1,0),Z.up.applyMatrix4(p),Z.up.reflect(I),Z.lookAt(B),Z.far=n.far,Z.updateMatrixWorld(),Z.projectionMatrix.copy(n.projectionMatrix),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(Z.projectionMatrix),w.multiply(Z.matrixWorldInverse),w.multiply(a.matrixWorld),A.setFromNormalAndCoplanarPoint(I,C),A.applyMatrix4(Z.matrixWorldInverse),y.set(A.normal.x,A.normal.y,A.normal.z,A.constant);var r=Z.projectionMatrix;G.x=(Math.sign(y.x)+r.elements[8])/r.elements[0],G.y=(Math.sign(y.y)+r.elements[9])/r.elements[5],G.z=-1,G.w=(1+r.elements[10])/r.elements[14],y.multiplyScalar(2/y.dot(G)),r.elements[2]=y.x,r.elements[6]=y.y,r.elements[10]=y.z+1-u,r.elements[14]=y.w,a.visible=!1;var i=e.getRenderTarget(),o=e.xr.enabled,s=e.shadowMap.autoUpdate,l=e.toneMapping,g=!1;g="outputColorSpace"in e?"srgb"===e.outputColorSpace:3001===e.outputEncoding,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,"outputColorSpace"in e?e.outputColorSpace="linear-srgb":e.outputEncoding=3e3,e.toneMapping=m.NoToneMapping,e.setRenderTarget(S),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,Z),e.xr.enabled=o,e.shadowMap.autoUpdate=s,e.toneMapping=l,"outputColorSpace"in e?e.outputColorSpace=g?"srgb":"srgb-linear":e.outputEncoding=g?3001:3e3,e.setRenderTarget(i);var c=n.viewport;void 0!==c&&e.state.viewport(c),a.visible=!0}},r.getRenderTarget=function(){return S},r.dispose=function(){S.dispose(),a.material.dispose()},r}return(0,C.Z)(n)}(m.Mesh),ir=rr;"\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\t\tvarying vec4 vUv;\n\n\t\t#include \n\n\t\tfloat blendOverlay( float base, float blend ) {\n\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t\t}\n\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t\t\t#include \n\t\t\t#include <".concat(yt>=154?"colorspace_fragment":"encodings_fragment",">\n\n\t\t}");var ar=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,h.Z)(this,n),(r=t.call(this,e)).isRefractor=!0,r.type="Refractor",r.camera=new m.PerspectiveCamera;var a=(0,d.Z)(r),o=void 0!==i.color?new m.Color(i.color):new m.Color(8355711),s=i.textureWidth||512,l=i.textureHeight||512,u=i.clipBias||0,g=i.shader||n.RefractorShader,c=void 0!==i.multisample?i.multisample:4,A=r.camera;A.matrixAutoUpdate=!1,A.userData.refractor=!0;var I=new m.Plane,C=new m.Matrix4,f=new m.WebGLRenderTarget(s,l,{samples:c,type:m.HalfFloatType});r.material=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(g.uniforms),vertexShader:g.vertexShader,fragmentShader:g.fragmentShader,transparent:!0}),r.material.uniforms.color.value=o,r.material.uniforms.tDiffuse.value=f.texture,r.material.uniforms.textureMatrix.value=C;var p=function(){var e=new m.Vector3,t=new m.Vector3,n=new m.Matrix4,r=new m.Vector3,i=new m.Vector3;return function(o){return e.setFromMatrixPosition(a.matrixWorld),t.setFromMatrixPosition(o.matrixWorld),r.subVectors(e,t),n.extractRotation(a.matrixWorld),i.set(0,0,1),i.applyMatrix4(n),r.dot(i)<0}}(),v=function(){var e=new m.Vector3,t=new m.Vector3,n=new m.Quaternion,r=new m.Vector3;return function(){a.matrixWorld.decompose(t,n,r),e.set(0,0,1).applyQuaternion(n).normalize(),e.negate(),I.setFromNormalAndCoplanarPoint(e,t)}}(),y=function(){var e=new m.Plane,t=new m.Vector4,n=new m.Vector4;return function(r){A.matrixWorld.copy(r.matrixWorld),A.matrixWorldInverse.copy(A.matrixWorld).invert(),A.projectionMatrix.copy(r.projectionMatrix),A.far=r.far,e.copy(I),e.applyMatrix4(A.matrixWorldInverse),t.set(e.normal.x,e.normal.y,e.normal.z,e.constant);var i=A.projectionMatrix;n.x=(Math.sign(t.x)+i.elements[8])/i.elements[0],n.y=(Math.sign(t.y)+i.elements[9])/i.elements[5],n.z=-1,n.w=(1+i.elements[10])/i.elements[14],t.multiplyScalar(2/t.dot(n)),i.elements[2]=t.x,i.elements[6]=t.y,i.elements[10]=t.z+1-u,i.elements[14]=t.w}}();return r.onBeforeRender=function(e,t,n){!0!==n.userData.refractor&&!0!==!p(n)&&(v(),function(e){C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(e.projectionMatrix),C.multiply(e.matrixWorldInverse),C.multiply(a.matrixWorld)}(n),y(n),function(e,t,n){a.visible=!1;var r=e.getRenderTarget(),i=e.xr.enabled,o=e.shadowMap.autoUpdate,s=e.toneMapping,l=!1;l="outputColorSpace"in e?"srgb"===e.outputColorSpace:3001===e.outputEncoding,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,"outputColorSpace"in e?e.outputColorSpace="linear-srgb":e.outputEncoding=3e3,e.toneMapping=m.NoToneMapping,e.setRenderTarget(f),!1===e.autoClear&&e.clear(),e.render(t,A),e.xr.enabled=i,e.shadowMap.autoUpdate=o,e.toneMapping=s,e.setRenderTarget(r),"outputColorSpace"in e?e.outputColorSpace=l?"srgb":"srgb-linear":e.outputEncoding=l?3001:3e3;var u=n.viewport;void 0!==u&&e.state.viewport(u),a.visible=!0}(e,t,n))},r.getRenderTarget=function(){return f},r.dispose=function(){f.dispose(),a.material.dispose()},r}return(0,C.Z)(n)}(m.Mesh),or=ar;"\n\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec4 vUv;\n\n\t\tfloat blendOverlay( float base, float blend ) {\n\n\t\t\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\n\n\t\t}\n\n\t\tvec3 blendOverlay( vec3 base, vec3 blend ) {\n\n\t\t\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 base = texture2DProj( tDiffuse, vUv );\n\t\t\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );\n\n\t\t\t#include \n\t\t\t#include <".concat(yt>=154?"colorspace_fragment":"encodings_fragment",">\n\n\t\t}");var sr=new m.Matrix4,lr=null,ur=new m.BufferGeometry,gr=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),cr=new m.InterleavedBuffer(gr,5),dr=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,h.Z)(this,n),(e=t.call(this,n.Geometry,new m.MeshBasicMaterial({opacity:0,transparent:!0}))).isLensflare=!0,e.type="Lensflare",e.frustumCulled=!1,e.renderOrder=1/0;var r=new m.Vector3,i=new m.Vector3,a=new m.DataTexture(new Uint8Array(768),16,16,m.RGBAFormat);a.minFilter=m.NearestFilter,a.magFilter=m.NearestFilter,a.wrapS=m.ClampToEdgeWrapping,a.wrapT=m.ClampToEdgeWrapping;var o=new m.DataTexture(new Uint8Array(768),16,16,m.RGBAFormat);o.minFilter=m.NearestFilter,o.magFilter=m.NearestFilter,o.wrapS=m.ClampToEdgeWrapping,o.wrapT=m.ClampToEdgeWrapping;var s=n.Geometry,l=new m.RawShaderMaterial({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );\n\n\t\t\t\t}",depthTest:!0,depthWrite:!1,transparent:!1}),u=new m.RawShaderMaterial({uniforms:{map:{value:a},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\t\t\t\tattribute vec2 uv;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUV = uv;\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform sampler2D map;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texture2D( map, vUV );\n\n\t\t\t\t}",depthTest:!1,depthWrite:!1,transparent:!1}),g=new m.Mesh(s,l),c=[],d=Ir.Shader,A=new m.RawShaderMaterial({uniforms:{map:{value:null},occlusionMap:{value:o},color:{value:new m.Color(16777215)},scale:{value:new m.Vector2},screenPosition:{value:new m.Vector3}},vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:m.AdditiveBlending,transparent:!0,depthWrite:!1}),I=new m.Mesh(s,A);e.addElement=function(e){c.push(e)};var C=new m.Vector2,f=new m.Vector2,p=new m.Box2,v=new m.Vector4;return e.onBeforeRender=function(e,t,n){e.getCurrentViewport(v);var d=v.w/v.z,h=v.z/2,m=v.w/2,y=16/v.w;if(C.set(y*d,y),p.min.set(v.x,v.y),p.max.set(v.x+(v.z-16),v.y+(v.w-16)),i.setFromMatrixPosition(this.matrixWorld),i.applyMatrix4(n.matrixWorldInverse),!(i.z>0)&&(r.copy(i).applyMatrix4(n.projectionMatrix),f.x=v.x+r.x*h+h-8,f.y=v.y+r.y*m+m-8,p.containsPoint(f))){e.copyFramebufferToTexture(f,a);var b=l.uniforms;b.scale.value=C,b.screenPosition.value=r,e.renderBufferDirect(n,null,s,l,g,null),e.copyFramebufferToTexture(f,o),(b=u.uniforms).scale.value=C,b.screenPosition.value=r,e.renderBufferDirect(n,null,s,u,g,null);for(var B=2*-r.x,G=2*-r.y,w=0,Z=c.length;w 1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new m.Color(16777215);(0,h.Z)(this,e),this.texture=t,this.size=n,this.distance=r,this.color=i})),hr=null,Cr=null,fr=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]),pr=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-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z)((function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Math;(0,h.Z)(this,e),S(this,"grad3",[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]),S(this,"grad4",[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]]),S(this,"p",[]),S(this,"perm",[]),S(this,"simplex",[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]),S(this,"dot",(function(e,t,n){return e[0]*t+e[1]*n})),S(this,"dot3",(function(e,t,n,r){return e[0]*t+e[1]*n+e[2]*r})),S(this,"dot4",(function(e,t,n,r,i){return e[0]*t+e[1]*n+e[2]*r+e[3]*i})),S(this,"noise",(function(e,n){var r=(e+n)*(.5*(Math.sqrt(3)-1)),i=Math.floor(e+r),a=Math.floor(n+r),o=(3-Math.sqrt(3))/6,s=(i+a)*o,l=e-(i-s),u=n-(a-s),g=0,c=1;l>u&&(g=1,c=0);var d=l-g+o,A=u-c+o,I=l-1+2*o,h=u-1+2*o,C=255&i,f=255&a,p=t.perm[C+t.perm[f]]%12,m=t.perm[C+g+t.perm[f+c]]%12,v=t.perm[C+1+t.perm[f+1]]%12,y=.5-l*l-u*u,b=.5-d*d-A*A,B=.5-I*I-h*h;return 70*((y<0?0:(y*=y)*y*t.dot(t.grad3[p],l,u))+(b<0?0:(b*=b)*b*t.dot(t.grad3[m],d,A))+(B<0?0:(B*=B)*B*t.dot(t.grad3[v],I,h)))})),S(this,"noise3d",(function(e,n,r){var i,a,o,s,l,u,g=(e+n+r)*(1/3),c=Math.floor(e+g),d=Math.floor(n+g),A=Math.floor(r+g),I=1/6,h=(c+d+A)*I,C=e-(c-h),f=n-(d-h),p=r-(A-h);C>=f?f>=p?(i=1,a=0,o=0,s=1,l=1,u=0):C>=p?(i=1,a=0,o=0,s=1,l=0,u=1):(i=0,a=0,o=1,s=1,l=0,u=1):f R?32:0)+(x>k?16:0)+(R>k?8:0)+(x>E?4:0)+(R>E?2:0)+(k>E?1:0),N=x-(a=p[M][0]>=3?1:0)+y,W=R-(o=p[M][1]>=3?1:0)+y,F=k-(s=p[M][2]>=3?1:0)+y,V=E-(l=p[M][3]>=3?1:0)+y,T=x-(u=p[M][0]>=2?1:0)+2*y,L=R-(g=p[M][1]>=2?1:0)+2*y,H=k-(c=p[M][2]>=2?1:0)+2*y,X=E-(d=p[M][3]>=2?1:0)+2*y,Y=x-(A=p[M][0]>=1?1:0)+3*y,_=R-(I=p[M][1]>=1?1:0)+3*y,K=k-(h=p[M][2]>=1?1:0)+3*y,U=E-(C=p[M][3]>=1?1:0)+3*y,z=x-1+4*y,D=R-1+4*y,P=k-1+4*y,Q=E-1+4*y,O=255&B,J=255&G,j=255&w,q=255&Z,$=m[O+m[J+m[j+m[q]]]]%32,ee=m[O+a+m[J+o+m[j+s+m[q+l]]]]%32,te=m[O+u+m[J+g+m[j+c+m[q+d]]]]%32,ne=m[O+A+m[J+I+m[j+h+m[q+C]]]]%32,re=m[O+1+m[J+1+m[j+1+m[q+1]]]]%32,ie=.6-x*x-R*R-k*k-E*E,ae=.6-N*N-W*W-F*F-V*V,oe=.6-T*T-L*L-H*H-X*X,se=.6-Y*Y-_*_-K*K-U*U,le=.6-z*z-D*D-P*P-Q*Q;return 27*((ie<0?0:(ie*=ie)*ie*t.dot4(f[$],x,R,k,E))+(ae<0?0:(ae*=ae)*ae*t.dot4(f[ee],N,W,F,V))+(oe<0?0:(oe*=oe)*oe*t.dot4(f[te],T,L,H,X))+(se<0?0:(se*=se)*se*t.dot4(f[ne],Y,_,K,U))+(le<0?0:(le*=le)*le*t.dot4(f[re],z,D,P,Q)))}));for(var r=0;r<256;r++)this.p[r]=Math.floor(256*n.random());for(var i=0;i<512;i++)this.perm[i]=this.p[255&i]})),vr=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,h.Z)(this,n),(e=t.call(this)).isLightningStrike=!0,e.type="LightningStrike",e.init(n.copyParameters(r,r)),e.createMesh(),e}return(0,C.Z)(n,[{key:"update",value:function(e){this.isStatic||(this.rayParameters.isEternal||this.rayParameters.birthTime<=e&&e<=this.rayParameters.deathTime?(this.updateMesh(e),e
this.subrays[0].beginVanishingTime?this.state=n.RAY_VANISHING:this.state=n.RAY_STEADY,this.visible=!0):(this.visible=!1,e =n.fraction0*r.propagationTimeFactor&&(t.createPrism(n),t.onDecideSubrayCreation(n,t)):e =this.currentSubray.maxIterations)this.currentSegmentCallback(e);else{this.forwards.subVectors(e.pos1,e.pos0);var t=this.forwards.length();t<1e-6&&(this.forwards.set(0,0,.01),t=this.forwards.length());var n=.5*(e.radius0+e.radius1),r=.5*(e.fraction0+e.fraction1),i=this.time*this.currentSubray.timeScale*Math.pow(2,e.iteration);this.middlePos.lerpVectors(e.pos0,e.pos1,.5),this.middleLinPos.lerpVectors(e.linPos0,e.linPos1,.5);var a=this.middleLinPos;this.newPos.set(this.simplexX.noise4d(a.x,a.y,a.z,i),this.simplexY.noise4d(a.x,a.y,a.z,i),this.simplexZ.noise4d(a.x,a.y,a.z,i)),this.newPos.multiplyScalar(e.positionVariationFactor*t),this.newPos.add(this.middlePos);var o=this.getNewSegment();o.pos0.copy(e.pos0),o.pos1.copy(this.newPos),o.linPos0.copy(e.linPos0),o.linPos1.copy(this.middleLinPos),o.up0.copy(e.up0),o.up1.copy(e.up1),o.radius0=e.radius0,o.radius1=n,o.fraction0=e.fraction0,o.fraction1=r,o.positionVariationFactor=e.positionVariationFactor*this.currentSubray.roughness,o.iteration=e.iteration+1;var s=this.getNewSegment();s.pos0.copy(this.newPos),s.pos1.copy(e.pos1),s.linPos0.copy(this.middleLinPos),s.linPos1.copy(e.linPos1),this.cross1.crossVectors(e.up0,this.forwards.normalize()),s.up0.crossVectors(this.forwards,this.cross1).normalize(),s.up1.copy(e.up1),s.radius0=n,s.radius1=e.radius1,s.fraction0=r,s.fraction1=e.fraction1,s.positionVariationFactor=e.positionVariationFactor*this.currentSubray.roughness,s.iteration=e.iteration+1,this.fractalRayRecursive(o),this.fractalRayRecursive(s)}}},{key:"createPrism",value:function(e){this.forwardsFill.subVectors(e.pos1,e.pos0).normalize(),this.isInitialSegment&&(this.currentCreateTriangleVertices(e.pos0,e.up0,this.forwardsFill,e.radius0,0),this.isInitialSegment=!1),this.currentCreateTriangleVertices(e.pos1,e.up0,this.forwardsFill,e.radius1,e.fraction1),this.createPrismFaces()}},{key:"createTriangleVerticesWithoutUVs",value:function(e,t,r,i){this.side.crossVectors(t,r).multiplyScalar(i*n.COS30DEG),this.down.copy(t).multiplyScalar(-i*n.SIN30DEG);var a=this.vPos,o=this.vertices;a.copy(e).sub(this.side).add(this.down),o[this.currentCoordinate++]=a.x,o[this.currentCoordinate++]=a.y,o[this.currentCoordinate++]=a.z,a.copy(e).add(this.side).add(this.down),o[this.currentCoordinate++]=a.x,o[this.currentCoordinate++]=a.y,o[this.currentCoordinate++]=a.z,a.copy(t).multiplyScalar(i).add(e),o[this.currentCoordinate++]=a.x,o[this.currentCoordinate++]=a.y,o[this.currentCoordinate++]=a.z,this.currentVertex+=3}},{key:"createTriangleVerticesWithUVs",value:function(e,t,r,i,a){this.side.crossVectors(t,r).multiplyScalar(i*n.COS30DEG),this.down.copy(t).multiplyScalar(-i*n.SIN30DEG);var o=this.vPos,s=this.vertices,l=this.uvs;o.copy(e).sub(this.side).add(this.down),s[this.currentCoordinate++]=o.x,s[this.currentCoordinate++]=o.y,s[this.currentCoordinate++]=o.z,l[this.currentUVCoordinate++]=a,l[this.currentUVCoordinate++]=0,o.copy(e).add(this.side).add(this.down),s[this.currentCoordinate++]=o.x,s[this.currentCoordinate++]=o.y,s[this.currentCoordinate++]=o.z,l[this.currentUVCoordinate++]=a,l[this.currentUVCoordinate++]=.5,o.copy(t).multiplyScalar(i).add(e),s[this.currentCoordinate++]=o.x,s[this.currentCoordinate++]=o.y,s[this.currentCoordinate++]=o.z,l[this.currentUVCoordinate++]=a,l[this.currentUVCoordinate++]=1,this.currentVertex+=3}},{key:"createPrismFaces",value:function(e){var t=this.indices;e=this.currentVertex-6,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+5,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+5,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+1,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+4,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+0,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+2,t[this.currentIndex++]=e+3,t[this.currentIndex++]=e+5}},{key:"createDefaultSubrayCreationCallbacks",value:function(){var e=this.randomGenerator.random;this.onDecideSubrayCreation=function(t,n){var r=n.currentSubray,i=n.rayParameters.subrayPeriod,a=n.rayParameters.subrayDutyCycle,o=n.rayParameters.isEternal&&0==r.recursion?-e()*i:m.MathUtils.lerp(r.birthTime,r.endPropagationTime,t.fraction0)-e()*i,s=n.time-o,l=Math.floor(s/i),u=e()*(l+1),g=0;if(s%i<=a*i&&(g=n.subrayProbability),r.recursion 0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(n){return t===e?n:n.clone()};return e.sourceOffset=void 0!==t.sourceOffset?n(t.sourceOffset):new m.Vector3(0,100,0),e.destOffset=void 0!==t.destOffset?n(t.destOffset):new m.Vector3(0,0,0),e.timeScale=void 0!==t.timeScale?t.timeScale:1,e.roughness=void 0!==t.roughness?t.roughness:.9,e.straightness=void 0!==t.straightness?t.straightness:.7,e.up0=void 0!==t.up0?n(t.up0):new m.Vector3(0,0,1),e.up1=void 0!==t.up1?n(t.up1):new m.Vector3(0,0,1),e.radius0=void 0!==t.radius0?t.radius0:1,e.radius1=void 0!==t.radius1?t.radius1:1,e.radius0Factor=void 0!==t.radius0Factor?t.radius0Factor:.5,e.radius1Factor=void 0!==t.radius1Factor?t.radius1Factor:.2,e.minRadius=void 0!==t.minRadius?t.minRadius:.2,e.isEternal=void 0!==t.isEternal?t.isEternal:void 0===t.birthTime||void 0===t.deathTime,e.birthTime=t.birthTime,e.deathTime=t.deathTime,e.propagationTimeFactor=void 0!==t.propagationTimeFactor?t.propagationTimeFactor:.1,e.vanishingTimeFactor=void 0!==t.vanishingTimeFactor?t.vanishingTimeFactor:.9,e.subrayPeriod=void 0!==t.subrayPeriod?t.subrayPeriod:4,e.subrayDutyCycle=void 0!==t.subrayDutyCycle?t.subrayDutyCycle:.6,e.maxIterations=void 0!==t.maxIterations?t.maxIterations:9,e.isStatic=void 0!==t.isStatic&&t.isStatic,e.ramification=void 0!==t.ramification?t.ramification:5,e.maxSubrayRecursion=void 0!==t.maxSubrayRecursion?t.maxSubrayRecursion:3,e.recursionProbability=void 0!==t.recursionProbability?t.recursionProbability:.6,e.generateUVs=void 0!==t.generateUVs&&t.generateUVs,e.randomGenerator=t.randomGenerator,e.noiseSeed=t.noiseSeed,e.onDecideSubrayCreation=t.onDecideSubrayCreation,e.onSubrayCreation=t.onSubrayCreation,e}}]),n}(m.BufferGeometry),yr=vr;Math.PI,Math.PI;var br=null,Br=null,Gr=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,h.Z)(this,n),(r=t.call(this,e)).isReflectorForSSRPass=!0,r.type="ReflectorForSSRPass";var a=(0,d.Z)(r),o=void 0!==i.color?new m.Color(i.color):new m.Color(8355711),s=i.textureWidth||512,l=i.textureHeight||512,u=i.clipBias||0,g=i.shader||n.ReflectorShader,c=!0===i.useDepthTexture,A=new m.Vector3(0,1,0),I=new m.Vector3,C=new m.Vector3;a.needsUpdate=!1,a.maxDistance=n.ReflectorShader.uniforms.maxDistance.value,a.opacity=n.ReflectorShader.uniforms.opacity.value,a.color=o,a.resolution=i.resolution||new m.Vector2(window.innerWidth,window.innerHeight),a._distanceAttenuation=n.ReflectorShader.defines.DISTANCE_ATTENUATION,Object.defineProperty(a,"distanceAttenuation",{get:function(){return a._distanceAttenuation},set:function(e){a._distanceAttenuation!==e&&(a._distanceAttenuation=e,a.material.defines.DISTANCE_ATTENUATION=e,a.material.needsUpdate=!0)}}),a._fresnel=n.ReflectorShader.defines.FRESNEL,Object.defineProperty(a,"fresnel",{get:function(){return a._fresnel},set:function(e){a._fresnel!==e&&(a._fresnel=e,a.material.defines.FRESNEL=e,a.material.needsUpdate=!0)}});var f,p=new m.Vector3,v=new m.Vector3,y=new m.Vector3,b=new m.Matrix4,B=new m.Vector3(0,0,-1),G=new m.Vector3,w=new m.Vector3,Z=new m.Matrix4,S=new m.PerspectiveCamera;c&&((f=new m.DepthTexture).type=m.UnsignedShortType,f.minFilter=m.NearestFilter,f.magFilter=m.NearestFilter);var x={depthTexture:c?f:null,type:m.HalfFloatType},R=new m.WebGLRenderTarget(s,l,x),k=new m.ShaderMaterial({transparent:c,defines:Object.assign({},n.ReflectorShader.defines,{useDepthTexture:c}),uniforms:m.UniformsUtils.clone(g.uniforms),fragmentShader:g.fragmentShader,vertexShader:g.vertexShader});k.uniforms.tDiffuse.value=R.texture,k.uniforms.color.value=a.color,k.uniforms.textureMatrix.value=Z,c&&(k.uniforms.tDepth.value=R.depthTexture),r.material=k;var E=[new m.Plane(new m.Vector3(0,1,0),u)];return r.doRender=function(e,t,n){if(k.uniforms.maxDistance.value=a.maxDistance,k.uniforms.color.value=a.color,k.uniforms.opacity.value=a.opacity,I.copy(n.position).normalize(),C.copy(I).reflect(A),k.uniforms.fresnelCoe.value=(I.dot(C)+1)/2,v.setFromMatrixPosition(a.matrixWorld),y.setFromMatrixPosition(n.matrixWorld),b.extractRotation(a.matrixWorld),p.set(0,0,1),p.applyMatrix4(b),G.subVectors(v,y),!(G.dot(p)>0)){G.reflect(p).negate(),G.add(v),b.extractRotation(n.matrixWorld),B.set(0,0,-1),B.applyMatrix4(b),B.add(y),w.subVectors(v,B),w.reflect(p).negate(),w.add(v),S.position.copy(G),S.up.set(0,1,0),S.up.applyMatrix4(b),S.up.reflect(p),S.lookAt(w),S.far=n.far,S.updateMatrixWorld(),S.projectionMatrix.copy(n.projectionMatrix),k.uniforms.virtualCameraNear.value=n.near,k.uniforms.virtualCameraFar.value=n.far,k.uniforms.virtualCameraMatrixWorld.value=S.matrixWorld,k.uniforms.virtualCameraProjectionMatrix.value=n.projectionMatrix,k.uniforms.virtualCameraProjectionMatrixInverse.value=n.projectionMatrixInverse,k.uniforms.resolution.value=a.resolution,Z.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),Z.multiply(S.projectionMatrix),Z.multiply(S.matrixWorldInverse),Z.multiply(a.matrixWorld);var r=e.getRenderTarget(),i=e.xr.enabled,o=e.shadowMap.autoUpdate,s=e.clippingPlanes;e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.clippingPlanes=E,e.setRenderTarget(R),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),e.render(t,S),e.xr.enabled=i,e.shadowMap.autoUpdate=o,e.clippingPlanes=s,e.setRenderTarget(r);var l=n.viewport;void 0!==l&&e.state.viewport(l)}},r.getRenderTarget=function(){return R},r}return(0,C.Z)(n)}(m.Mesh),wr=Gr,Zr={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new m.Vector3},up:{value:new m.Vector3(0,1,0)}},vertexShader:"\n uniform vec3 sunPosition;\n uniform float rayleigh;\n uniform float turbidity;\n uniform float mieCoefficient;\n uniform vec3 up;\n\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n // constants for atmospheric scattering\n const float e = 2.71828182845904523536028747135266249775724709369995957;\n const float pi = 3.141592653589793238462643383279502884197169;\n\n // wavelength of used primaries, according to preetham\n const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n // mie stuff\n // K coefficient for the primaries\n const float v = 4.0;\n const vec3 K = vec3( 0.686, 0.678, 0.666 );\n // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n // earth shadow hack\n // cutoffAngle = pi / 1.95;\n const float cutoffAngle = 1.6110731556870734;\n const float steepness = 1.5;\n const float EE = 1000.0;\n\n float sunIntensity( float zenithAngleCos ) {\n zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n }\n\n vec3 totalMie( float T ) {\n float c = ( 0.2 * T ) * 10E-18;\n return 0.434 * c * MieConst;\n }\n\n void main() {\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n gl_Position.z = gl_Position.w; // set z to camera.far\n\n vSunDirection = normalize( sunPosition );\n\n vSunE = sunIntensity( dot( vSunDirection, up ) );\n\n vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n // extinction (absorbtion + out scattering)\n // rayleigh coefficients\n vBetaR = totalRayleigh * rayleighCoefficient;\n\n // mie coefficients\n vBetaM = totalMie( turbidity ) * mieCoefficient;\n\n }\n ",fragmentShader:"\n varying vec3 vWorldPosition;\n varying vec3 vSunDirection;\n varying float vSunfade;\n varying vec3 vBetaR;\n varying vec3 vBetaM;\n varying float vSunE;\n\n uniform float mieDirectionalG;\n uniform vec3 up;\n\n const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n // constants for atmospheric scattering\n const float pi = 3.141592653589793238462643383279502884197169;\n\n const float n = 1.0003; // refractive index of air\n const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n // optical length at zenith for molecules\n const float rayleighZenithLength = 8.4E3;\n const float mieZenithLength = 1.25E3;\n // 66 arc seconds -> degrees, and the cosine of that\n const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n // 3.0 / ( 16.0 * pi )\n const float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n // 1.0 / ( 4.0 * pi )\n const float ONE_OVER_FOURPI = 0.07957747154594767;\n\n float rayleighPhase( float cosTheta ) {\n return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n }\n\n float hgPhase( float cosTheta, float g ) {\n float g2 = pow( g, 2.0 );\n float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n }\n\n void main() {\n\n vec3 direction = normalize( vWorldPosition - cameraPos );\n\n // optical length\n // cutoff angle at 90 to avoid singularity in next formula.\n float zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n float sR = rayleighZenithLength * inverse;\n float sM = mieZenithLength * inverse;\n\n // combined extinction factor\n vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n // in scattering\n float cosTheta = dot( direction, vSunDirection );\n\n float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n vec3 betaRTheta = vBetaR * rPhase;\n\n float mPhase = hgPhase( cosTheta, mieDirectionalG );\n vec3 betaMTheta = vBetaM * mPhase;\n\n vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n // nightsky\n float theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n float phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n vec3 L0 = vec3( 0.1 ) * Fex;\n\n // composition + solar disc\n float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n L0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n gl_FragColor = vec4( retColor, 1.0 );\n\n #include \n #include <".concat(yt>=154?"colorspace_fragment":"encodings_fragment",">\n\n }\n ")},Sr=new m.ShaderMaterial({name:"SkyShader",fragmentShader:Zr.fragmentShader,vertexShader:Zr.vertexShader,uniforms:m.UniformsUtils.clone(Zr.uniforms),side:m.BackSide,depthWrite:!1}),xr=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),t.call(this,new m.BoxGeometry(1,1,1),Sr)}return(0,C.Z)(n)}(m.Mesh),Rr=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,h.Z)(this,n),(r=t.call(this,e)).isWater=!0,r.type="Water";var a=(0,d.Z)(r),o=void 0!==i.color?new m.Color(i.color):new m.Color(16777215),l=i.textureWidth||512,u=i.textureHeight||512,g=i.clipBias||0,c=i.flowDirection||new m.Vector2(1,0),A=i.flowSpeed||.03,I=i.reflectivity||.02,C=i.scale||1,f=i.shader||n.WaterShader,p=void 0!==i.encoding?i.encoding:3e3,v=i.flowMap||void 0,y=i.normalMap0,b=i.normalMap1,B=.15,G=.075,w=new m.Matrix4,Z=new m.Clock;if(void 0===ir)return console.error("THREE.Water: Required component Reflector not found."),(0,s.Z)(r);if(void 0===or)return console.error("THREE.Water: Required component Refractor not found."),(0,s.Z)(r);var S=new ir(e,{textureWidth:l,textureHeight:u,clipBias:g,encoding:p}),x=new or(e,{textureWidth:l,textureHeight:u,clipBias:g,encoding:p});return S.matrixAutoUpdate=!1,x.matrixAutoUpdate=!1,r.material=new m.ShaderMaterial({uniforms:m.UniformsUtils.merge([m.UniformsLib.fog,f.uniforms]),vertexShader:f.vertexShader,fragmentShader:f.fragmentShader,transparent:!0,fog:!0}),void 0!==v?(r.material.defines.USE_FLOWMAP="",r.material.uniforms.tFlowMap={type:"t",value:v}):r.material.uniforms.flowDirection={type:"v2",value:c},y.wrapS=y.wrapT=m.RepeatWrapping,b.wrapS=b.wrapT=m.RepeatWrapping,r.material.uniforms.tReflectionMap.value=S.getRenderTarget().texture,r.material.uniforms.tRefractionMap.value=x.getRenderTarget().texture,r.material.uniforms.tNormalMap0.value=y,r.material.uniforms.tNormalMap1.value=b,r.material.uniforms.color.value=o,r.material.uniforms.reflectivity.value=I,r.material.uniforms.textureMatrix.value=w,r.material.uniforms.config.value.x=0,r.material.uniforms.config.value.y=G,r.material.uniforms.config.value.z=G,r.material.uniforms.config.value.w=C,r.onBeforeRender=function(e,t,n){!function(e){w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(e.projectionMatrix),w.multiply(e.matrixWorldInverse),w.multiply(a.matrixWorld)}(n),function(){var e=Z.getDelta(),t=a.material.uniforms.config;t.value.x+=A*e,t.value.y=t.value.x+G,t.value.x>=B?(t.value.x=0,t.value.y=G):t.value.y>=B&&(t.value.y=t.value.y-B)}(),a.visible=!1,S.matrixWorld.copy(a.matrixWorld),x.matrixWorld.copy(a.matrixWorld),S.onBeforeRender(e,t,n),x.onBeforeRender(e,t,n),a.visible=!0},r}return(0,C.Z)(n)}(m.Mesh),kr=Rr;"\n\n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform sampler2D tReflectionMap;\n\t\tuniform sampler2D tRefractionMap;\n\t\tuniform sampler2D tNormalMap0;\n\t\tuniform sampler2D tNormalMap1;\n\n\t\t#ifdef USE_FLOWMAP\n\t\t\tuniform sampler2D tFlowMap;\n\t\t#else\n\t\t\tuniform vec2 flowDirection;\n\t\t#endif\n\n\t\tuniform vec3 color;\n\t\tuniform float reflectivity;\n\t\tuniform vec4 config;\n\n\t\tvarying vec4 vCoord;\n\t\tvarying vec2 vUv;\n\t\tvarying vec3 vToEye;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\tfloat flowMapOffset0 = config.x;\n\t\t\tfloat flowMapOffset1 = config.y;\n\t\t\tfloat halfCycle = config.z;\n\t\t\tfloat scale = config.w;\n\n\t\t\tvec3 toEye = normalize( vToEye );\n\n\t\t\t// determine flow direction\n\t\t\tvec2 flow;\n\t\t\t#ifdef USE_FLOWMAP\n\t\t\t\tflow = texture2D( tFlowMap, vUv ).rg * 2.0 - 1.0;\n\t\t\t#else\n\t\t\t\tflow = flowDirection;\n\t\t\t#endif\n\t\t\tflow.x *= - 1.0;\n\n\t\t\t// sample normal maps (distort uvs with flowdata)\n\t\t\tvec4 normalColor0 = texture2D( tNormalMap0, ( vUv * scale ) + flow * flowMapOffset0 );\n\t\t\tvec4 normalColor1 = texture2D( tNormalMap1, ( vUv * scale ) + flow * flowMapOffset1 );\n\n\t\t\t// linear interpolate to get the final normal color\n\t\t\tfloat flowLerp = abs( halfCycle - flowMapOffset0 ) / halfCycle;\n\t\t\tvec4 normalColor = mix( normalColor0, normalColor1, flowLerp );\n\n\t\t\t// calculate normal vector\n\t\t\tvec3 normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n\n\t\t\t// calculate the fresnel term to blend reflection and refraction maps\n\t\t\tfloat theta = max( dot( toEye, normal ), 0.0 );\n\t\t\tfloat reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 5.0 );\n\n\t\t\t// calculate final uv coords\n\t\t\tvec3 coord = vCoord.xyz / vCoord.w;\n\t\t\tvec2 uv = coord.xy + coord.z * normal.xz * 0.05;\n\n\t\t\tvec4 reflectColor = texture2D( tReflectionMap, vec2( 1.0 - uv.x, uv.y ) );\n\t\t\tvec4 refractColor = texture2D( tRefractionMap, uv );\n\n\t\t\t// multiply water color with the mix of both textures\n\t\t\tgl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );\n\n\t\t\t#include \n\t\t\t#include <".concat(yt>=154?"colorspace_fragment":"encodings_fragment",">\n\t\t\t#include \n\n\t\t}");var Er=function(e){return e&&e.isCubeTexture},Mr=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i,a;(0,h.Z)(this,n);var o=Er(e),s=(null!=(a=o?null==(i=e.image[0])?void 0:i.width:e.image.width)?a:1024)/4,l=Math.floor(Math.log2(s)),u=Math.pow(2,l),g=3*Math.max(u,112),c=4*u,d=[o?"#define ENVMAP_TYPE_CUBE":"","#define CUBEUV_TEXEL_WIDTH ".concat(1/g),"#define CUBEUV_TEXEL_HEIGHT ".concat(1/c),"#define CUBEUV_MAX_MIP ".concat(l,".0")].join("\n")+"\n #define ENVMAP_TYPE_CUBE_UV\n varying vec3 vWorldPosition;\n uniform float radius;\n uniform float height;\n uniform float angle;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube map;\n #else\n uniform sampler2D map;\n #endif\n // From: https://www.shadertoy.com/view/4tsBD7\n float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n {\n float d = dot ( rd, n );\n \n if( d > 0.0 ) { return 1e6; }\n \n vec3 o = ro - c;\n float t = - dot( n, o ) / d;\n vec3 q = o + rd * t;\n \n return ( dot( q, q ) < r * r ) ? t : 1e6;\n }\n // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) \n {\n vec3 oc = ro - ce;\n float b = dot( oc, rd );\n float c = dot( oc, oc ) - ra * ra;\n float h = b * b - c;\n \n if( h < 0.0 ) { return -1.0; }\n \n h = sqrt( h );\n \n return - b + h;\n }\n vec3 project() \n {\n vec3 p = normalize( vWorldPosition );\n vec3 camPos = cameraPosition;\n camPos.y -= height;\n float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n if( intersection > 0.0 ) {\n \n vec3 h = vec3( 0.0, - height, 0.0 );\n float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n p = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n } else {\n p = vec3( 0.0, 1.0, 0.0 );\n }\n return p;\n }\n #include \n #include \n void main() \n {\n vec3 projectedWorldPosition = project();\n \n #ifdef ENVMAP_TYPE_CUBE\n vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n #else\n vec3 direction = normalize( projectedWorldPosition );\n vec2 uv = equirectUv( direction );\n vec3 outcolor = texture2D( map, uv ).rgb;\n #endif\n gl_FragColor = vec4( outcolor, 1.0 );\n #include \n #include <".concat(parseInt(m.REVISION.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment",">\n }\n "),A={map:{value:e},height:{value:(null==r?void 0:r.height)||15},radius:{value:(null==r?void 0:r.radius)||100}},I=new m.IcosahedronGeometry(1,16),C=new m.ShaderMaterial({uniforms:A,fragmentShader:d,vertexShader:"\n varying vec3 vWorldPosition;\n void main() \n {\n vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n vWorldPosition = worldPosition.xyz;\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",side:m.DoubleSide});return t.call(this,I,C)}return(0,C.Z)(n,[{key:"radius",get:function(){return this.material.uniforms.radius.value},set:function(e){this.material.uniforms.radius.value=e}},{key:"height",get:function(){return this.material.uniforms.height.value},set:function(e){this.material.uniforms.height.value=e}}]),n}(m.Mesh),Nr={createMeshesFromInstancedMesh:function(e){for(var t=new m.Group,n=e.count,r=e.geometry,i=e.material,a=0;a 1&&void 0!==arguments[1]?arguments[1]:1024,n=new Vector2,r=new Vector2,i=[new Vector2,new Vector2,new Vector2],a=[],o=document.createElement("canvas"),s=t,l=t;o.width=s,o.height=l;var u=o.getContext("2d");u.lineWidth=1,u.strokeStyle="rgb( 63, 63, 63 )",u.textAlign="center",u.fillStyle="rgb( 255, 255, 255 )",u.fillRect(0,0,s,l);var g=e.index,c=e.attributes.uv;if(g)for(var d=0,A=g.count;d.95&&u.fillText(i,n.x%1*s,(1-n.y)*l),u.font="12px Arial",u.fillStyle="rgb( 191, 191, 191 )";for(var c=0,d=t.length;c .95&&u.fillText("abc"[c]+I,r.x%1*s,(1-r.y)*l)}}}var Fr=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new m.Vector3(0,0,0),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:3,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)/2,l=[new m.Vector3(t.x-s,t.y,t.z-s),new m.Vector3(t.x-s,t.y,t.z+s),new m.Vector3(t.x+s,t.y,t.z+s),new m.Vector3(t.x+s,t.y,t.z-s)],u=[l[r],l[i],l[a],l[o]];if(0<=--n){var g=[];return Array.prototype.push.apply(g,e(u[0],s,n,r,o,a,i)),Array.prototype.push.apply(g,e(u[1],s,n,r,i,a,o)),Array.prototype.push.apply(g,e(u[2],s,n,r,i,a,o)),Array.prototype.push.apply(g,e(u[3],s,n,a,i,r,o)),g}return u},Vr=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new m.Vector3(0,0,0),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:3,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:4,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:5,u=arguments.length>9&&void 0!==arguments[9]?arguments[9]:6,g=arguments.length>10&&void 0!==arguments[10]?arguments[10]:7,c=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)/2,d=[new m.Vector3(t.x-c,t.y+c,t.z-c),new m.Vector3(t.x-c,t.y+c,t.z+c),new m.Vector3(t.x-c,t.y-c,t.z+c),new m.Vector3(t.x-c,t.y-c,t.z-c),new m.Vector3(t.x+c,t.y-c,t.z-c),new m.Vector3(t.x+c,t.y-c,t.z+c),new m.Vector3(t.x+c,t.y+c,t.z+c),new m.Vector3(t.x+c,t.y+c,t.z-c)],A=[d[r],d[i],d[a],d[o],d[s],d[l],d[u],d[g]];if(--n>=0){var I=[];return Array.prototype.push.apply(I,e(A[0],c,n,r,o,s,g,u,l,a,i)),Array.prototype.push.apply(I,e(A[1],c,n,r,g,u,i,a,l,s,o)),Array.prototype.push.apply(I,e(A[2],c,n,r,g,u,i,a,l,s,o)),Array.prototype.push.apply(I,e(A[3],c,n,a,o,r,i,u,g,s,l)),Array.prototype.push.apply(I,e(A[4],c,n,a,o,r,i,u,g,s,l)),Array.prototype.push.apply(I,e(A[5],c,n,s,o,a,l,u,i,r,g)),Array.prototype.push.apply(I,e(A[6],c,n,s,o,a,l,u,i,r,g)),Array.prototype.push.apply(I,e(A[7],c,n,u,l,a,i,r,o,s,g)),I}return A},Tr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return function(e){for(var t=0,n=0,r=0,i=[0,0,0],a=e.fractal,o=0,s=a.length;o i;0<=i?r++:r--){t="";for(var a=0,o=n.length;a\n\n\t\t\tfloat roughnessToVariance( float roughness ) {\n\n\t\t\t\tfloat variance = 0.0;\n\n\t\t\t\tif ( roughness >= r1 ) {\n\n\t\t\t\t\tvariance = ( r0 - roughness ) * ( v1 - v0 ) / ( r0 - r1 ) + v0;\n\n\t\t\t\t} else if ( roughness >= r4 ) {\n\n\t\t\t\t\tvariance = ( r1 - roughness ) * ( v4 - v1 ) / ( r1 - r4 ) + v1;\n\n\t\t\t\t} else if ( roughness >= r5 ) {\n\n\t\t\t\t\tvariance = ( r4 - roughness ) * ( v5 - v4 ) / ( r4 - r5 ) + v4;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfloat roughness2 = roughness * roughness;\n\n\t\t\t\t\tvariance = 1.79 * roughness2 * roughness2;\n\n\t\t\t\t}\n\n\t\t\t\treturn variance;\n\n\t\t\t}\n\n\t\t\tfloat varianceToRoughness( float variance ) {\n\n\t\t\t\tfloat roughness = 0.0;\n\n\t\t\t\tif ( variance >= v1 ) {\n\n\t\t\t\t\troughness = ( v0 - variance ) * ( r1 - r0 ) / ( v0 - v1 ) + r0;\n\n\t\t\t\t} else if ( variance >= v4 ) {\n\n\t\t\t\t\troughness = ( v1 - variance ) * ( r4 - r1 ) / ( v1 - v4 ) + r1;\n\n\t\t\t\t} else if ( variance >= v5 ) {\n\n\t\t\t\t\troughness = ( v4 - variance ) * ( r5 - r4 ) / ( v4 - v5 ) + r4;\n\n\t\t\t\t} else {\n\n\t\t\t\t\troughness = pow( 0.559 * variance, 0.25 ); // 0.559 = 1.0 / 1.79\n\n\t\t\t\t}\n\n\t\t\t\treturn roughness;\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = texture2D( roughnessMap, vUv, - 1.0 );\n\n\t\t\t\tif ( texelSize.x == 0.0 ) return;\n\n\t\t\t\tfloat roughness = gl_FragColor.g;\n\n\t\t\t\tfloat variance = roughnessToVariance( roughness );\n\n\t\t\t\tvec3 avgNormal;\n\n\t\t\t\tfor ( float x = - 1.0; x < 2.0; x += 2.0 ) {\n\n\t\t\t\t\tfor ( float y = - 1.0; y < 2.0; y += 2.0 ) {\n\n\t\t\t\t\t\tvec2 uv = vUv + vec2( x, y ) * 0.25 * texelSize;\n\n\t\t\t\t\t\tavgNormal += normalize( texture2D( normalMap, uv, - 1.0 ).xyz - 0.5 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvariance += 1.0 - 0.25 * length( avgNormal );\n\n\t\t\t\tgl_FragColor.g = varianceToRoughness( variance );\n\n\t\t\t}\n\t\t",blending:m.NoBlending,depthTest:!1,depthWrite:!1});return e.type="RoughnessMipmapper",e}function zr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new m.Vector3,i=new m.Quaternion,a=new m.Vector3,o=new m.Matrix4,s=new m.Matrix4,l=new m.Matrix4;n.preserveMatrix=void 0===n.preserveMatrix||n.preserveMatrix,n.preservePosition=void 0===n.preservePosition||n.preservePosition,n.preserveHipPosition=void 0!==n.preserveHipPosition&&n.preserveHipPosition,n.useTargetMatrix=void 0!==n.useTargetMatrix&&n.useTargetMatrix,n.hip=void 0!==n.hip?n.hip:"hip",n.names=n.names||{};var u,g,c,d,A,I=t.isObject3D?t.skeleton.bones:Or(t),h=e.isObject3D?e.skeleton.bones:Or(e);if(e.isObject3D?e.skeleton.pose():(n.useTargetMatrix=!0,n.preserveMatrix=!1),n.preservePosition){A=[];for(var C=0;C 3&&void 0!==arguments[3]?arguments[3]:{};r.useFirstFramePosition=void 0!==r.useFirstFramePosition&&r.useFirstFramePosition,r.fps=void 0!==r.fps?r.fps:30,r.names=r.names||[],t.isObject3D||(t=Jr(t));var i,a,o,s,l=Math.round(n.duration*(r.fps/1e3)*1e3),u=1/r.fps,g=[],c=new m.AnimationMixer(t),d=Or(e.skeleton),A=[];c.clipAction(n).play(),c.update(0),t.updateMatrixWorld();for(var I=0;I ","void main() {","\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","\tgl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")},ei=null,ti={compressNormals:function(e,t){e.geometry||console.error("Mesh must contain geometry. ");var n=e.geometry.attributes.normal;if(n||console.error("Geometry must contain normal attribute. "),!n.isPacked){3!=n.itemSize&&console.error("normal.itemSize is not 3, which cannot be encoded. ");var r,i=n.array,a=n.count;if("DEFAULT"==t){r=new Uint8Array(3*a);for(var o=0;o =-1&&r.max<=1){n=new Uint16Array(i.length);for(var o=0;o l&&(o=i,l=s),a=g(i=u(e,t,n,"floor","ceil")),(s=c(e,t,n,a))>l&&(o=i,l=s),a=g(i=u(e,t,n,"ceil","ceil")),(s=c(e,t,n,a))>l&&(o=i),o;function u(e,t,i,a,o){var s=e/(Math.abs(e)+Math.abs(t)+Math.abs(i)),l=t/(Math.abs(e)+Math.abs(t)+Math.abs(i));if(n<0){var u=(1-Math.abs(l))*(s>=0?1:-1),g=(1-Math.abs(s))*(l>=0?1:-1);s=u,l=g;var c=1-Math.abs(s)-Math.abs(l);c>0&&(c+=.001,s+=s>0?c/2:-c/2,l+=l>0?c/2:-c/2)}return 1==r?new Int8Array([Math[a](127.5*s+(s<0?1:0)),Math[o](127.5*l+(l<0?1:0))]):2==r?new Int16Array([Math[a](32767.5*s+(s<0?1:0)),Math[o](32767.5*l+(l<0?1:0))]):void 0}function g(e){var t=e[0],n=e[1];1==r?(t/=t<0?127:128,n/=n<0?127:128):2==r&&(t/=t<0?32767:32768,n/=n<0?32767:32768);var i=1-Math.abs(t)-Math.abs(n);if(i<0){var a=t;t=(1-Math.abs(n))*(t>=0?1:-1),n=(1-Math.abs(a))*(n>=0?1:-1)}var o=Math.sqrt(t*t+n*n+i*i);return[t/o,n/o,i/o]}function c(e,t,n,r){return e*r[0]+t*r[1]+n*r[2]}},quantizedEncode:function(e,t){var n,r;1==t?(n=new Uint8Array(e.length),r=255):2==t?(n=new Uint16Array(e.length),r=65535):console.error("number of bytes error! ");var i=new m.Matrix4,a=new Float32Array(3),o=new Float32Array(3);a[0]=a[1]=a[2]=Number.MAX_VALUE,o[0]=o[1]=o[2]=-Number.MAX_VALUE;for(var s=0;s = 0.0) ? +1.0 : -1.0, (v.y >= 0.0) ? +1.0 : -1.0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn normalize(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_NORMAL == 2\n\t\t\t\t\t\tvec3 decodeNormal(vec3 packedNormal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec3 v = (packedNormal * 2.0) - 1.0;\n\t\t\t\t\t\t\treturn normalize(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_POSITION\n\t\t\t\t\t#if USE_PACKED_POSITION == 0\n\t\t\t\t\t\tuniform mat4 quantizeMatPos;\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_UV\n\t\t\t\t\t#if USE_PACKED_UV == 1\n\t\t\t\t\t\tuniform mat3 quantizeMatUV;\n\t\t\t\t\t#endif\n\t\t\t\t#endif","#ifdef USE_PACKED_UV\n\t\t\t\t\t#if USE_PACKED_UV == 0\n\t\t\t\t\t\tvec2 decodeUV(vec2 packedUV)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec2 uv = (packedUV * 2.0) - 1.0;\n\t\t\t\t\t\t\treturn uv;\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\n\t\t\t\t\t#if USE_PACKED_UV == 1\n\t\t\t\t\t\tvec2 decodeUV(vec2 packedUV)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvec2 uv = ( vec3(packedUV, 1.0) * quantizeMatUV ).xy;\n\t\t\t\t\t\t\treturn uv;\n\t\t\t\t\t\t}\n\t\t\t\t\t#endif\n\t\t\t\t#endif","void main() {",m.ShaderChunk.uv_vertex,"#ifdef USE_UV\n\t\t\t\t\t#ifdef USE_PACKED_UV\n\t\t\t\t\t\tvUv = decodeUV(vUv);\n\t\t\t\t\t#endif\n\t\t\t\t#endif",m.ShaderChunk.uv2_vertex,m.ShaderChunk.color_vertex,m.ShaderChunk.beginnormal_vertex,"#ifdef USE_PACKED_NORMAL\n\t\t\t\t\tobjectNormal = decodeNormal(objectNormal);\n\t\t\t\t#endif\n\n\t\t\t\t#ifdef USE_TANGENT\n\t\t\t\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t\t\t\t#endif\n\t\t\t\t",m.ShaderChunk.morphnormal_vertex,m.ShaderChunk.skinbase_vertex,m.ShaderChunk.skinnormal_vertex,m.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","\tvNormal = normalize( transformedNormal );","#endif",m.ShaderChunk.begin_vertex,"#ifdef USE_PACKED_POSITION\n\t\t\t\t\t#if USE_PACKED_POSITION == 0\n\t\t\t\t\t\ttransformed = ( vec4(transformed, 1.0) * quantizeMatPos ).xyz;\n\t\t\t\t\t#endif\n\t\t\t\t#endif",m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.displacementmap_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,m.ShaderChunk.clipping_planes_vertex,"vViewPosition = - mvPosition.xyz;",m.ShaderChunk.worldpos_vertex,m.ShaderChunk.envmap_vertex,m.ShaderChunk.shadowmap_vertex,m.ShaderChunk.fog_vertex,"}"].join("\n"),r.fragmentShader=["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",m.ShaderChunk.common,m.ShaderChunk.packing,m.ShaderChunk.dithering_pars_fragment,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.uv_pars_fragment,m.ShaderChunk.uv2_pars_fragment,m.ShaderChunk.map_pars_fragment,m.ShaderChunk.alphamap_pars_fragment,m.ShaderChunk.aomap_pars_fragment,m.ShaderChunk.lightmap_pars_fragment,m.ShaderChunk.emissivemap_pars_fragment,m.ShaderChunk.envmap_common_pars_fragment,m.ShaderChunk.envmap_pars_fragment,m.ShaderChunk.cube_uv_reflection_fragment,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.bsdfs,m.ShaderChunk.lights_pars_begin,m.ShaderChunk.lights_phong_pars_fragment,m.ShaderChunk.shadowmap_pars_fragment,m.ShaderChunk.bumpmap_pars_fragment,m.ShaderChunk.normalmap_pars_fragment,m.ShaderChunk.specularmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,m.ShaderChunk.clipping_planes_pars_fragment,"void main() {",m.ShaderChunk.clipping_planes_fragment,"vec4 diffuseColor = vec4( diffuse, opacity );","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );","vec3 totalEmissiveRadiance = emissive;",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.map_fragment,m.ShaderChunk.color_fragment,m.ShaderChunk.alphamap_fragment,m.ShaderChunk.alphatest_fragment,m.ShaderChunk.specularmap_fragment,m.ShaderChunk.normal_fragment_begin,m.ShaderChunk.normal_fragment_maps,m.ShaderChunk.emissivemap_fragment,m.ShaderChunk.lights_phong_fragment,m.ShaderChunk.lights_fragment_begin,m.ShaderChunk.lights_fragment_maps,m.ShaderChunk.lights_fragment_end,m.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;",m.ShaderChunk.envmap_fragment,"gl_FragColor = vec4( outgoingLight, diffuseColor.a );",m.ShaderChunk.tonemapping_fragment,parseInt(m.REVISION.replace(/\D+/g,""))>=154?m.ShaderChunk.colorspace_fragment:m.ShaderChunk.encodings_fragment,m.ShaderChunk.fog_fragment,m.ShaderChunk.premultiplied_alpha_fragment,m.ShaderChunk.dithering_fragment,"}"].join("\n"),r.setValues(e),r}return(0,C.Z)(n)}(m.MeshPhongMaterial),ri={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new m.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float penta(vec2 coords) {","\t//pentagonal shape","\tfloat scale = float(rings) - 1.3;","\tvec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","\tvec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","\tvec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","\tvec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","\tvec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","\tvec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","\tvec4 one = vec4( 1.0 );","\tvec4 P = vec4((coords),vec2(scale, scale));","\tvec4 dist = vec4(0.0);","\tfloat inorout = -4.0;","\tdist.x = dot( P, HS0 );","\tdist.y = dot( P, HS1 );","\tdist.z = dot( P, HS2 );","\tdist.w = dot( P, HS3 );","\tdist = smoothstep( -feather, feather, dist );","\tinorout += dot( dist, one );","\tdist.x = dot( P, HS4 );","\tdist.y = HS5.w - abs( P.z );","\tdist = smoothstep( -feather, feather, dist );","\tinorout += dist.x;","\treturn clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","\t// Depth buffer blur","\tfloat d = 0.0;","\tfloat kernel[9];","\tvec2 offset[9];","\tvec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","\toffset[0] = vec2(-wh.x,-wh.y);","\toffset[1] = vec2( 0.0, -wh.y);","\toffset[2] = vec2( wh.x -wh.y);","\toffset[3] = vec2(-wh.x, 0.0);","\toffset[4] = vec2( 0.0, 0.0);","\toffset[5] = vec2( wh.x, 0.0);","\toffset[6] = vec2(-wh.x, wh.y);","\toffset[7] = vec2( 0.0, wh.y);","\toffset[8] = vec2( wh.x, wh.y);","\tkernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","\tkernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","\tkernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","\tfor( int i=0; i<9; i++ ) {","\t\tfloat tmp = texture2D(tDepth, coords + offset[i]).r;","\t\td += tmp * kernel[i];","\t}","\treturn d;","}","vec3 color(vec2 coords,float blur) {","\t//processing the sample","\tvec3 col = vec3(0.0);","\tvec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","\tcol.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","\tcol.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","\tcol.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","\tvec3 lumcoeff = vec3(0.299,0.587,0.114);","\tfloat lum = dot(col.rgb, lumcoeff);","\tfloat thresh = max((lum-threshold)*gain, 0.0);","\treturn col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","\tfloat edge = 0.002*depth; //distance based edge smoothing","\tfloat m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","\tfloat e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","\tcol = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","\tcol = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","\treturn col;","}","float linearize(float depth) {","\treturn -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","\tfloat dist = distance(vUv.xy, vec2(0.5,0.5));","\tdist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","\treturn clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","\tfloat rings2 = float(rings);","\tfloat step = PI*2.0 / float(ringsamples);","\tfloat pw = cos(j*step)*i;","\tfloat ph = sin(j*step)*i;","\tfloat p = 1.0;","\tif (pentagon) {","\t\tp = penta(vec2(pw,ph));","\t}","\tcol += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","\treturn 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","\t//scene depth calculation","\tfloat depth = linearize(texture2D(tDepth,vUv.xy).x);","\t// Blur depth?","\tif ( depthblur ) {","\t\tdepth = linearize(bdepth(vUv.xy));","\t}","\t//focal plane calculation","\tfloat fDepth = focalDepth;","\tif (shaderFocus) {","\t\tfDepth = linearize(texture2D(tDepth,focusCoords).x);","\t}","\t// dof blur factor calculation","\tfloat blur = 0.0;","\tif (manualdof) {","\t\tfloat a = depth-fDepth; // Focal plane","\t\tfloat b = (a-fdofstart)/fdofdist; // Far DoF","\t\tfloat c = (-a-ndofstart)/ndofdist; // Near Dof","\t\tblur = (a>0.0) ? b : c;","\t} else {","\t\tfloat f = focalLength; // focal length in mm","\t\tfloat d = fDepth*1000.0; // focal plane in mm","\t\tfloat o = depth*1000.0; // depth in mm","\t\tfloat a = (o*f)/(o-f);","\t\tfloat b = (d*f)/(d-f);","\t\tfloat c = (d-f)/(d*fstop*CoC);","\t\tblur = abs(a-b)*c;","\t}","\tblur = clamp(blur,0.0,1.0);","\t// calculation of pattern for dithering","\tvec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","\t// getting blur x and y step factor","\tfloat w = (1.0/textureWidth)*blur*maxblur+noise.x;","\tfloat h = (1.0/textureHeight)*blur*maxblur+noise.y;","\t// calculation of final color","\tvec3 col = vec3(0.0);","\tif(blur < 0.05) {","\t\t//some optimization thingy","\t\tcol = texture2D(tColor, vUv.xy).rgb;","\t} else {","\t\tcol = texture2D(tColor, vUv.xy).rgb;","\t\tfloat s = 1.0;","\t\tint ringsamples;","\t\tfor (int i = 1; i <= rings; i++) {","\t\t\t/*unboxstart*/","\t\t\tringsamples = i * samples;","\t\t\tfor (int j = 0 ; j < maxringsamples ; j++) {","\t\t\t\tif (j >= ringsamples) break;","\t\t\t\ts += gather(float(i), float(j), ringsamples, col, w, h, blur);","\t\t\t}","\t\t\t/*unboxend*/","\t\t}","\t\tcol /= s; //divide by sample count","\t}","\tif (showFocus) {","\t\tcol = debugFocus(col, blur, depth);","\t}","\tif (vignetting) {","\t\tcol *= vignette();","\t}","\tgl_FragColor.rgb = col;","\tgl_FragColor.a = 1.0;","} "].join("\n")},ii={uniforms:{mNear:{value:1},mFar:{value:1e3}},vertexShader:["varying float vViewZDepth;","void main() {","\t#include ","\t#include ","\tvViewZDepth = - mvPosition.z;","}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","varying float vViewZDepth;","void main() {","\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );","\tgl_FragColor = vec4( vec3( color ), 1.0 );","} "].join("\n")},ai=null,oi=new m.Triangle,si=new m.Vector3,li=null,ui={c:null,u:[new m.Vector3,new m.Vector3,new m.Vector3],e:[]},gi={c:null,u:[new m.Vector3,new m.Vector3,new m.Vector3],e:[]},ci=[[],[],[]],di=[[],[],[]],Ai=[],Ii=new m.Vector3,hi=new m.Vector3,Ci=new m.Vector3,fi=new m.Vector3,pi=new m.Vector3,mi=new m.Vector3,vi=new m.Matrix3,yi=new m.Box3,bi=new m.Matrix4,Bi=new m.Matrix4,Gi=new m.Ray,wi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new m.Vector3,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new m.Vector3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new m.Matrix3;(0,h.Z)(this,e),this.center=t,this.halfSize=n,this.rotation=r}return(0,C.Z)(e,[{key:"set",value:function(e,t,n){return this.center=e,this.halfSize=t,this.rotation=n,this}},{key:"copy",value:function(e){return this.center.copy(e.center),this.halfSize.copy(e.halfSize),this.rotation.copy(e.rotation),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"getSize",value:function(e){return e.copy(this.halfSize).multiplyScalar(2)}},{key:"clampPoint",value:function(e,t){var n=this.halfSize;fi.subVectors(e,this.center),this.rotation.extractBasis(Ii,hi,Ci),t.copy(this.center);var r=m.MathUtils.clamp(fi.dot(Ii),-n.x,n.x);t.add(Ii.multiplyScalar(r));var i=m.MathUtils.clamp(fi.dot(hi),-n.y,n.y);t.add(hi.multiplyScalar(i));var a=m.MathUtils.clamp(fi.dot(Ci),-n.z,n.z);return t.add(Ci.multiplyScalar(a)),t}},{key:"containsPoint",value:function(e){return fi.subVectors(e,this.center),this.rotation.extractBasis(Ii,hi,Ci),Math.abs(fi.dot(Ii))<=this.halfSize.x&&Math.abs(fi.dot(hi))<=this.halfSize.y&&Math.abs(fi.dot(Ci))<=this.halfSize.z}},{key:"intersectsBox3",value:function(e){return this.intersectsOBB(Zi.fromBox3(e))}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,mi),mi.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsOBB",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;ui.c=this.center,ui.e[0]=this.halfSize.x,ui.e[1]=this.halfSize.y,ui.e[2]=this.halfSize.z,this.rotation.extractBasis(ui.u[0],ui.u[1],ui.u[2]),gi.c=e.center,gi.e[0]=e.halfSize.x,gi.e[1]=e.halfSize.y,gi.e[2]=e.halfSize.z,e.rotation.extractBasis(gi.u[0],gi.u[1],gi.u[2]);for(var i=0;i<3;i++)for(var a=0;a<3;a++)ci[i][a]=ui.u[i].dot(gi.u[a]);fi.subVectors(gi.c,ui.c),Ai[0]=fi.dot(ui.u[0]),Ai[1]=fi.dot(ui.u[1]),Ai[2]=fi.dot(ui.u[2]);for(var o=0;o<3;o++)for(var s=0;s<3;s++)di[o][s]=Math.abs(ci[o][s])+r;for(var l=0;l<3;l++)if(t=ui.e[l],n=gi.e[0]*di[l][0]+gi.e[1]*di[l][1]+gi.e[2]*di[l][2],Math.abs(Ai[l])>t+n)return!1;for(var u=0;u<3;u++)if(t=ui.e[0]*di[0][u]+ui.e[1]*di[1][u]+ui.e[2]*di[2][u],n=gi.e[u],Math.abs(Ai[0]*ci[0][u]+Ai[1]*ci[1][u]+Ai[2]*ci[2][u])>t+n)return!1;return t=ui.e[1]*di[2][0]+ui.e[2]*di[1][0],n=gi.e[1]*di[0][2]+gi.e[2]*di[0][1],!(Math.abs(Ai[2]*ci[1][0]-Ai[1]*ci[2][0])>t+n)&&(t=ui.e[1]*di[2][1]+ui.e[2]*di[1][1],n=gi.e[0]*di[0][2]+gi.e[2]*di[0][0],!(Math.abs(Ai[2]*ci[1][1]-Ai[1]*ci[2][1])>t+n)&&(t=ui.e[1]*di[2][2]+ui.e[2]*di[1][2],n=gi.e[0]*di[0][1]+gi.e[1]*di[0][0],!(Math.abs(Ai[2]*ci[1][2]-Ai[1]*ci[2][2])>t+n)&&(t=ui.e[0]*di[2][0]+ui.e[2]*di[0][0],n=gi.e[1]*di[1][2]+gi.e[2]*di[1][1],!(Math.abs(Ai[0]*ci[2][0]-Ai[2]*ci[0][0])>t+n)&&(t=ui.e[0]*di[2][1]+ui.e[2]*di[0][1],n=gi.e[0]*di[1][2]+gi.e[2]*di[1][0],!(Math.abs(Ai[0]*ci[2][1]-Ai[2]*ci[0][1])>t+n)&&(t=ui.e[0]*di[2][2]+ui.e[2]*di[0][2],n=gi.e[0]*di[1][1]+gi.e[1]*di[1][0],!(Math.abs(Ai[0]*ci[2][2]-Ai[2]*ci[0][2])>t+n)&&(t=ui.e[0]*di[1][0]+ui.e[1]*di[0][0],n=gi.e[1]*di[2][2]+gi.e[2]*di[2][1],!(Math.abs(Ai[1]*ci[0][0]-Ai[0]*ci[1][0])>t+n)&&(t=ui.e[0]*di[1][1]+ui.e[1]*di[0][1],n=gi.e[0]*di[2][2]+gi.e[2]*di[2][0],!(Math.abs(Ai[1]*ci[0][1]-Ai[0]*ci[1][1])>t+n)&&(t=ui.e[0]*di[1][2]+ui.e[1]*di[0][2],n=gi.e[0]*di[2][1]+gi.e[1]*di[2][0],!(Math.abs(Ai[1]*ci[0][2]-Ai[0]*ci[1][2])>t+n)))))))))}},{key:"intersectsPlane",value:function(e){this.rotation.extractBasis(Ii,hi,Ci);var t=this.halfSize.x*Math.abs(e.normal.dot(Ii))+this.halfSize.y*Math.abs(e.normal.dot(hi))+this.halfSize.z*Math.abs(e.normal.dot(Ci)),n=e.normal.dot(this.center)-e.constant;return Math.abs(n)<=t}},{key:"intersectRay",value:function(e,t){return this.getSize(pi),yi.setFromCenterAndSize(fi.set(0,0,0),pi),bi.setFromMatrix3(this.rotation),bi.setPosition(this.center),Bi.copy(bi).invert(),Gi.copy(e).applyMatrix4(Bi),Gi.intersectBox(yi,t)?t.applyMatrix4(bi):null}},{key:"intersectsRay",value:function(e){return null!==this.intersectRay(e,fi)}},{key:"fromBox3",value:function(e){return e.getCenter(this.center),e.getSize(this.halfSize).multiplyScalar(.5),this.rotation.identity(),this}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.halfSize.equals(this.halfSize)&&e.rotation.equals(this.rotation)}},{key:"applyMatrix4",value:function(e){var t=e.elements,n=fi.set(t[0],t[1],t[2]).length(),r=fi.set(t[4],t[5],t[6]).length(),i=fi.set(t[8],t[9],t[10]).length();e.determinant()<0&&(n=-n),vi.setFromMatrix4(e);var a=1/n,o=1/r,s=1/i;return vi.elements[0]*=a,vi.elements[1]*=a,vi.elements[2]*=a,vi.elements[3]*=o,vi.elements[4]*=o,vi.elements[5]*=o,vi.elements[6]*=s,vi.elements[7]*=s,vi.elements[8]*=s,this.rotation.multiply(vi),this.halfSize.x*=n,this.halfSize.y*=r,this.halfSize.z*=i,fi.setFromMatrixPosition(e),this.center.add(fi),this}}]),e}(),Zi=new wi,Si=new m.Vector3,xi=new m.Vector3,Ri=new m.Vector3,ki=1e-10,Ei=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new m.Vector3(0,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new m.Vector3(0,1,0),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;(0,h.Z)(this,e),this.start=t,this.end=n,this.radius=r}return(0,C.Z)(e,[{key:"clone",value:function(){return new e(this.start.clone(),this.end.clone(),this.radius)}},{key:"set",value:function(e,t,n){this.start.copy(e),this.end.copy(t),this.radius=n}},{key:"copy",value:function(e){this.start.copy(e.start),this.end.copy(e.end),this.radius=e.radius}},{key:"getCenter",value:function(e){return e.copy(this.end).add(this.start).multiplyScalar(.5)}},{key:"translate",value:function(e){this.start.add(e),this.end.add(e)}},{key:"checkAABBAxis",value:function(e,t,n,r,i,a,o,s,l){return(i-e distortion_x-col_s*seed) {\n \t\t\tif(seed_x>0.){\n \t\t\t\tp.y = 1. - (p.y + distortion_y);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tp.y = distortion_y;\n \t\t\t}\n \t\t}\n \t\tif(p.x distortion_y-col_s*seed) {\n \t\t\tif(seed_y>0.){\n \t\t\t\tp.x=distortion_x;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tp.x = 1. - (p.x + distortion_x);\n \t\t\t}\n \t\t}\n \t\tp.x+=normal.x*seed_x*(seed/5.);\n \t\tp.y+=normal.y*seed_y*(seed/5.);\n //base from RGB shift shader\n \t\tvec2 offset = amount * vec2( cos(angle), sin(angle));\n \t\tvec4 cr = texture2D(tDiffuse, p + offset);\n \t\tvec4 cga = texture2D(tDiffuse, p);\n \t\tvec4 cb = texture2D(tDiffuse, p - offset);\n \t\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\n //add noise\n \t\tvec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);\n \t\tgl_FragColor = gl_FragColor+ snow;\n \t}\n \telse {\n \t\tgl_FragColor=texture2D (tDiffuse, vUv);\n \t}\n }"},Ha=null,Xa={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")},Ya=null,_a={defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new m.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","\tvOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","\tvUv = uv;","\tSMAAEdgeDetectionVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","\tvec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","\tvec4 delta;","\tvec3 C = texture2D( colorTex, texcoord ).rgb;","\tvec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","\tvec3 t = abs( C - Cleft );","\tdelta.x = max( max( t.r, t.g ), t.b );","\tvec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","\tt = abs( C - Ctop );","\tdelta.y = max( max( t.r, t.g ), t.b );","\tvec2 edges = step( threshold, delta.xy );","\tif ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","\t\tdiscard;","\tvec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","\tt = abs( C - Cright );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","\tt = abs( C - Cbottom );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tfloat maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","\tvec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","\tt = abs( C - Cleftleft );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","\tt = abs( C - Ctoptop );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tmaxDelta = max( max( maxDelta, delta.z ), delta.w );","\tedges.xy *= step( 0.5 * maxDelta, delta.xy );","\treturn vec4( edges, 0.0, 0.0 );","}","void main() {","\tgl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},Ka={defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new m.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","\tvPixcoord = texcoord / resolution;","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","\tvOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","\tvUv = uv;","\tSMAABlendingWeightCalculationVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","#if __VERSION__ == 100","vec2 round( vec2 x ) {","\treturn sign( x ) * floor( abs( x ) + 0.5 );","}","#endif","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","\te.r = bias + e.r * scale;","\treturn 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x += 0.25 * resolution.x;","\ttexcoord.x += resolution.x;","\ttexcoord.x += 2.0 * resolution.x;","\ttexcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","\treturn texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x -= 0.25 * resolution.x;","\ttexcoord.x -= resolution.x;","\ttexcoord.x -= 2.0 * resolution.x;","\ttexcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","\treturn texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y -= 0.25 * resolution.y;","\ttexcoord.y -= resolution.y;","\ttexcoord.y -= 2.0 * resolution.y;","\ttexcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","\treturn texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y += 0.25 * resolution.y;","\ttexcoord.y += resolution.y;","\ttexcoord.y += 2.0 * resolution.y;","\ttexcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","\treturn texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","\tvec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","\ttexcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","\ttexcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","\treturn texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","\tvec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","\tvec2 e = texture2D( edgesTex, texcoord ).rg;","\tif ( e.g > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","\t\tcoords.y = offset[ 1 ].y;","\t\td.x = coords.x;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).r;","\t\tcoords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","\t\td.y = coords.x;","\t\td = d / resolution.x - pixcoord.x;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","\t\tweights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","\t}","\tif ( e.r > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","\t\tcoords.x = offset[ 0 ].x;","\t\td.x = coords.y;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).g;","\t\tcoords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","\t\td.y = coords.y;","\t\td = d / resolution.y - pixcoord.y;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","\t\tweights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","\t}","\treturn weights;","}","void main() {","\tgl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},Ua={uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new m.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","\tvUv = uv;","\tSMAANeighborhoodBlendingVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","\tvec4 a;","\ta.xz = texture2D( blendTex, texcoord ).xz;","\ta.y = texture2D( blendTex, offset[ 1 ].zw ).g;","\ta.w = texture2D( blendTex, offset[ 1 ].xy ).a;","\tif ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","\t\treturn texture2D( colorTex, texcoord, 0.0 );","\t} else {","\t\tvec2 offset;","\t\toffset.x = a.a > a.b ? a.a : -a.b;","\t\toffset.y = a.g > a.r ? -a.g : a.r;","\t\tif ( abs( offset.x ) > abs( offset.y )) {","\t\t\toffset.y = 0.0;","\t\t} else {","\t\t\toffset.x = 0.0;","\t\t}","\t\tvec4 C = texture2D( colorTex, texcoord, 0.0 );","\t\ttexcoord += sign( offset ) * resolution;","\t\tvec4 Cop = texture2D( colorTex, texcoord, 0.0 );","\t\tfloat s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","\t\tC.xyz = pow(C.xyz, vec3(2.2));","\t\tCop.xyz = pow(Cop.xyz, vec3(2.2));","\t\tvec4 mixed = mix(C, Cop, s);","\t\tmixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","\t\treturn mixed;","\t}","}","void main() {","\tgl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")},za=null,Da={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")},Pa=null,Qa={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")},Oa=null,Ja={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new m.Vector2},cameraProjectionMatrix:{value:new m.Matrix4},cameraInverseProjectionMatrix:{value:new m.Matrix4},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tNormal;","uniform sampler2D tDepth;","uniform sampler2D tNoise;","uniform vec3 kernel[ KERNEL_SIZE ];","uniform vec2 resolution;","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float kernelRadius;","uniform float minDistance;","uniform float maxDistance;","varying vec2 vUv;","#include ","float getDepth( const in vec2 screenPosition ) {","\treturn texture2D( tDepth, screenPosition ).x;","}","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec2 screenPosition ) {","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","}","void main() {","\tfloat depth = getDepth( vUv );","\tfloat viewZ = getViewZ( depth );","\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );","\tvec3 viewNormal = getViewNormal( vUv );"," vec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );","\tvec3 random = texture2D( tNoise, vUv * noiseScale ).xyz;","\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );","\tvec3 bitangent = cross( viewNormal, tangent );","\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );"," float occlusion = 0.0;"," for ( int i = 0; i < KERNEL_SIZE; i ++ ) {","\t\tvec3 sampleVector = kernelMatrix * kernel[ i ];","\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius );","\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 );","\t\tsamplePointNDC /= samplePointNDC.w;","\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5;","\t\tfloat realDepth = getLinearDepth( samplePointUv );","\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar );","\t\tfloat delta = sampleDepth - realDepth;","\t\tif ( delta > minDistance && delta < maxDistance ) {","\t\t\tocclusion += 1.0;","\t\t}","\t}","\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );","\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );","}"].join("\n")},ja={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","varying vec2 vUv;","#include ","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","void main() {","\tfloat depth = getLinearDepth( vUv );","\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );","}"].join("\n")},qa={uniforms:{tDiffuse:{value:null},resolution:{value:new m.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texelSize = ( 1.0 / resolution );","\tfloat result = 0.0;","\tfor ( int i = - 2; i <= 2; i ++ ) {","\t\tfor ( int j = - 2; j <= 2; j ++ ) {","\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;","\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;","\t\t}","\t}","\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );","}"].join("\n")},$a=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,i,a){var o;(0,h.Z)(this,n),(o=t.call(this)).width=void 0!==i?i:512,o.height=void 0!==a?a:512,o.clear=!0,o.camera=r,o.scene=e,o.kernelRadius=8,o.kernelSize=32,o.kernel=[],o.noiseTexture=null,o.output=0,o.minDistance=.005,o.maxDistance=.1,o._visibilityCache=new Map,o.generateSampleKernel(),o.generateRandomKernelRotations();var s=new m.DepthTexture;return s.format=m.DepthStencilFormat,s.type=m.UnsignedInt248Type,o.beautyRenderTarget=new m.WebGLRenderTarget(o.width,o.height),o.normalRenderTarget=new m.WebGLRenderTarget(o.width,o.height,{minFilter:m.NearestFilter,magFilter:m.NearestFilter,depthTexture:s}),o.ssaoRenderTarget=new m.WebGLRenderTarget(o.width,o.height),o.blurRenderTarget=o.ssaoRenderTarget.clone(),void 0===Ja&&console.error("THREE.SSAOPass: The pass relies on SSAOShader."),o.ssaoMaterial=new m.ShaderMaterial({defines:Object.assign({},Ja.defines),uniforms:m.UniformsUtils.clone(Ja.uniforms),vertexShader:Ja.vertexShader,fragmentShader:Ja.fragmentShader,blending:m.NoBlending}),o.ssaoMaterial.uniforms.tDiffuse.value=o.beautyRenderTarget.texture,o.ssaoMaterial.uniforms.tNormal.value=o.normalRenderTarget.texture,o.ssaoMaterial.uniforms.tDepth.value=o.normalRenderTarget.depthTexture,o.ssaoMaterial.uniforms.tNoise.value=o.noiseTexture,o.ssaoMaterial.uniforms.kernel.value=o.kernel,o.ssaoMaterial.uniforms.cameraNear.value=o.camera.near,o.ssaoMaterial.uniforms.cameraFar.value=o.camera.far,o.ssaoMaterial.uniforms.resolution.value.set(o.width,o.height),o.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(o.camera.projectionMatrix),o.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(o.camera.projectionMatrixInverse),o.normalMaterial=new m.MeshNormalMaterial,o.normalMaterial.blending=m.NoBlending,o.blurMaterial=new m.ShaderMaterial({defines:Object.assign({},qa.defines),uniforms:m.UniformsUtils.clone(qa.uniforms),vertexShader:qa.vertexShader,fragmentShader:qa.fragmentShader}),o.blurMaterial.uniforms.tDiffuse.value=o.ssaoRenderTarget.texture,o.blurMaterial.uniforms.resolution.value.set(o.width,o.height),o.depthRenderMaterial=new m.ShaderMaterial({defines:Object.assign({},ja.defines),uniforms:m.UniformsUtils.clone(ja.uniforms),vertexShader:ja.vertexShader,fragmentShader:ja.fragmentShader,blending:m.NoBlending}),o.depthRenderMaterial.uniforms.tDepth.value=o.normalRenderTarget.depthTexture,o.depthRenderMaterial.uniforms.cameraNear.value=o.camera.near,o.depthRenderMaterial.uniforms.cameraFar.value=o.camera.far,o.copyMaterial=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(Qa.uniforms),vertexShader:Qa.vertexShader,fragmentShader:Qa.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:m.DstColorFactor,blendDst:m.ZeroFactor,blendEquation:m.AddEquation,blendSrcAlpha:m.DstAlphaFactor,blendDstAlpha:m.ZeroFactor,blendEquationAlpha:m.AddEquation}),o.fsQuad=new Na(null),o.originalClearColor=new m.Color,o}return(0,C.Z)(n,[{key:"dispose",value:function(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}},{key:"render",value:function(e,t){switch(!1===e.capabilities.isWebGL2&&(this.noiseTexture.format=m.LuminanceFormat),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.overrideVisibility(),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.restoreVisibility(),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(e,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.output){case n.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=m.CustomBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSAOPass: Unknown output type.")}}},{key:"renderPass",value:function(e,t,n,r,i){e.getClearColor(this.originalClearColor);var a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}},{key:"renderOverride",value:function(e,t,n,r,i){e.getClearColor(this.originalClearColor);var a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}},{key:"setSize",value:function(e,t){this.width=e,this.height=t,this.beautyRenderTarget.setSize(e,t),this.ssaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.ssaoMaterial.uniforms.resolution.value.set(e,t),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t)}},{key:"generateSampleKernel",value:function(){for(var e=this.kernelSize,t=this.kernel,n=0;n ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")},ro=null,io=null,ao={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tfloat l = linearToRelativeLuminance( texel.rgb );","\tgl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")},oo={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","\tuniform sampler2D luminanceMap;","#else","\tuniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","\t#ifdef ADAPTED_LUMINANCE","\t\tfloat fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","\t#else","\t\tfloat fLumAvg = averageLuminance;","\t#endif","\tfloat fLumPixel = linearToRelativeLuminance( vColor );","\tfloat fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","\tfloat fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","\treturn fLumCompressed * vColor;","}","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")},so=null,lo={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new m.Color(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")},uo=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,i,a){var o;(0,h.Z)(this,n),(o=t.call(this)).strength=void 0!==r?r:1,o.radius=i,o.threshold=a,o.resolution=void 0!==e?new m.Vector2(e.x,e.y):new m.Vector2(256,256),o.clearColor=new m.Color(0,0,0),o.renderTargetsHorizontal=[],o.renderTargetsVertical=[],o.nMips=5;var s=Math.round(o.resolution.x/2),l=Math.round(o.resolution.y/2);o.renderTargetBright=new m.WebGLRenderTarget(s,l,{type:m.HalfFloatType}),o.renderTargetBright.texture.name="UnrealBloomPass.bright",o.renderTargetBright.texture.generateMipmaps=!1;for(var u=0;u \n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}},{key:"getCompositeMaterial",value:function(e){return new m.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}}]),n}(Ma),go=uo,co=null,Ao={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new m.Vector2(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new m.Matrix4},cameraInverseProjectionMatrix:{value:new m.Matrix4},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")},Io={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new m.Vector2(512,512)},sampleUvOffsets:{value:[new m.Vector2(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")},ho={createSampleWeights:function(e,t){for(var n,r,i=[],a=0;a<=e;a++)i.push((n=a,r=t,Math.exp(-n*n/(r*r*2))/(Math.sqrt(2*Math.PI)*r)));return i},createSampleOffsets:function(e,t){for(var n=[],r=0;r<=e;r++)n.push(t.clone().multiplyScalar(r));return n},configure:function(e,t,n,r){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=ho.createSampleOffsets(t,r),e.uniforms.sampleWeights.value=ho.createSampleWeights(t,n),e.needsUpdate=!0}},Co=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i,a,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new m.Vector2(256,256);return(0,h.Z)(this,n),(i=t.call(this)).scene=e,i.camera=r,i.clear=!0,i.needsSwap=!1,i.supportsDepthTextureExtension=o,i.supportsNormalTexture=s,i.originalClearColor=new m.Color,i._oldClearColor=new m.Color,i.oldClearAlpha=1,i.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},i.resolution=new m.Vector2(l.x,l.y),i.saoRenderTarget=new m.WebGLRenderTarget(i.resolution.x,i.resolution.y,{type:m.HalfFloatType}),i.blurIntermediateRenderTarget=i.saoRenderTarget.clone(),i.beautyRenderTarget=i.saoRenderTarget.clone(),i.normalRenderTarget=new m.WebGLRenderTarget(i.resolution.x,i.resolution.y,{minFilter:m.NearestFilter,magFilter:m.NearestFilter,type:m.HalfFloatType}),i.depthRenderTarget=i.normalRenderTarget.clone(),i.supportsDepthTextureExtension&&((a=new m.DepthTexture).type=m.UnsignedShortType,i.beautyRenderTarget.depthTexture=a,i.beautyRenderTarget.depthBuffer=!0),i.depthMaterial=new m.MeshDepthMaterial,i.depthMaterial.depthPacking=m.RGBADepthPacking,i.depthMaterial.blending=m.NoBlending,i.normalMaterial=new m.MeshNormalMaterial,i.normalMaterial.blending=m.NoBlending,i.saoMaterial=new m.ShaderMaterial({defines:Object.assign({},Ao.defines),fragmentShader:Ao.fragmentShader,vertexShader:Ao.vertexShader,uniforms:m.UniformsUtils.clone(Ao.uniforms)}),i.saoMaterial.extensions.derivatives=!0,i.saoMaterial.defines.DEPTH_PACKING=i.supportsDepthTextureExtension?0:1,i.saoMaterial.defines.NORMAL_TEXTURE=i.supportsNormalTexture?1:0,i.saoMaterial.defines.PERSPECTIVE_CAMERA=i.camera.isPerspectiveCamera?1:0,i.saoMaterial.uniforms.tDepth.value=i.supportsDepthTextureExtension?a:i.depthRenderTarget.texture,i.saoMaterial.uniforms.tNormal.value=i.normalRenderTarget.texture,i.saoMaterial.uniforms.size.value.set(i.resolution.x,i.resolution.y),i.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(i.camera.projectionMatrixInverse),i.saoMaterial.uniforms.cameraProjectionMatrix.value=i.camera.projectionMatrix,i.saoMaterial.blending=m.NoBlending,i.vBlurMaterial=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(Io.uniforms),defines:Object.assign({},Io.defines),vertexShader:Io.vertexShader,fragmentShader:Io.fragmentShader}),i.vBlurMaterial.defines.DEPTH_PACKING=i.supportsDepthTextureExtension?0:1,i.vBlurMaterial.defines.PERSPECTIVE_CAMERA=i.camera.isPerspectiveCamera?1:0,i.vBlurMaterial.uniforms.tDiffuse.value=i.saoRenderTarget.texture,i.vBlurMaterial.uniforms.tDepth.value=i.supportsDepthTextureExtension?a:i.depthRenderTarget.texture,i.vBlurMaterial.uniforms.size.value.set(i.resolution.x,i.resolution.y),i.vBlurMaterial.blending=m.NoBlending,i.hBlurMaterial=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(Io.uniforms),defines:Object.assign({},Io.defines),vertexShader:Io.vertexShader,fragmentShader:Io.fragmentShader}),i.hBlurMaterial.defines.DEPTH_PACKING=i.supportsDepthTextureExtension?0:1,i.hBlurMaterial.defines.PERSPECTIVE_CAMERA=i.camera.isPerspectiveCamera?1:0,i.hBlurMaterial.uniforms.tDiffuse.value=i.blurIntermediateRenderTarget.texture,i.hBlurMaterial.uniforms.tDepth.value=i.supportsDepthTextureExtension?a:i.depthRenderTarget.texture,i.hBlurMaterial.uniforms.size.value.set(i.resolution.x,i.resolution.y),i.hBlurMaterial.blending=m.NoBlending,i.materialCopy=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(Qa.uniforms),vertexShader:Qa.vertexShader,fragmentShader:Qa.fragmentShader,blending:m.NoBlending}),i.materialCopy.transparent=!0,i.materialCopy.depthTest=!1,i.materialCopy.depthWrite=!1,i.materialCopy.blending=m.CustomBlending,i.materialCopy.blendSrc=m.DstColorFactor,i.materialCopy.blendDst=m.ZeroFactor,i.materialCopy.blendEquation=m.AddEquation,i.materialCopy.blendSrcAlpha=m.DstAlphaFactor,i.materialCopy.blendDstAlpha=m.ZeroFactor,i.materialCopy.blendEquationAlpha=m.AddEquation,i.depthCopy=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone($r.uniforms),vertexShader:$r.vertexShader,fragmentShader:$r.fragmentShader,blending:m.NoBlending}),i.fsQuad=new Na(null),i}return(0,C.Z)(n,[{key:"render",value:function(e,t,n){if(this.renderToScreen&&(this.materialCopy.blending=m.NoBlending,this.materialCopy.uniforms.tDiffuse.value=n.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();var r=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var i=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=i,this.hBlurMaterial.uniforms.depthCutoff.value=i,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(ho.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new m.Vector2(0,1)),ho.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new m.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var a=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,a=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?a.blending=m.CustomBlending:a.blending=m.NoBlending,this.renderPass(e,a,this.renderToScreen?null:n),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=r}}},{key:"renderPass",value:function(e,t,n,r,i){e.getClearColor(this.originalClearColor);var a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}},{key:"renderOverride",value:function(e,t,n,r,i){e.getClearColor(this.originalClearColor);var a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}},{key:"setSize",value:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}},{key:"dispose",value:function(){this.saoRenderTarget.dispose(),this.blurIntermediateRenderTarget.dispose(),this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.depthRenderTarget.dispose(),this.depthMaterial.dispose(),this.normalMaterial.dispose(),this.saoMaterial.dispose(),this.vBlurMaterial.dispose(),this.hBlurMaterial.dispose(),this.materialCopy.dispose(),this.depthCopy.dispose(),this.fsQuad.dispose()}}]),n}(Ma),fo={uniforms:{damp:{value:.96},tOld:{value:null},tNew:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float damp;","uniform sampler2D tOld;","uniform sampler2D tNew;","varying vec2 vUv;","vec4 when_gt( vec4 x, float y ) {","\treturn max( sign( x - y ), 0.0 );","}","void main() {","\tvec4 texelOld = texture2D( tOld, vUv );","\tvec4 texelNew = texture2D( tNew, vUv );","\ttexelOld *= damp * when_gt( texelOld, 0.1 );","\tgl_FragColor = max(texelNew, texelOld);","}"].join("\n")},po=null,mo=null,vo=null,yo=null,bo={uniforms:{tDiffuse:{value:null},tSize:{value:new m.Vector2(256,256)},center:{value:new m.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","\tfloat s = sin( angle ), c = cos( angle );","\tvec2 tex = vUv * tSize - center;","\tvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","\treturn ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tfloat average = ( color.r + color.g + color.b ) / 3.0;","\tgl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")},Bo=null,Go={defines:{MAX_STEP:0,isPerspectiveCamera:!0,isDistanceAttenuation:!0,isFresnel:!0,isInfiniteThick:!1,isSelective:!1},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tMetalness:{value:null},tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new m.Vector2},cameraProjectionMatrix:{value:new m.Matrix4},cameraInverseProjectionMatrix:{value:new m.Matrix4},opacity:{value:.5},maxDistance:{value:180},cameraRange:{value:0},surfDist:{value:.007},thickTolerance:{value:.03}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\t\t// precision highp float;\n\t\tprecision highp sampler2D;\n\t\tvarying vec2 vUv;\n\t\tuniform sampler2D tDepth;\n\t\tuniform sampler2D tNormal;\n\t\tuniform sampler2D tMetalness;\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float cameraRange;\n\t\tuniform vec2 resolution;\n\t\tuniform float opacity;\n\t\tuniform float cameraNear;\n\t\tuniform float cameraFar;\n\t\tuniform float maxDistance;\n\t\tuniform float surfDist;\n\t\tuniform mat4 cameraProjectionMatrix;\n\t\tuniform mat4 cameraInverseProjectionMatrix;\n\t\tuniform float thickTolerance;\n\t\t#include \n\t\tfloat pointToLineDistance(vec3 x0, vec3 x1, vec3 x2) {\n\t\t\t//x0: point, x1: linePointA, x2: linePointB\n\t\t\t//https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html\n\t\t\treturn length(cross(x0-x1,x0-x2))/length(x2-x1);\n\t\t}\n\t\tfloat pointPlaneDistance(vec3 point,vec3 planePoint,vec3 planeNormal){\n\t\t\t// https://mathworld.wolfram.com/Point-PlaneDistance.html\n\t\t\t//// https://en.wikipedia.org/wiki/Plane_(geometry)\n\t\t\t//// http://paulbourke.net/geometry/pointlineplane/\n\t\t\tfloat a=planeNormal.x,b=planeNormal.y,c=planeNormal.z;\n\t\t\tfloat x0=point.x,y0=point.y,z0=point.z;\n\t\t\tfloat x=planePoint.x,y=planePoint.y,z=planePoint.z;\n\t\t\tfloat d=-(a*x+b*y+c*z);\n\t\t\tfloat distance=(a*x0+b*y0+c*z0+d)/sqrt(a*a+b*b+c*c);\n\t\t\treturn distance;\n\t\t}\n\t\tfloat getDepth( const in vec2 uv ) {\n\t\t\treturn texture2D( tDepth, uv ).x;\n\t\t}\n\t\tfloat getViewZ( const in float depth ) {\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#else\n\t\t\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n\t\t\t#endif\n\t\t}\n\t\tvec3 getViewPosition( const in vec2 uv, const in float depth/*clip space*/, const in float clipW ) {\n\t\t\tvec4 clipPosition = vec4( ( vec3( uv, depth ) - 0.5 ) * 2.0, 1.0 );//ndc\n\t\t\tclipPosition *= clipW; //clip\n\t\t\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;//view\n\t\t}\n\t\tvec3 getViewNormal( const in vec2 uv ) {\n\t\t\treturn unpackRGBToNormal( texture2D( tNormal, uv ).xyz );\n\t\t}\n\t\tvec2 viewPositionToXY(vec3 viewPosition){\n\t\t\tvec2 xy;\n\t\t\tvec4 clip=cameraProjectionMatrix*vec4(viewPosition,1);\n\t\t\txy=clip.xy;//clip\n\t\t\tfloat clipW=clip.w;\n\t\t\txy/=clipW;//NDC\n\t\t\txy=(xy+1.)/2.;//uv\n\t\t\txy*=resolution;//screen\n\t\t\treturn xy;\n\t\t}\n\t\tvoid main(){\n\t\t\t#ifdef isSelective\n\t\t\t\tfloat metalness=texture2D(tMetalness,vUv).r;\n\t\t\t\tif(metalness==0.) return;\n\t\t\t#endif\n\n\t\t\tfloat depth = getDepth( vUv );\n\t\t\tfloat viewZ = getViewZ( depth );\n\t\t\tif(-viewZ>=cameraFar) return;\n\n\t\t\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ+cameraProjectionMatrix[3][3];\n\t\t\tvec3 viewPosition=getViewPosition( vUv, depth, clipW );\n\n\t\t\tvec2 d0=gl_FragCoord.xy;\n\t\t\tvec2 d1;\n\n\t\t\tvec3 viewNormal=getViewNormal( vUv );\n\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\tvec3 viewIncidenceDir=normalize(viewPosition);\n\t\t\t\tvec3 viewReflectDir=reflect(viewIncidenceDir,viewNormal);\n\t\t\t#else\n\t\t\t\tvec3 viewIncidenceDir=vec3(0,0,-1);\n\t\t\t\tvec3 viewReflectDir=reflect(viewIncidenceDir,viewNormal);\n\t\t\t#endif\n\n\t\t\tfloat maxReflectRayLen=maxDistance/dot(-viewIncidenceDir,viewNormal);\n\t\t\t// dot(a,b)==length(a)*length(b)*cos(theta) // https://www.mathsisfun.com/algebra/vectors-dot-product.html\n\t\t\t// if(a.isNormalized&&b.isNormalized) dot(a,b)==cos(theta)\n\t\t\t// maxDistance/maxReflectRayLen=cos(theta)\n\t\t\t// maxDistance/maxReflectRayLen==dot(a,b)\n\t\t\t// maxReflectRayLen==maxDistance/dot(a,b)\n\n\t\t\tvec3 d1viewPosition=viewPosition+viewReflectDir*maxReflectRayLen;\n\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\tif(d1viewPosition.z>-cameraNear){\n\t\t\t\t\t//https://tutorial.math.lamar.edu/Classes/CalcIII/EqnsOfLines.aspx\n\t\t\t\t\tfloat t=(-cameraNear-viewPosition.z)/viewReflectDir.z;\n\t\t\t\t\td1viewPosition=viewPosition+viewReflectDir*t;\n\t\t\t\t}\n\t\t\t#endif\n\t\t\td1=viewPositionToXY(d1viewPosition);\n\n\t\t\tfloat totalLen=length(d1-d0);\n\t\t\tfloat xLen=d1.x-d0.x;\n\t\t\tfloat yLen=d1.y-d0.y;\n\t\t\tfloat totalStep=max(abs(xLen),abs(yLen));\n\t\t\tfloat xSpan=xLen/totalStep;\n\t\t\tfloat ySpan=yLen/totalStep;\n\t\t\tfor(float i=0.;i =totalStep) break;\n\t\t\t\tvec2 xy=vec2(d0.x+i*xSpan,d0.y+i*ySpan);\n\t\t\t\tif(xy.x<0.||xy.x>resolution.x||xy.y<0.||xy.y>resolution.y) break;\n\t\t\t\tfloat s=length(xy-d0)/totalLen;\n\t\t\t\tvec2 uv=xy/resolution;\n\n\t\t\t\tfloat d = getDepth(uv);\n\t\t\t\tfloat vZ = getViewZ( d );\n\t\t\t\tif(-vZ>=cameraFar) continue;\n\t\t\t\tfloat cW = cameraProjectionMatrix[2][3] * vZ+cameraProjectionMatrix[3][3];\n\t\t\t\tvec3 vP=getViewPosition( uv, d, cW );\n\n\t\t\t\t#ifdef isPerspectiveCamera\n\t\t\t\t\t// https://www.comp.nus.edu.sg/~lowkl/publications/lowk_persp_interp_techrep.pdf\n\t\t\t\t\tfloat recipVPZ=1./viewPosition.z;\n\t\t\t\t\tfloat viewReflectRayZ=1./(recipVPZ+s*(1./d1viewPosition.z-recipVPZ));\n\t\t\t\t\tfloat sD=surfDist*cW;\n\t\t\t\t#else\n\t\t\t\t\tfloat viewReflectRayZ=viewPosition.z+s*(d1viewPosition.z-viewPosition.z);\n\t\t\t\t\tfloat sD=surfDist;\n\t\t\t\t#endif\n\t\t\t\tif(viewReflectRayZ-sD>vZ) continue;\n\n\t\t\t\t#ifdef isInfiniteThick\n\t\t\t\t\tif(viewReflectRayZ+thickTolerance*clipW =0.) continue;\n\t\t\t\t\tfloat distance=pointPlaneDistance(vP,viewPosition,viewNormal);\n\t\t\t\t\tif(distance>maxDistance) break;\n\t\t\t\t\t#ifdef isDistanceAttenuation\n\t\t\t\t\t\tfloat ratio=1.-(distance/maxDistance);\n\t\t\t\t\t\tfloat attenuation=ratio*ratio;\n\t\t\t\t\t\top=opacity*attenuation;\n\t\t\t\t\t#endif\n\t\t\t\t\t#ifdef isFresnel\n\t\t\t\t\t\tfloat fresnel=(dot(viewIncidenceDir,viewReflectDir)+1.)/2.;\n\t\t\t\t\t\top*=fresnel;\n\t\t\t\t\t#endif\n\t\t\t\t\tvec4 reflectColor=texture2D(tDiffuse,uv);\n\t\t\t\t\tgl_FragColor.xyz=reflectColor.xyz;\n\t\t\t\t\tgl_FragColor.a=op;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t"},wo={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\n uniform sampler2D tDepth;\n\n uniform float cameraNear;\n uniform float cameraFar;\n\n varying vec2 vUv;\n\n #include \n\n\t\tfloat getLinearDepth( const in vec2 uv ) {\n\n\t\t\t#if PERSPECTIVE_CAMERA == 1\n\n\t\t\t\tfloat fragCoordZ = texture2D( tDepth, uv ).x;\n\t\t\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );\n\t\t\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );\n\n\t\t\t#else\n\n\t\t\t\treturn texture2D( tDepth, uv ).x;\n\n\t\t\t#endif\n\n\t\t}\n\n void main() {\n\n \tfloat depth = getLinearDepth( vUv );\n\t\t\tfloat d = 1.0 - depth;\n\t\t\t// d=(d-.999)*1000.;\n \tgl_FragColor = vec4( vec3( d ), 1.0 );\n\n }\n\n "},Zo={uniforms:{tDiffuse:{value:null},resolution:{value:new m.Vector2},opacity:{value:.5}},vertexShader:"\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n \tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform vec2 resolution;\n varying vec2 vUv;\n void main() {\n\t\t\t//reverse engineering from PhotoShop blur filter, then change coefficient\n\n \tvec2 texelSize = ( 1.0 / resolution );\n\n\t\t\tvec4 c=texture2D(tDiffuse,vUv);\n\n\t\t\tvec2 offset;\n\n\t\t\toffset=(vec2(-1,0))*texelSize;\n\t\t\tvec4 cl=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(1,0))*texelSize;\n\t\t\tvec4 cr=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(0,-1))*texelSize;\n\t\t\tvec4 cb=texture2D(tDiffuse,vUv+offset);\n\n\t\t\toffset=(vec2(0,1))*texelSize;\n\t\t\tvec4 ct=texture2D(tDiffuse,vUv+offset);\n\n\t\t\t// float coeCenter=.5;\n\t\t\t// float coeSide=.125;\n\t\t\tfloat coeCenter=.2;\n\t\t\tfloat coeSide=.2;\n\t\t\tfloat a=c.a*coeCenter+cl.a*coeSide+cr.a*coeSide+cb.a*coeSide+ct.a*coeSide;\n\t\t\tvec3 rgb=(c.rgb*c.a*coeCenter+cl.rgb*cl.a*coeSide+cr.rgb*cr.a*coeSide+cb.rgb*cb.a*coeSide+ct.rgb*ct.a*coeSide)/a;\n\t\t\tgl_FragColor=vec4(rgb,a);\n\n\t\t}\n\t"},So=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r,i=e.renderer,a=e.scene,o=e.camera,s=e.width,l=e.height,u=e.selects,g=e.bouncing,c=void 0!==g&&g,A=e.groundReflector;(0,h.Z)(this,n),(r=t.call(this)).width=void 0!==s?s:512,r.height=void 0!==l?l:512,r.clear=!0,r.renderer=i,r.scene=a,r.camera=o,r.groundReflector=A,r.opacity=Go.uniforms.opacity.value,r.output=0,r.maxDistance=Go.uniforms.maxDistance.value,r.thickness=Go.uniforms.thickness.value,r.tempColor=new m.Color,r._selects=u,r.selective=Array.isArray(r._selects),Object.defineProperty((0,d.Z)(r),"selects",{get:function(){return this._selects},set:function(e){this._selects!==e&&(this._selects=e,Array.isArray(e)?(this.selective=!0,this.ssrMaterial.defines.SELECTIVE=!0,this.ssrMaterial.needsUpdate=!0):(this.selective=!1,this.ssrMaterial.defines.SELECTIVE=!1,this.ssrMaterial.needsUpdate=!0))}}),r._bouncing=c,Object.defineProperty((0,d.Z)(r),"bouncing",{get:function(){return this._bouncing},set:function(e){this._bouncing!==e&&(this._bouncing=e,this.ssrMaterial.uniforms.tDiffuse.value=e?this.prevRenderTarget.texture:this.beautyRenderTarget.texture)}}),r.blur=!0,r._distanceAttenuation=Go.defines.DISTANCE_ATTENUATION,Object.defineProperty((0,d.Z)(r),"distanceAttenuation",{get:function(){return this._distanceAttenuation},set:function(e){this._distanceAttenuation!==e&&(this._distanceAttenuation=e,this.ssrMaterial.defines.DISTANCE_ATTENUATION=e,this.ssrMaterial.needsUpdate=!0)}}),r._fresnel=Go.defines.FRESNEL,Object.defineProperty((0,d.Z)(r),"fresnel",{get:function(){return this._fresnel},set:function(e){this._fresnel!==e&&(this._fresnel=e,this.ssrMaterial.defines.FRESNEL=e,this.ssrMaterial.needsUpdate=!0)}}),r._infiniteThick=Go.defines.INFINITE_THICK,Object.defineProperty((0,d.Z)(r),"infiniteThick",{get:function(){return this._infiniteThick},set:function(e){this._infiniteThick!==e&&(this._infiniteThick=e,this.ssrMaterial.defines.INFINITE_THICK=e,this.ssrMaterial.needsUpdate=!0)}});var I=new m.DepthTexture;return I.type=m.UnsignedShortType,I.minFilter=m.NearestFilter,I.magFilter=m.NearestFilter,r.beautyRenderTarget=new m.WebGLRenderTarget(r.width,r.height,{minFilter:m.NearestFilter,magFilter:m.NearestFilter,type:m.HalfFloatType,depthTexture:I,depthBuffer:!0}),r.prevRenderTarget=new m.WebGLRenderTarget(r.width,r.height,{minFilter:m.NearestFilter,magFilter:m.NearestFilter}),r.normalRenderTarget=new m.WebGLRenderTarget(r.width,r.height,{minFilter:m.NearestFilter,magFilter:m.NearestFilter,type:m.HalfFloatType}),r.metalnessRenderTarget=new m.WebGLRenderTarget(r.width,r.height,{minFilter:m.NearestFilter,magFilter:m.NearestFilter,type:m.HalfFloatType}),r.ssrRenderTarget=new m.WebGLRenderTarget(r.width,r.height,{minFilter:m.NearestFilter,magFilter:m.NearestFilter}),r.blurRenderTarget=r.ssrRenderTarget.clone(),r.blurRenderTarget2=r.ssrRenderTarget.clone(),r.ssrMaterial=new m.ShaderMaterial({defines:Object.assign({},Go.defines,{MAX_STEP:Math.sqrt(r.width*r.width+r.height*r.height)}),uniforms:m.UniformsUtils.clone(Go.uniforms),vertexShader:Go.vertexShader,fragmentShader:Go.fragmentShader,blending:m.NoBlending}),r.ssrMaterial.uniforms.tDiffuse.value=r.beautyRenderTarget.texture,r.ssrMaterial.uniforms.tNormal.value=r.normalRenderTarget.texture,r.ssrMaterial.defines.SELECTIVE=r.selective,r.ssrMaterial.needsUpdate=!0,r.ssrMaterial.uniforms.tMetalness.value=r.metalnessRenderTarget.texture,r.ssrMaterial.uniforms.tDepth.value=r.beautyRenderTarget.depthTexture,r.ssrMaterial.uniforms.cameraNear.value=r.camera.near,r.ssrMaterial.uniforms.cameraFar.value=r.camera.far,r.ssrMaterial.uniforms.thickness.value=r.thickness,r.ssrMaterial.uniforms.resolution.value.set(r.width,r.height),r.ssrMaterial.uniforms.cameraProjectionMatrix.value.copy(r.camera.projectionMatrix),r.ssrMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(r.camera.projectionMatrixInverse),r.normalMaterial=new m.MeshNormalMaterial,r.normalMaterial.blending=m.NoBlending,r.metalnessOnMaterial=new m.MeshBasicMaterial({color:"white"}),r.metalnessOffMaterial=new m.MeshBasicMaterial({color:"black"}),r.blurMaterial=new m.ShaderMaterial({defines:Object.assign({},Zo.defines),uniforms:m.UniformsUtils.clone(Zo.uniforms),vertexShader:Zo.vertexShader,fragmentShader:Zo.fragmentShader}),r.blurMaterial.uniforms.tDiffuse.value=r.ssrRenderTarget.texture,r.blurMaterial.uniforms.resolution.value.set(r.width,r.height),r.blurMaterial2=new m.ShaderMaterial({defines:Object.assign({},Zo.defines),uniforms:m.UniformsUtils.clone(Zo.uniforms),vertexShader:Zo.vertexShader,fragmentShader:Zo.fragmentShader}),r.blurMaterial2.uniforms.tDiffuse.value=r.blurRenderTarget.texture,r.blurMaterial2.uniforms.resolution.value.set(r.width,r.height),r.depthRenderMaterial=new m.ShaderMaterial({defines:Object.assign({},wo.defines),uniforms:m.UniformsUtils.clone(wo.uniforms),vertexShader:wo.vertexShader,fragmentShader:wo.fragmentShader,blending:m.NoBlending}),r.depthRenderMaterial.uniforms.tDepth.value=r.beautyRenderTarget.depthTexture,r.depthRenderMaterial.uniforms.cameraNear.value=r.camera.near,r.depthRenderMaterial.uniforms.cameraFar.value=r.camera.far,r.copyMaterial=new m.ShaderMaterial({uniforms:m.UniformsUtils.clone(Qa.uniforms),vertexShader:Qa.vertexShader,fragmentShader:Qa.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:m.SrcAlphaFactor,blendDst:m.OneMinusSrcAlphaFactor,blendEquation:m.AddEquation,blendSrcAlpha:m.SrcAlphaFactor,blendDstAlpha:m.OneMinusSrcAlphaFactor,blendEquationAlpha:m.AddEquation}),r.fsQuad=new Na(null),r.originalClearColor=new m.Color,r}return(0,C.Z)(n,[{key:"dispose",value:function(){this.beautyRenderTarget.dispose(),this.prevRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.metalnessRenderTarget.dispose(),this.ssrRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.blurRenderTarget2.dispose(),this.normalMaterial.dispose(),this.metalnessOnMaterial.dispose(),this.metalnessOffMaterial.dispose(),this.blurMaterial.dispose(),this.blurMaterial2.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose(),this.fsQuad.dispose()}},{key:"render",value:function(e,t){switch(e.setRenderTarget(this.beautyRenderTarget),e.clear(),this.groundReflector&&(this.groundReflector.visible=!1,this.groundReflector.doRender(this.renderer,this.scene,this.camera),this.groundReflector.visible=!0),e.render(this.scene,this.camera),this.groundReflector&&(this.groundReflector.visible=!1),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,0,0),this.selective&&this.renderMetalness(e,this.metalnessOnMaterial,this.metalnessRenderTarget,0,0),this.ssrMaterial.uniforms.opacity.value=this.opacity,this.ssrMaterial.uniforms.maxDistance.value=this.maxDistance,this.ssrMaterial.uniforms.thickness.value=this.thickness,this.renderPass(e,this.ssrMaterial,this.ssrRenderTarget),this.blur&&(this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.renderPass(e,this.blurMaterial2,this.blurRenderTarget2)),this.output){case n.OUTPUT.Default:this.bouncing?(this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=m.NormalBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.copyMaterial.uniforms.tDiffuse.value=this.prevRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t)):(this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=m.NormalBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t));break;case n.OUTPUT.SSR:this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.bouncing&&(this.blur?this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget2.texture:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget),this.copyMaterial.uniforms.tDiffuse.value=this.ssrRenderTarget.texture,this.copyMaterial.blending=m.NormalBlending,this.renderPass(e,this.copyMaterial,this.prevRenderTarget));break;case n.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case n.OUTPUT.Metalness:this.copyMaterial.uniforms.tDiffuse.value=this.metalnessRenderTarget.texture,this.copyMaterial.blending=m.NoBlending,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("THREE.SSRPass: Unknown output type.")}}},{key:"renderPass",value:function(e,t,n,r,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));var a=e.getClearAlpha(this.tempColor),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}},{key:"renderOverride",value:function(e,t,n,r,i){this.originalClearColor.copy(e.getClearColor(this.tempColor));var a=e.getClearAlpha(this.tempColor),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)}},{key:"renderMetalness",value:function(e,t,n,r,i){var a=this;this.originalClearColor.copy(e.getClearColor(this.tempColor));var o=e.getClearAlpha(this.tempColor),s=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,r=t.clearColor||r,i=t.clearAlpha||i,void 0!==r&&null!==r&&(e.setClearColor(r),e.setClearAlpha(i||0),e.clear()),this.scene.traverseVisible((function(e){e._SSRPassBackupMaterial=e.material,a._selects.includes(e)?e.material=a.metalnessOnMaterial:e.material=a.metalnessOffMaterial})),e.render(this.scene,this.camera),this.scene.traverseVisible((function(e){e.material=e._SSRPassBackupMaterial})),e.autoClear=s,e.setClearColor(this.originalClearColor),e.setClearAlpha(o)}},{key:"setSize",value:function(e,t){this.width=e,this.height=t,this.ssrMaterial.defines.MAX_STEP=Math.sqrt(e*e+t*t),this.ssrMaterial.needsUpdate=!0,this.beautyRenderTarget.setSize(e,t),this.prevRenderTarget.setSize(e,t),this.ssrRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.metalnessRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.blurRenderTarget2.setSize(e,t),this.ssrMaterial.uniforms.resolution.value.set(e,t),this.ssrMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssrMaterial.uniforms.cameraInverseProjectionMatrix.value.copy(this.camera.projectionMatrixInverse),this.blurMaterial.uniforms.resolution.value.set(e,t),this.blurMaterial2.uniforms.resolution.value.set(e,t)}}]),n}(Ma),xo=So,Ro=null,ko=null,Eo=null,Mo=null,No=null,Wo=null;function Fo(e,t,n){var r=new WebGLRenderTarget(e.x,e.y,n?{depthTexture:new DepthTexture(e.x,e.y),depthBuffer:!0}:void 0);return r.texture.format=t,r.texture.minFilter=NearestFilter,r.texture.magFilter=NearestFilter,r.texture.generateMipmaps=!1,r.stencilBuffer=!1,r}var Vo={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new m.Vector2(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","\tvUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","\tvec2 imageCoord = vUv;","\tvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","\tfor( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","\t\tsum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","\t\timageCoord += uImageIncrement;","\t}","\tgl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){for(var t,n,r=Math.min(2*Math.ceil(3*e)+1,25),i=.5*(r-1),a=new Array(r),o=0,s=0;s =2.0 are supported."));else{var s=new Fs(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});s.fileLoader.setRequestHeader(this.requestHeader);for(var l=0;l =0&&void 0===o[c]&&console.warn('THREE.GLTFLoader: Unknown extension "'+c+'".')}}s.setExtensions(a),s.setPlugins(o),s.parse(n,r)}}},{key:"parseAsync",value:function(e,t){var n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}]),n}(m.Loader);function _o(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Ko={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},Uo=function(){function e(t){(0,h.Z)(this,e),this.parser=t,this.name=Ko.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}return(0,C.Z)(e,[{key:"_markDefs",value:function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,r=t.length;n =0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,a)}}]),e}(),ns=function(){function e(t){(0,h.Z)(this,e),this.parser=t,this.name=Ko.EXT_TEXTURE_WEBP,this.isSupported=null}return(0,C.Z)(e,[{key:"loadTexture",value:function(e){var t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;var a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){var l=n.options.manager.getHandler(o.uri);null!==l&&(s=l)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}},{key:"detectSupport",value:function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}]),e}(),rs=function(){function e(t){(0,h.Z)(this,e),this.parser=t,this.name=Ko.EXT_TEXTURE_AVIF,this.isSupported=null}return(0,C.Z)(e,[{key:"loadTexture",value:function(e){var t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;var a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){var l=n.options.manager.getHandler(o.uri);null!==l&&(s=l)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)}))}},{key:"detectSupport",value:function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}]),e}(),is=function(){function e(t){(0,h.Z)(this,e),this.name=Ko.EXT_MESHOPT_COMPRESSION,this.parser=t}return(0,C.Z)(e,[{key:"loadBufferView",value:function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then((function(e){var t=r.byteOffset||0,n=r.byteLength||0,i=r.count,o=r.byteStride,s=new Uint8Array(e,t,n);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(i,o,s,r.mode,r.filter).then((function(e){return e.buffer})):a.ready.then((function(){var e=new ArrayBuffer(i*o);return a.decodeGltfBuffer(new Uint8Array(e),i,o,s,r.mode,r.filter),e}))}))}return null}}]),e}(),as=function(){function e(t){(0,h.Z)(this,e),this.name=Ko.EXT_MESH_GPU_INSTANCING,this.parser=t}return(0,C.Z)(e,[{key:"createNodeMesh",value:function(e){var t=this,n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;var i,a=n.meshes[r.mesh],o=(0,c.Z)(a.primitives);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(s.mode!==Cs.TRIANGLES&&s.mode!==Cs.TRIANGLE_STRIP&&s.mode!==Cs.TRIANGLE_FAN&&void 0!==s.mode)return null}}catch(I){o.e(I)}finally{o.f()}var l=r.extensions[this.name].attributes,u=[],g={},d=function(e){u.push(t.parser.getDependency("accessor",l[e]).then((function(t){return g[e]=t,g[e]})))};for(var A in l)d(A);return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then((function(e){var n,r=e.pop(),i=r.isGroup?r.children:[r],a=e[0].count,o=[],s=(0,c.Z)(i);try{for(s.s();!(n=s.n()).done;){for(var l=n.value,u=new m.Matrix4,d=new m.Vector3,A=new m.Quaternion,h=new m.Vector3(1,1,1),C=new m.InstancedMesh(l.geometry,l.material,a),f=0;f=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"}),{},{COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"}),bs={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Bs={CUBICSPLINE:void 0,LINEAR:m.InterpolateLinear,STEP:m.InterpolateDiscrete},Gs={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ws(e){return void 0===e.DefaultMaterial&&(e.DefaultMaterial=new m.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:m.FrontSide})),e.DefaultMaterial}function Zs(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Ss(e,t){void 0!==t.extras&&("object"===typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function xs(e,t,n){for(var r=!1,i=!1,a=!1,o=0,s=t.length;o 0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"}var Ws=new m.Matrix4,Fs=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,h.Z)(this,e),this.json=t,this.extensions={},this.plugins={},this.options=n,this.cache=new _o,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};var r=!1,i=!1,a=-1;"undefined"!==typeof navigator&&"undefined"!==typeof navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),a=(i=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"===typeof createImageBitmap||r||i&&a<98?this.textureLoader=new m.TextureLoader(this.options.manager):this.textureLoader=new m.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new m.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}return(0,C.Z)(e,[{key:"setExtensions",value:function(e){this.extensions=e}},{key:"setPlugins",value:function(e){this.plugins=e}},{key:"parse",value:function(e,t){var n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){var a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};Zs(i,a,r),Ss(a,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(a)}))).then((function(){e(a)}))})).catch(t)}},{key:"_markDefs",value:function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r=0,i=t.length;r=2&&a.setY(Z,B[G*s+1]),s>=3&&a.setZ(Z,B[G*s+2]),s>=4&&a.setW(Z,B[G*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a}))}},{key:"loadTexture",value:function(e){var t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){var o=n.manager.getHandler(i.uri);null!==o&&(a=o)}return this.loadTextureImage(e,r,a)}},{key:"loadTextureImage",value:function(e,t,n){var r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];var l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"===typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);var n=(i.samplers||{})[a.sampler]||{};return t.magFilter=ps[n.magFilter]||m.LinearFilter,t.minFilter=ps[n.minFilter]||m.LinearMipmapLinearFilter,t.wrapS=ms[n.wrapS]||m.RepeatWrapping,t.wrapT=ms[n.wrapT]||m.RepeatWrapping,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[s]=l,l}},{key:"loadImageSource",value:function(e,t){var n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((function(e){return e.clone()}));var i=n.images[e],a=self.URL||self.webkitURL,o=i.uri||"",s=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then((function(e){s=!0;var t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)}));else if(void 0===i.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");var l=Promise.resolve(o).then((function(e){return new Promise((function(n,i){var a=n;!0===t.isImageBitmapLoader&&(a=function(e){var t=new m.Texture(e);t.needsUpdate=!0,n(t)}),t.load(m.LoaderUtils.resolveURL(e,r.path),a,void 0,i)}))})).then((function(e){return!0===s&&a.revokeObjectURL(o),e.userData.mimeType=i.mimeType||Ns(i.uri),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e}));return this.sourceCache[e]=l,l}},{key:"assignTexture",value:function(e,t,n,r){var i=this;return this.getDependency("texture",n.index).then((function(a){if(!a)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((a=a.clone()).channel=n.texCoord),i.extensions[Ko.KHR_TEXTURE_TRANSFORM]){var o=void 0!==n.extensions?n.extensions[Ko.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var s=i.associations.get(a);a=i.extensions[Ko.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),i.associations.set(a,s)}}return void 0!==r&&("colorSpace"in a?a.colorSpace=3001===r?"srgb":"srgb-linear":a.encoding=r),e[t]=a,a}))}},{key:"assignFinalMaterial",value:function(e){var t=e.geometry,n=e.material,r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){var o="PointsMaterial:"+n.uuid,s=this.cache.get(o);s||(s=new m.PointsMaterial,m.Material.prototype.copy.call(s,n),s.color.copy(n.color),s.map=n.map,s.sizeAttenuation=!1,this.cache.add(o,s)),n=s}else if(e.isLine){var l="LineBasicMaterial:"+n.uuid,u=this.cache.get(l);u||(u=new m.LineBasicMaterial,m.Material.prototype.copy.call(u,n),u.color.copy(n.color),u.map=n.map,this.cache.add(l,u)),n=u}if(r||i||a){var g="ClonedMaterial:"+n.uuid+":";r&&(g+="derivative-tangents:"),i&&(g+="vertex-colors:"),a&&(g+="flat-shading:");var c=this.cache.get(g);c||(c=n.clone(),i&&(c.vertexColors=!0),a&&(c.flatShading=!0),r&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(g,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}},{key:"getMaterialType",value:function(){return m.MeshStandardMaterial}},{key:"loadMaterial",value:function(e){var t,n=this,r=this.json,i=this.extensions,a=r.materials[e],o={},s=[];if((a.extensions||{})[Ko.KHR_MATERIALS_UNLIT]){var l=i[Ko.KHR_MATERIALS_UNLIT];t=l.getMaterialType(),s.push(l.extendParams(o,a,n))}else{var u=a.pbrMetallicRoughness||{};if(o.color=new m.Color(1,1,1),o.opacity=1,Array.isArray(u.baseColorFactor)){var g=u.baseColorFactor;o.color.fromArray(g),o.opacity=g[3]}void 0!==u.baseColorTexture&&s.push(n.assignTexture(o,"map",u.baseColorTexture,3001)),o.metalness=void 0!==u.metallicFactor?u.metallicFactor:1,o.roughness=void 0!==u.roughnessFactor?u.roughnessFactor:1,void 0!==u.metallicRoughnessTexture&&(s.push(n.assignTexture(o,"metalnessMap",u.metallicRoughnessTexture)),s.push(n.assignTexture(o,"roughnessMap",u.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),s.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===a.doubleSided&&(o.side=m.DoubleSide);var c=a.alphaMode||Gs.OPAQUE;if(c===Gs.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,c===Gs.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==m.MeshBasicMaterial&&(s.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new m.Vector2(1,1),void 0!==a.normalTexture.scale)){var d=a.normalTexture.scale;o.normalScale.set(d,d)}return void 0!==a.occlusionTexture&&t!==m.MeshBasicMaterial&&(s.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==m.MeshBasicMaterial&&(o.emissive=(new m.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==m.MeshBasicMaterial&&s.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,3001)),Promise.all(s).then((function(){var r=new t(o);return a.name&&(r.name=a.name),Ss(r,a),n.associations.set(r,{materials:e}),a.extensions&&Zs(i,r,a),r}))}},{key:"createUniqueName",value:function(e){var t=m.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}},{key:"loadGeometries",value:function(e){var t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[Ko.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return Ts(n,e,t)}))}for(var a=[],o=0,s=e.length;o0&&Rs(A,i),A.name=t.createUniqueName(i.name||"mesh_"+e),Ss(A,i),d.extensions&&Zs(r,A,d),t.assignFinalMaterial(A),l.push(A)}for(var h=0,C=l.length;h1?new m.Group:1===t.length?t[0]:new m.Object3D)!==t[0])for(var s=0,l=t.length;s 1)this._updatePointerVertices(Js),this.pointerMesh.position.set(0,0,-1*Js),this.pointerMesh.material.opacity=Qs;else if(i>0){var o=(Js-js)*i+js;this._updatePointerVertices(o),a<1?(this.pointerMesh.position.set(0,0,-1*o-(1-a)*Ds),this.pointerMesh.material.opacity=Qs+(1-a)*(Ps-Qs)):(this.pointerMesh.position.set(0,0,-1*o),this.pointerMesh.material.opacity=Qs)}else this._updatePointerVertices(js),this.pointerMesh.position.set(0,0,-1*js-Ds),this.pointerMesh.material.opacity=Ps;this.cursorObject.material.opacity=this.pointerMesh.material.opacity}},{key:"updateMatrixWorld",value:function(e){(0,A.Z)((0,I.Z)(n.prototype),"updateMatrixWorld",this).call(this,e),this.pointerGeometry&&(this._updatePointer(),this._updateRaycaster())}},{key:"isPinched",value:function(){return this.pinched}},{key:"setAttached",value:function(e){this.attached=e}},{key:"isAttached",value:function(){return this.attached}},{key:"intersectObject",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.raycaster)return this.raycaster.intersectObject(e,t)}},{key:"intersectObjects",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.raycaster)return this.raycaster.intersectObjects(e,t)}},{key:"checkIntersections",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.raycaster&&!this.attached){var n=this.raycaster.intersectObjects(e,t),r=new m.Vector3(0,0,-1);if(n.length>0){var i=n[0].distance;this.cursorObject.position.copy(r.multiplyScalar(i))}else this.cursorObject.position.copy(r.multiplyScalar(al))}}},{key:"setCursor",value:function(e){var t=new m.Vector3(0,0,-1);this.raycaster&&!this.attached&&this.cursorObject.position.copy(t.multiplyScalar(e))}},{key:"dispose",value:function(){this._onDisconnected(),this.hand.removeEventListener("connected",this._onConnected),this.hand.removeEventListener("disconnected",this._onDisconnected)}}]),n}(m.Object3D);function sl(e,t){var n=document.createElement("canvas"),r=n.getContext("2d"),i=100;r.font="normal 100px Arial";var a=r.measureText(e).width;n.width=a,n.height=i,r.font="normal 100px Arial",r.textAlign="center",r.textBaseline="middle",r.fillStyle="#ffffff",r.fillText(e,a/2,50);var o=new THREE.Texture(n);o.needsUpdate=!0;var s=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,map:o,transparent:!0}),l=new THREE.PlaneGeometry(t*a/i,t);return new THREE.Mesh(l,s)}var ll=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,null,[{key:"createButton",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.createElement("button");function i(){r.style.display="",r.style.cursor="auto",r.style.left="calc(50% - 75px)",r.style.width="150px",r.onmouseenter=null,r.onmouseleave=null,r.onclick=null,r.textContent="VR NOT SUPPORTED"}function a(e){e.style.position="absolute",e.style.bottom="20px",e.style.padding="12px 6px",e.style.border="1px solid #fff",e.style.borderRadius="4px",e.style.background="rgba(0,0,0,0.1)",e.style.color="#fff",e.style.font="normal 13px sans-serif",e.style.textAlign="center",e.style.opacity="0.5",e.style.outline="none",e.style.zIndex="999"}if("xr"in navigator)return a(r),r.id="VRButton",r.style.display="none",navigator.xr.isSessionSupported("immersive-vr").then((function(a){a?function(){var e=null;function i(e){return a.apply(this,arguments)}function a(){return(a=(0,g.Z)((0,u.Z)().mark((function n(i){return(0,u.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i.addEventListener("end",o),n.next=3,t.xr.setSession(i);case 3:r.textContent="EXIT VR",e=i;case 5:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function o(){e.removeEventListener("end",o),r.textContent="ENTER VR",e=null}r.style.display="",r.style.cursor="pointer",r.style.left="calc(50% - 50px)",r.style.width="100px",r.textContent="ENTER VR",r.onmouseenter=function(){r.style.opacity="1.0"},r.onmouseleave=function(){r.style.opacity="0.5"},r.onclick=function(){var t;if(null===e){var r=[n.optionalFeatures,"local-floor","bounded-floor","hand-tracking"].flat().filter(Boolean);null==(t=navigator.xr)||t.requestSession("immersive-vr",(0,l.Z)((0,l.Z)({},n),{},{optionalFeatures:r})).then(i)}else e.end()}}():i(),a&&e.xrSessionIsGranted&&r.click()})),r;var o=document.createElement("a");return!1===window.isSecureContext?(o.href=document.location.href.replace(/^http:/,"https:"),o.innerHTML="WEBXR NEEDS HTTPS"):(o.href="https://immersiveweb.dev/",o.innerHTML="WEBXR NOT AVAILABLE"),o.style.left="calc(50% - 90px)",o.style.width="180px",o.style.textDecoration="none",a(o),o}},{key:"registerSessionGrantedListener",value:function(){"undefined"!==typeof navigator&&"xr"in navigator&&navigator.xr.addEventListener("sessiongranted",(function(){e.xrSessionIsGranted=!0}))}}]),e}(),ul=ll,gl={Handedness:{NONE:"none",LEFT:"left",RIGHT:"right"},ComponentState:{DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"},ComponentProperty:{BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"},ComponentType:{TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"},ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:{TRANSFORM:"transform",VISIBILITY:"visibility"}};function cl(e){return dl.apply(this,arguments)}function dl(){return(dl=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:if((n=e.sent).ok){e.next=7;break}throw new Error(n.statusText);case 7:return e.abrupt("return",n.json());case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Al(e){return Il.apply(this,arguments)}function Il(){return(Il=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("No basePath supplied");case 2:return"profilesList.json",e.next=5,cl("".concat(t,"/").concat("profilesList.json"));case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hl(e,t){return Cl.apply(this,arguments)}function Cl(){return Cl=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,n){var r,i,a,o,s,l,u,g,c=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>2&&void 0!==c[2]?c[2]:null,i=!(c.length>3&&void 0!==c[3])||c[3],t){e.next=4;break}throw new Error("No xrInputSource supplied");case 4:if(n){e.next=6;break}throw new Error("No basePath supplied");case 6:return e.next=8,Al(n);case 8:if(a=e.sent,o=void 0,t.profiles.some((function(e){var t=a[e];return t&&(o={profileId:e,profilePath:"".concat(n,"/").concat(t.path),deprecated:!!t.deprecated}),!!o})),o){e.next=18;break}if(r){e.next=14;break}throw new Error("No matching profile name found");case 14:if(s=a[r]){e.next=17;break}throw new Error('No matching profile name found and default profile "'.concat(r,'" missing.'));case 17:o={profileId:r,profilePath:"".concat(n,"/").concat(s.path),deprecated:!!s.deprecated};case 18:return e.next=20,cl(o.profilePath);case 20:if(l=e.sent,u=void 0,!i){e.next=27;break}if(g="any"===t.handedness?l.layouts[Object.keys(l.layouts)[0]]:l.layouts[t.handedness]){e.next=26;break}throw new Error("No matching handedness, ".concat(t.handedness,", in profile ").concat(o.profileId));case 26:g.assetPath&&(u=o.profilePath.replace("profile.json",g.assetPath));case 27:return e.abrupt("return",{profile:l,assetPath:u});case 28:case"end":return e.stop()}}),e)}))),Cl.apply(this,arguments)}var fl={xAxis:0,yAxis:0,button:0,state:gl.ComponentState.DEFAULT};function pl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e,r=t;if(Math.sqrt(e*e+t*t)>1){var i=Math.atan2(t,e);n=Math.cos(i),r=Math.sin(i)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*r+.5}}var ml=null,vl=null,yl=null,bl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Bl="generic-trigger",Gl=function(e,t){t.traverse((function(t){t instanceof Mesh&&"envMap"in t.material&&(t.material.envMap=e,t.material.needsUpdate=!0)}))},wl=null;function Zl(e,t){Object.values(e.components).forEach((function(e){var n=e.type,r=e.touchPointNodeName,i=e.visualResponses;if(n===gl.ComponentType.TOUCHPAD&&r)if(e.touchPointNode=t.getObjectByName(r),e.touchPointNode){var a=new SphereGeometry(.001),o=new MeshBasicMaterial({color:255}),s=new Mesh(a,o);e.touchPointNode.add(s)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(i).forEach((function(e){var n=e.valueNodeName,r=e.minNodeName,i=e.maxNodeName;if(e.valueNodeProperty===gl.VisualResponseProperty.TRANSFORM&&r&&i){if(e.minNode=t.getObjectByName(r),e.maxNode=t.getObjectByName(i),!e.minNode)return void console.warn("Could not find ".concat(r," in the model"));if(!e.maxNode)return void console.warn("Could not find ".concat(i," in the model"))}e.valueNode=t.getObjectByName(n),e.valueNode||console.warn("Could not find ".concat(n," in the model"))}))}))}function Sl(e,t){Zl(e.motionController,t),e.envMap&&Gl(e.envMap,t),e.add(t)}var xl=null,Rl=null,kl=null,El=new m.Matrix4,Ml=new m.Vector3,Nl=null,Wl=null,Fl=null,Vl=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e,t,n){return n.set(e,t,Math.cos(e)*Math.sin(t))},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;(0,h.Z)(this,n),(e=t.call(this)).type="ParametricGeometry",e.parameters={func:r,slices:i,stacks:a};for(var o=[],s=[],l=[],u=[],g=1e-5,c=new m.Vector3,d=new m.Vector3,A=new m.Vector3,I=new m.Vector3,C=new m.Vector3,f=i+1,p=0;p<=a;p++)for(var v=p/a,y=0;y<=i;y++){var b=y/i;r(b,v,d),s.push(d.x,d.y,d.z),b-g>=0?(r(b-g,v,A),I.subVectors(d,A)):(r(b+g,v,A),I.subVectors(A,d)),v-g>=0?(r(b,v-g,A),C.subVectors(d,A)):(r(b,v+g,A),C.subVectors(A,d)),c.crossVectors(I,C).normalize(),l.push(c.x,c.y,c.z),u.push(b,v)}for(var B=0;B1&&void 0!==arguments[1]?arguments[1]:64,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,h.Z)(this,n);var l=i+1,u=e.computeFrenetFrames(i,s),g=u.tangents,c=u.normals,d=u.binormals,A=new m.Vector3;return(r=t.call(this,(function(t,n,r){n*=2*Math.PI;var i=Math.floor(t*(l-1));e.getPointAt(t,A);var o=c[i],s=d[i],u=-a*Math.cos(n),g=a*Math.sin(n);A.x+=u*o.x+g*s.x,A.y+=u*o.y+g*s.y,A.z+=u*o.z+g*s.z,r.copy(A)}),i,o)).tangents=g,r.normals=c,r.binormals=d,r.path=e,r.segments=i,r.radius=a,r.segmentsRadius=o,r.closed=s,r}return(0,C.Z)(n)}(Vl),Ll={klein:function(e,t,n){var r,i;t*=Math.PI,e*=2*Math.PI,(t*=2) 0&&void 0!==arguments[0]?arguments[0]:200,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;(0,h.Z)(this,n);var u=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),t.apply(this,arguments)}return(0,C.Z)(n,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new m.Vector3;e*=2*Math.PI;var n=(1+.5*Math.cos(l*e))*Math.cos(s*e),i=(1+.5*Math.cos(l*e))*Math.sin(s*e),a=.5*Math.sin(l*e);return t.set(n,i,a).multiplyScalar(r)}}]),n}(m.Curve),g=a,c=o,d=new u;return(e=t.call(this,d,g,i,c,!0,!1)).radius=r,e.tube=i,e.segmentsT=a,e.segmentsR=o,e.p=s,e.q=l,e}return(0,C.Z)(n)}(Tl),SphereGeometry:function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,i){return(0,h.Z)(this,n),t.call(this,(function(t,n,r){t*=Math.PI,n*=2*Math.PI;var i=e*Math.sin(t)*Math.cos(n),a=e*Math.sin(t)*Math.sin(n),o=e*Math.cos(t);r.set(i,a,o)}),r,i)}return(0,C.Z)(n)}(Vl),PlaneGeometry:function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,i,a){return(0,h.Z)(this,n),t.call(this,(function(t,n,i){var a=t*e,o=n*r;i.set(a,0,o)}),i,a)}return(0,C.Z)(n)}(Vl)},Hl=new m.Vector3;function Xl(e,t,n,r,i,a){var o=2*Math.PI*i/4,s=Math.max(a-2*i,0),l=Math.PI/4;Hl.copy(t),Hl[r]=0,Hl.normalize();var u=.5*o/(o+s),g=1-Hl.angleTo(e)/l;return 1===Math.sign(Hl[n])?g*u:s/(o+s)+u+u*(1-g)}var Yl=null,_l=null,Kl=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,i,a){var o;(0,h.Z)(this,n),o=t.call(this);var s=[],l=[],u=[],g=new m.Vector3,c=new m.Matrix4;c.makeRotationFromEuler(i),c.setPosition(r);var d=new m.Matrix4;function A(t,n,r){n.applyMatrix4(e.matrixWorld),n.applyMatrix4(d),r.transformDirection(e.matrixWorld),t.push(new Ul(n.clone(),r.clone()))}function I(e,t){for(var n=[],r=.5*Math.abs(a.dot(t)),i=0;i 0)?1:0)+((s=e[i+1].position.dot(t)-r>0)?1:0)+((l=e[i+2].position.dot(t)-r>0)?1:0)){case 0:n.push(e[i]),n.push(e[i+1]),n.push(e[i+2]);break;case 1:if(o&&(u=e[i+1],g=e[i+2],c=C(e[i],u,t,r),d=C(e[i],g,t,r)),s){u=e[i],g=e[i+2],c=C(e[i+1],u,t,r),d=C(e[i+1],g,t,r),n.push(c),n.push(g.clone()),n.push(u.clone()),n.push(g.clone()),n.push(c.clone()),n.push(d);break}l&&(u=e[i],g=e[i+1],c=C(e[i+2],u,t,r),d=C(e[i+2],g,t,r)),n.push(u.clone()),n.push(g.clone()),n.push(c),n.push(d),n.push(c.clone()),n.push(g.clone());break;case 2:o||(g=C(u=e[i].clone(),e[i+1],t,r),c=C(u,e[i+2],t,r),n.push(u),n.push(g),n.push(c)),s||(g=C(u=e[i+1].clone(),e[i+2],t,r),c=C(u,e[i],t,r),n.push(u),n.push(g),n.push(c)),l||(g=C(u=e[i+2].clone(),e[i],t,r),c=C(u,e[i+1],t,r),n.push(u),n.push(g),n.push(c))}}return n}function C(e,t,n,r){var i=e.position.dot(n)-r,a=i/(i-(t.position.dot(n)-r));return new Ul(new m.Vector3(e.position.x+a*(t.position.x-e.position.x),e.position.y+a*(t.position.y-e.position.y),e.position.z+a*(t.position.z-e.position.z)),new m.Vector3(e.normal.x+a*(t.normal.x-e.normal.x),e.normal.y+a*(t.normal.y-e.normal.y),e.normal.z+a*(t.normal.z-e.normal.z)))}return d.copy(c).invert(),function(){var t,n=[],r=new m.Vector3,i=new m.Vector3;if(!0===e.geometry.isGeometry)return void console.error("THREE.DecalGeometry no longer supports THREE.Geometry. Use BufferGeometry instead.");var o=e.geometry,d=o.attributes.position,h=o.attributes.normal;if(null!==o.index){var C=o.index;for(t=0;t n.length;)n.push(new e);n.length=t.length;for(var r=0;r 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\tfloat linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )\n\tvec2 cascade;\n\tfloat cascadeCenter;\n\tfloat closestEdge;\n\tfloat margin;\n\tfloat csmx;\n\tfloat csmy;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t \t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\t\t// NOTE: Depth gets larger away from the camera.\n\t\t\t// cascade.x is closer, cascade.y is further\n\t\t\tcascade = CSM_cascades[ i ];\n\t\t\tcascadeCenter = ( cascade.x + cascade.y ) / 2.0;\n\t\t\tclosestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;\n\t\t\tmargin = 0.25 * pow( closestEdge, 2.0 );\n\t\t\tcsmx = cascade.x - margin / 2.0;\n\t\t\tcsmy = cascade.y + margin / 2.0;\n\t\t\tif( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {\n\n\t\t\t\tfloat dist = min( linearDepth - csmx, csmy - linearDepth );\n\t\t\t\tfloat ratio = clamp( dist / margin, 0.0, 1.0 );\n\n\t\t\t\tvec3 prevColor = directLight.color;\n\t\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\t\tbool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;\n\t\t\t\tdirectLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );\n\n\t\t\t\tReflectedLight prevLight = reflectedLight;\n\t\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t\tbool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;\n\t\t\t\tfloat blendRatio = shouldBlend ? ratio : 1.0;\n\n\t\t\t\treflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );\n\t\t\t\treflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );\n\t\t\t\treflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );\n\t\t\t\treflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );\n\n\t\t\t}\n\t \t#endif\n\n\t}\n\t#pragma unroll_loop_end\n\t#else\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\n\t\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t\t\tif(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t\t#endif\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)\n\t\t// compute the lights not casting shadows (if any)\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\n\t\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",getlights_pars_begin:function(){return"\n\t\t\t#if defined( USE_CSM ) && defined( CSM_CASCADES )\n\t\t\tuniform vec2 CSM_cascades[CSM_CASCADES];\n\t\t\tuniform float cameraNear;\n\t\t\tuniform float shadowFar;\n\t\t\t#endif\n\n\t\t\t".concat(m.ShaderChunk.lights_pars_begin,"\n\t\t")}},Jl=new m.Matrix4,jl=new Ql,ql=new m.Vector3,$l=new m.Box3,eu=null,tu=null,nu=null,ru=null,iu={uniforms:{tDiffuse:{value:null},exposure:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define saturate(a) clamp( a, 0.0, 1.0 )","uniform sampler2D tDiffuse;","uniform float exposure;","varying vec2 vUv;","vec3 RRTAndODTFit( vec3 v ) {","\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;","\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;","\treturn a / b;","}","vec3 ACESFilmicToneMapping( vec3 color ) {","\tconst mat3 ACESInputMat = mat3(","\t\tvec3( 0.59719, 0.07600, 0.02840 ),","\t\tvec3( 0.35458, 0.90834, 0.13383 ),","\t\tvec3( 0.04823, 0.01566, 0.83777 )","\t);","\tconst mat3 ACESOutputMat = mat3(","\t\tvec3( 1.60475, -0.10208, -0.00327 ),","\t\tvec3( -0.53108, 1.10813, -0.07276 ),","\t\tvec3( -0.07367, -0.00605, 1.07602 )","\t);","\tcolor = ACESInputMat * color;","\tcolor = RRTAndODTFit( color );","\tcolor = ACESOutputMat * color;","\treturn saturate( color );","}","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\ttex.rgb *= exposure / 0.6;","\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );","}"].join("\n")},au={uniforms:{},vertexShader:["void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")},ou={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 base = texture2D( tDiffuse, vUv );","\tvec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","\tfloat lum = dot( lumCoeff, base.rgb );","\tvec3 blend = vec3( lum );","\tfloat L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","\tvec3 result1 = 2.0 * base.rgb * blend;","\tvec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","\tvec3 newColor = mix( result1, result2, L );","\tfloat A2 = opacity * base.a;","\tvec3 mixRGB = A2 * newColor.rgb;","\tmixRGB += ( ( 1.0 - A2 ) * base.rgb );","\tgl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")},su={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","\tvec4 texel1 = texture2D( tDiffuse1, vUv );","\tvec4 texel2 = texture2D( tDiffuse2, vUv );","\tgl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")},lu={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tgl_FragColor.rgb += brightness;","\tif (contrast > 0.0) {","\t\tgl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","\t} else {","\t\tgl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","\t}","}"].join("\n")},uu={uniforms:{tDiffuse:{value:null},powRGB:{value:new m.Vector3(2,2,2)},mulRGB:{value:new m.Vector3(1,1,1)},addRGB:{value:new m.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tgl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")},gu={uniforms:{tDiffuse:{value:null},color:{value:new m.Color(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tgl_FragColor = vec4( v * color, texel.w );","}"].join("\n")},cu={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","\tvec4 depth = texture2D( tDepth, vUv );","\tfloat factor = depth.x - focus;","\tvec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","\tgl_FragColor = col;","\tgl_FragColor.a = 1.0;","}"].join("\n")},du={uniforms:{tDiffuse:{value:null},resolution:{value:new m.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immediates."," // Immediates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")},Au={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color, org, tmp, add;","\tfloat sample_dist, f;","\tvec2 vin;","\tvec2 uv = vUv;","\tadd = color = org = texture2D( tDiffuse, uv );","\tvin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","\tsample_dist = dot( vin, vin ) * 2.0;","\tf = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","\tvec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tadd += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","\tif( tmp.b < color.b ) color = tmp;","\tcolor = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","\tcolor = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","\tgl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")},Iu={uniforms:{tDiffuse:{value:null},aspect:{value:new m.Vector2(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","\tG[0] = g0,","\tG[1] = g1,","\tG[2] = g2,","\tG[3] = g3,","\tG[4] = g4,","\tG[5] = g5,","\tG[6] = g6,","\tG[7] = g7,","\tG[8] = g8;","\tmat3 I;","\tfloat cnv[9];","\tvec3 sample;","\tfor (float i=0.0; i<3.0; i++) {","\t\tfor (float j=0.0; j<3.0; j++) {","\t\t\tsample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","\t\t\tI[int(i)][int(j)] = length(sample);","\t\t}","\t}","\tfor (int i=0; i<9; i++) {","\t\tfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","\t\tcnv[i] = dp3 * dp3;","\t}","\tfloat M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","\tfloat S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","\tgl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")},hu={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvReflect = reflect( I, worldNormal );","\tvRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","\tvRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","\tvRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","\tvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","\tvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","\tvec4 refractedColor = vec4( 1.0 );","\trefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","\trefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","\trefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","\tgl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")},Cu={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vUv );","\tgl_FragColor = LinearTosRGB( tex );","}"].join("\n")},fu={uniforms:{tInput:{value:null}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tInput;","void main() {","\tgl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );","}"].join("\n")},pu={uniforms:{tInput:{value:null},fStepSize:{value:1},vSunPositionScreenSpace:{value:new m.Vector3}},vertexShader:["varying vec2 vUv;","void main() {"," vUv = uv;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define TAPS_PER_PASS 6.0","varying vec2 vUv;","uniform sampler2D tInput;","uniform vec3 vSunPositionScreenSpace;","uniform float fStepSize;","void main() {","\tvec2 delta = vSunPositionScreenSpace.xy - vUv;","\tfloat dist = length( delta );","\tvec2 stepv = fStepSize * delta / dist;","\tfloat iters = dist/fStepSize;","\tvec2 uv = vUv.xy;","\tfloat col = 0.0;","\tfloat f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) );","\tif ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tif ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;","\tuv += stepv;","\tgl_FragColor = vec4( col/TAPS_PER_PASS );","\tgl_FragColor.a = 1.0;","}"].join("\n")},mu={uniforms:{tColors:{value:null},tGodRays:{value:null},fGodRayIntensity:{value:.69}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform sampler2D tColors;","uniform sampler2D tGodRays;","uniform float fGodRayIntensity;","void main() {","\tgl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );","\tgl_FragColor.a = 1.0;","}"].join("\n")},vu={uniforms:{vSunPositionScreenSpace:{value:new m.Vector3},fAspect:{value:1},sunColor:{value:new m.Color(16772608)},bgColor:{value:new m.Color(0)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["varying vec2 vUv;","uniform vec3 vSunPositionScreenSpace;","uniform float fAspect;","uniform vec3 sunColor;","uniform vec3 bgColor;","void main() {","\tvec2 diff = vUv - vSunPositionScreenSpace.xy;","\tdiff.x *= fAspect;","\tfloat prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );","\tprop = 0.35 * pow( 1.0 - prop, 3.0 );","\tgl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;","\tgl_FragColor.w = 1.0;","}"].join("\n")},yu={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "},bu={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat hh = h * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")},Bu={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","\tgl_FragColor = texture2D( tDiffuse, vUv );","\tfloat angle = hue * 3.14159265;","\tfloat s = sin(angle), c = cos(angle);","\tvec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","\tfloat len = length(gl_FragColor.rgb);","\tgl_FragColor.rgb = vec3(","\t\tdot(gl_FragColor.rgb, weights.xyz),","\t\tdot(gl_FragColor.rgb, weights.zxy),","\t\tdot(gl_FragColor.rgb, weights.yzx)","\t);","\tfloat average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","\tif (saturation > 0.0) {","\t\tgl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","\t} else {","\t\tgl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","\t}","}"].join("\n")},Gu={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","\tvec2 p = vUv - 0.5;","\tfloat r = length(p);","\tfloat a = atan(p.y, p.x) + angle;","\tfloat tau = 2. * 3.1416 ;","\ta = mod(a, tau/sides);","\ta = abs(a - tau/sides/2.) ;","\tp = r * vec2(cos(a), sin(a));","\tvec4 color = texture2D(tDiffuse, p + 0.5);","\tgl_FragColor = color;","}"].join("\n")},wu={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","\tvec2 p = vUv;","\tif (side == 0){","\t\tif (p.x > 0.5) p.x = 1.0 - p.x;","\t}else if (side == 1){","\t\tif (p.x < 0.5) p.x = 1.0 - p.x;","\t}else if (side == 2){","\t\tif (p.y < 0.5) p.y = 1.0 - p.y;","\t}else if (side == 3){","\t\tif (p.y > 0.5) p.y = 1.0 - p.y;","\t} ","\tvec4 color = texture2D(tDiffuse, p);","\tgl_FragColor = color;","}"].join("\n")},Zu={uniforms:{heightMap:{value:null},resolution:{value:new m.Vector2(512,512)},scale:{value:new m.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","\tfloat val = texture2D( heightMap, vUv ).x;","\tfloat valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","\tfloat valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","\tgl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")},Su={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","\tvUv = uv;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvViewPosition = -mvPosition.xyz;","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","\tvec2 parallaxMap( in vec3 V ) {","\t\tfloat initialHeight = texture2D( bumpMap, vUv ).r;","\t\tvec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","\t\treturn vUv - texCoordOffset;","\t}","#else","\tvec2 parallaxMap( in vec3 V ) {","\t\tfloat numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","\t\tfloat layerHeight = 1.0 / numLayers;","\t\tfloat currentLayerHeight = 0.0;","\t\tvec2 dtex = parallaxScale * V.xy / V.z / numLayers;","\t\tvec2 currentTextureCoords = vUv;","\t\tfloat heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\tfor ( int i = 0; i < 30; i += 1 ) {","\t\t\tif ( heightFromTexture <= currentLayerHeight ) {","\t\t\t\tbreak;","\t\t\t}","\t\t\tcurrentLayerHeight += layerHeight;","\t\t\tcurrentTextureCoords -= dtex;","\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\t}","\t\t#ifdef USE_STEEP_PARALLAX","\t\t\treturn currentTextureCoords;","\t\t#elif defined( USE_RELIEF_PARALLAX )","\t\t\tvec2 deltaTexCoord = dtex / 2.0;","\t\t\tfloat deltaHeight = layerHeight / 2.0;","\t\t\tcurrentTextureCoords += deltaTexCoord;","\t\t\tcurrentLayerHeight -= deltaHeight;","\t\t\tconst int numSearches = 5;","\t\t\tfor ( int i = 0; i < numSearches; i += 1 ) {","\t\t\t\tdeltaTexCoord /= 2.0;","\t\t\t\tdeltaHeight /= 2.0;","\t\t\t\theightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","\t\t\t\tif( heightFromTexture > currentLayerHeight ) {","\t\t\t\t\tcurrentTextureCoords -= deltaTexCoord;","\t\t\t\t\tcurrentLayerHeight += deltaHeight;","\t\t\t\t} else {","\t\t\t\t\tcurrentTextureCoords += deltaTexCoord;","\t\t\t\t\tcurrentLayerHeight -= deltaHeight;","\t\t\t\t}","\t\t\t}","\t\t\treturn currentTextureCoords;","\t\t#elif defined( USE_OCLUSION_PARALLAX )","\t\t\tvec2 prevTCoords = currentTextureCoords + dtex;","\t\t\tfloat nextH = heightFromTexture - currentLayerHeight;","\t\t\tfloat prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","\t\t\tfloat weight = nextH / ( nextH - prevH );","\t\t\treturn prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","\t\t#else","\t\t\treturn vUv;","\t\t#endif","\t}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","\tvec2 texDx = dFdx( vUv );","\tvec2 texDy = dFdy( vUv );","\tvec3 vSigmaX = dFdx( surfPosition );","\tvec3 vSigmaY = dFdy( surfPosition );","\tvec3 vR1 = cross( vSigmaY, surfNormal );","\tvec3 vR2 = cross( surfNormal, vSigmaX );","\tfloat fDet = dot( vSigmaX, vR1 );","\tvec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","\tvec3 vProjVtex;","\tvProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","\tvProjVtex.z = dot( surfNormal, viewPosition );","\treturn parallaxMap( vProjVtex );","}","void main() {","\tvec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","\tgl_FragColor = texture2D( map, mapUv );","}"].join("\n")},xu={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")},Ru={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","\tvec2 offset = amount * vec2( cos(angle), sin(angle));","\tvec4 cr = texture2D(tDiffuse, vUv + offset);","\tvec4 cga = texture2D(tDiffuse, vUv);","\tvec4 cb = texture2D(tDiffuse, vUv - offset);","\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")},ku={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tvec3 c = color.rgb;","\tcolor.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","\tcolor.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","\tcolor.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","\tgl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")},Eu={uniforms:{tDiffuse:{value:null},resolution:{value:new m.Vector2}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","\tconst mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","\tconst mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","\tfloat tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","\tfloat tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","\tfloat tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","\tfloat tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","\tfloat tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","\tfloat tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","\tfloat tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","\tfloat tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","\tfloat tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","\tfloat valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","\t\tGx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","\t\tGx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","\tfloat valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","\t\tGy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","\t\tGy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","\tfloat G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","\tgl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")},Mu;function Nu(){if(Mu)return Mu;var e=m.ShaderChunk.meshphong_frag.slice(0,m.ShaderChunk.meshphong_frag.indexOf("void main() {")),t=m.ShaderChunk.meshphong_frag.slice(m.ShaderChunk.meshphong_frag.indexOf("void main() {"));return Mu={uniforms:m.UniformsUtils.merge([m.ShaderLib.phong.uniforms,{thicknessMap:{value:null},thicknessColor:{value:new m.Color(16777215)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:"\n #define USE_UV\n ".concat(m.ShaderChunk.meshphong_vert,"\n "),fragmentShader:"\n #define USE_UV',\n #define SUBSURFACE',\n\n ".concat(e,"\n\n uniform sampler2D thicknessMap;\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n \tvec3 thickness = thicknessColor * texture2D(thicknessMap, uv).r;\n \tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n \tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n \tvec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n \treflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n\n ").concat(t.replace("#include ",m.ShaderChunk.lights_fragment_begin.replace(/RE_Direct\( directLight, geometry, material, reflectedLight \);/g,"\n RE_Direct( directLight, geometry, material, reflectedLight );\n\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n ")),"\n ")}}var Wu={get uniforms(){return Nu().uniforms},set uniforms(e){Nu().uniforms=e},get vertexShader(){return Nu().vertexShader},set vertexShader(e){Nu().vertexShader=e},get fragmentShader(){return Nu().vertexShader},set fragmentShader(e){Nu().vertexShader=e}},Fu={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","\tvec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","\tgl_FragColor = newTex;","}"].join("\n")},Vu={uniforms:{uDirLightPos:{value:new m.Vector3},uDirLightColor:{value:new m.Color(15658734)},uAmbientLightColor:{value:new m.Color(328965)},uBaseColor:{value:new m.Color(16777215)}},vertexShader:["varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","\tvNormal = normalize( normalMatrix * normal );","\tvec3 I = worldPosition.xyz - cameraPosition;","\tvRefract = refract( normalize( I ), worldNormal, 1.02 );","\tgl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","varying vec3 vRefract;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tfloat intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );","\tintensity += length(lightWeighting) * 0.2;","\tfloat cameraWeighting = dot( normalize( vNormal ), vRefract );","\tintensity += pow( 1.0 - length( cameraWeighting ), 6.0 );","\tintensity = intensity * 0.2 + 0.3;","\tif ( intensity < 0.50 ) {","\t\tgl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );","\t} else {","\t\tgl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );","}","}"].join("\n")},Tu={uniforms:{uDirLightPos:{value:new m.Vector3},uDirLightColor:{value:new m.Color(15658734)},uAmbientLightColor:{value:new m.Color(328965)},uBaseColor:{value:new m.Color(15658734)},uLineColor1:{value:new m.Color(8421504)},uLineColor2:{value:new m.Color(0)},uLineColor3:{value:new m.Color(0)},uLineColor4:{value:new m.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);","\tfloat light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {","\t\tgl_FragColor *= vec4( uLineColor1, 1.0 );","\t}","\tif ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {","\t\tgl_FragColor *= vec4( uLineColor2, 1.0 );","\t}","}"].join("\n")},Lu={uniforms:{uDirLightPos:{value:new m.Vector3},uDirLightColor:{value:new m.Color(15658734)},uAmbientLightColor:{value:new m.Color(328965)},uBaseColor:{value:new m.Color(16777215)},uLineColor1:{value:new m.Color(0)},uLineColor2:{value:new m.Color(0)},uLineColor3:{value:new m.Color(0)},uLineColor4:{value:new m.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","\tfloat directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","\tvec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","\tgl_FragColor = vec4( uBaseColor, 1.0 );","\tif ( length(lightWeighting) < 1.00 ) {","\t\tif ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.75 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor2, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor3, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.3465 ) {","\t\tif (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {","\t\t\tgl_FragColor = vec4( uLineColor4, 1.0 );","\t}","\t}","}"].join("\n")},Hu={uniforms:{uDirLightPos:{value:new m.Vector3},uDirLightColor:{value:new m.Color(15658734)},uAmbientLightColor:{value:new m.Color(328965)},uBaseColor:{value:new m.Color(16777215)},uLineColor1:{value:new m.Color(0)}},vertexShader:["varying vec3 vNormal;","void main() {","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tvNormal = normalize( normalMatrix * normal );","}"].join("\n"),fragmentShader:["uniform vec3 uBaseColor;","uniform vec3 uLineColor1;","uniform vec3 uLineColor2;","uniform vec3 uLineColor3;","uniform vec3 uLineColor4;","uniform vec3 uDirLightPos;","uniform vec3 uDirLightColor;","uniform vec3 uAmbientLightColor;","varying vec3 vNormal;","void main() {","float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);","vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;","gl_FragColor = vec4( uBaseColor, 1.0 );","if ( length(lightWeighting) < 1.00 ) {","\t\tif ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","\tif ( length(lightWeighting) < 0.50 ) {","\t\tif ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {","\t\t\tgl_FragColor = vec4( uLineColor1, 1.0 );","\t\t}","\t}","}"].join("\n")},Xu={uniforms:{texture:{value:null},delta:{value:new m.Vector2(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","\tvec4 color = vec4( 0.0 );","\tfloat total = 0.0;","\tfloat offset = rand( vUv );","\tfor ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","\t\tfloat percent = ( t + offset - 0.5 ) / ITERATIONS;","\t\tfloat weight = 1.0 - abs( percent );","\t\tcolor += texture2D( texture, vUv + delta * percent ) * weight;","\t\ttotal += weight;","\t}","\tgl_FragColor = color / total;","}"].join("\n")},Yu={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tDiffuse;\n uniform float v;\n\n varying vec2 vUv;\n\n void main() {\n\n vec4 sum = vec4( 0.0 );\n\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n gl_FragColor = sum;\n\n }\n "},_u={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat vv = v * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")},Ku={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","\tgl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")},Uu={uniforms:{u_size:{value:new m.Vector3(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new m.Vector2(1,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:["\t\tvarying vec4 v_nearpos;","\t\tvarying vec4 v_farpos;","\t\tvarying vec3 v_position;","\t\tvoid main() {","\t\t\t\tmat4 viewtransformf = modelViewMatrix;","\t\t\t\tmat4 viewtransformi = inverse(modelViewMatrix);","\t\t\t\tvec4 position4 = vec4(position, 1.0);","\t\t\t\tvec4 pos_in_cam = viewtransformf * position4;","\t\t\t\tpos_in_cam.z = -pos_in_cam.w;","\t\t\t\tv_nearpos = viewtransformi * pos_in_cam;","\t\t\t\tpos_in_cam.z = pos_in_cam.w;","\t\t\t\tv_farpos = viewtransformi * pos_in_cam;","\t\t\t\tv_position = position;","\t\t\t\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;","\t\t}"].join("\n"),fragmentShader:["\t\tprecision highp float;","\t\tprecision mediump sampler3D;","\t\tuniform vec3 u_size;","\t\tuniform int u_renderstyle;","\t\tuniform float u_renderthreshold;","\t\tuniform vec2 u_clim;","\t\tuniform sampler3D u_data;","\t\tuniform sampler2D u_cmdata;","\t\tvarying vec3 v_position;","\t\tvarying vec4 v_nearpos;","\t\tvarying vec4 v_farpos;","\t\tconst int MAX_STEPS = 887;\t// 887 for 512^3, 1774 for 1024^3","\t\tconst int REFINEMENT_STEPS = 4;","\t\tconst float relative_step_size = 1.0;","\t\tconst vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);","\t\tconst vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);","\t\tconst vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);","\t\tconst float shininess = 40.0;","\t\tvoid cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);","\t\tvoid cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);","\t\tfloat sample1(vec3 texcoords);","\t\tvec4 apply_colormap(float val);","\t\tvec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);","\t\tvoid main() {","\t\t\t\tvec3 farpos = v_farpos.xyz / v_farpos.w;","\t\t\t\tvec3 nearpos = v_nearpos.xyz / v_nearpos.w;","\t\t\t\tvec3 view_ray = normalize(nearpos.xyz - farpos.xyz);","\t\t\t\tfloat distance = dot(nearpos - v_position, view_ray);","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.x) / view_ray.x,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.x - 0.5 - v_position.x) / view_ray.x));","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.y) / view_ray.y,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.y - 0.5 - v_position.y) / view_ray.y));","\t\t\t\tdistance = max(distance, min((-0.5 - v_position.z) / view_ray.z,","\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(u_size.z - 0.5 - v_position.z) / view_ray.z));","\t\t\t\tvec3 front = v_position + view_ray * distance;","\t\t\t\tint nsteps = int(-distance / relative_step_size + 0.5);","\t\t\t\tif ( nsteps < 1 )","\t\t\t\t\t\tdiscard;","\t\t\t\tvec3 step = ((v_position - front) / u_size) / float(nsteps);","\t\t\t\tvec3 start_loc = front / u_size;","\t\t\t\tif (u_renderstyle == 0)","\t\t\t\t\t\tcast_mip(start_loc, step, nsteps, view_ray);","\t\t\t\telse if (u_renderstyle == 1)","\t\t\t\t\t\tcast_iso(start_loc, step, nsteps, view_ray);","\t\t\t\tif (gl_FragColor.a < 0.05)","\t\t\t\t\t\tdiscard;","\t\t}","\t\tfloat sample1(vec3 texcoords) {","\t\t\t\t/* Sample float value from a 3D texture. Assumes intensity data. */","\t\t\t\treturn texture(u_data, texcoords.xyz).r;","\t\t}","\t\tvec4 apply_colormap(float val) {","\t\t\t\tval = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);","\t\t\t\treturn texture2D(u_cmdata, vec2(val, 0.5));","\t\t}","\t\tvoid cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {","\t\t\t\tfloat max_val = -1e6;","\t\t\t\tint max_i = 100;","\t\t\t\tvec3 loc = start_loc;","\t\t\t\tfor (int iter=0; iter = nsteps)","\t\t\t\t\t\t\t\tbreak;","\t\t\t\t\t\tfloat val = sample1(loc);","\t\t\t\t\t\tif (val > max_val) {","\t\t\t\t\t\t\t\tmax_val = val;","\t\t\t\t\t\t\t\tmax_i = iter;","\t\t\t\t\t\t}","\t\t\t\t\t\tloc += step;","\t\t\t\t}","\t\t\t\tvec3 iloc = start_loc + step * (float(max_i) - 0.5);","\t\t\t\tvec3 istep = step / float(REFINEMENT_STEPS);","\t\t\t\tfor (int i=0; i = nsteps)","\t\t\t\t\t\t\t\tbreak;","\t\t\t\t\t\tfloat val = sample1(loc);","\t\t\t\t\t\tif (val > low_threshold) {","\t\t\t\t\t\t\t\tvec3 iloc = loc - 0.5 * step;","\t\t\t\t\t\t\t\tvec3 istep = step / float(REFINEMENT_STEPS);","\t\t\t\t\t\t\t\tfor (int i=0; i u_renderthreshold) {","\t\t\t\t\t\t\t\t\t\t\t\tgl_FragColor = add_lighting(val, iloc, dstep, view_ray);","\t\t\t\t\t\t\t\t\t\t\t\treturn;","\t\t\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t\t\t\t\tiloc += istep;","\t\t\t\t\t\t\t\t}","\t\t\t\t\t\t}","\t\t\t\t\t\tloc += step;","\t\t\t\t}","\t\t}","\t\tvec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)","\t\t{","\t\t\t\tvec3 V = normalize(view_ray);","\t\t\t\tvec3 N;","\t\t\t\tfloat val1, val2;","\t\t\t\tval1 = sample1(loc + vec3(-step[0], 0.0, 0.0));","\t\t\t\tval2 = sample1(loc + vec3(+step[0], 0.0, 0.0));","\t\t\t\tN[0] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tval1 = sample1(loc + vec3(0.0, -step[1], 0.0));","\t\t\t\tval2 = sample1(loc + vec3(0.0, +step[1], 0.0));","\t\t\t\tN[1] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tval1 = sample1(loc + vec3(0.0, 0.0, -step[2]));","\t\t\t\tval2 = sample1(loc + vec3(0.0, 0.0, +step[2]));","\t\t\t\tN[2] = val1 - val2;","\t\t\t\tval = max(max(val1, val2), val);","\t\t\t\tfloat gm = length(N); // gradient magnitude","\t\t\t\tN = normalize(N);","\t\t\t\tfloat Nselect = float(dot(N, V) > 0.0);","\t\t\t\tN = (2.0 * Nselect - 1.0) * N;\t// ==\tNselect * N - (1.0-Nselect)*N;","\t\t\t\tvec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tvec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tvec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);","\t\t\t\tfor (int i=0; i<1; i++)","\t\t\t\t{","\t\t\t\t\t\tvec3 L = normalize(view_ray);\t//lightDirs[i];","\t\t\t\t\t\tfloat lightEnabled = float( length(L) > 0.0 );","\t\t\t\t\t\tL = normalize(L + (1.0 - lightEnabled));","\t\t\t\t\t\tfloat lambertTerm = clamp(dot(N, L), 0.0, 1.0);","\t\t\t\t\t\tvec3 H = normalize(L+V); // Halfway vector","\t\t\t\t\t\tfloat specularTerm = pow(max(dot(H, N), 0.0), shininess);","\t\t\t\t\t\tfloat mask1 = lightEnabled;","\t\t\t\t\t\tambient_color +=\tmask1 * ambient_color;\t// * gl_LightSource[i].ambient;","\t\t\t\t\t\tdiffuse_color +=\tmask1 * lambertTerm;","\t\t\t\t\t\tspecular_color += mask1 * specularTerm * specular_color;","\t\t\t\t}","\t\t\t\tvec4 final_color;","\t\t\t\tvec4 color = apply_colormap(val);","\t\t\t\tfinal_color = color * (ambient_color + diffuse_color) + specular_color;","\t\t\t\tfinal_color.a = color.a;","\t\t\t\treturn final_color;","\t\t}"].join("\n")},zu={uniforms:{color:{value:null},time:{value:0},tDiffuse:{value:null},tDudv:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")},Du=null,Pu=null,Qu=new WeakMap;function Ou(e){var t=document.createRange(),n=new Color;function r(e,t,n,r){""!==r&&("uppercase"===e.textTransform&&(r=r.toUpperCase()),l.font=e.fontWeight+" "+e.fontSize+" "+e.fontFamily,l.textBaseline="top",l.fillStyle=e.color,l.fillText(r,t,n+.1*parseFloat(e.fontSize)))}function i(e,t,n,r,i){n<2*i&&(i=n/2),r<2*i&&(i=r/2),l.beginPath(),l.moveTo(e+i,t),l.arcTo(e+n,t,e+n,t+r,i),l.arcTo(e+n,t+r,e,t+r,i),l.arcTo(e,t+r,e,t,i),l.arcTo(e,t,e+n,t,i),l.closePath()}function a(e,t,n,r,i,a){var o=e[t+"Width"],s=e[t+"Style"],u=e[t+"Color"];"0px"!==o&&"none"!==s&&"transparent"!==u&&"rgba(0, 0, 0, 0)"!==u&&(l.strokeStyle=u,l.lineWidth=parseFloat(o),l.beginPath(),l.moveTo(n,r),l.lineTo(n+i,r+a),l.stroke())}var o=e.getBoundingClientRect(),s=Qu.get(e);void 0===s&&((s=document.createElement("canvas")).width=o.width,s.height=o.height,Qu.set(e,s));var l=s.getContext("2d"),u=new function(e){var t=[],n=!1;function r(){if(n&&(n=!1,e.restore()),0!==t.length){for(var r=-1/0,i=-1/0,a=1/0,o=1/0,s=0;s o.left&&n o.top&&r 0){var t=(e-h)/1e3;o.stepSimulation(t,10)}h=e;for(var n=0,r=u.length;n 2&&void 0!==arguments[2]?arguments[2]:0;if(e.isInstancedMesh){var i=g.get(e)[r];i.setAngularVelocity(new t.btVector3(0,0,0)),i.setLinearVelocity(new t.btVector3(0,0,0)),s.setIdentity(),s.setOrigin(new t.btVector3(n.x,n.y,n.z)),i.setWorldTransform(s)}else if(e.isMesh){var a=g.get(e);a.setAngularVelocity(new t.btVector3(0,0,0)),a.setLinearVelocity(new t.btVector3(0,0,0)),s.setIdentity(),s.setOrigin(new t.btVector3(n.x,n.y,n.z)),a.setWorldTransform(s)}},A=function(e,n,r){for(var i=e.instanceMatrix.array,a=[],s=0;s 0&&(e.instanceMatrix.setUsage(35048),u.push(e),g.set(e,a))},d=function(e,n,r){var i=e.position,a=e.quaternion,s=new t.btTransform;s.setIdentity(),s.setOrigin(new t.btVector3(i.x,i.y,i.z)),s.setRotation(new t.btQuaternion(a.x,a.y,a.z,a.w));var l=new t.btDefaultMotionState(s),c=new t.btVector3(0,0,0);r.calculateLocalInertia(n,c);var d=new t.btRigidBodyConstructionInfo(n,l,r,c),A=new t.btRigidBody(d);o.addRigidBody(A),n>0&&(u.push(e),g.set(e,A))},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=l(e.geometry);null!==n&&(e.isInstancedMesh?A(e,t,n):e.isMesh&&d(e,t,n))},l=function(e){var n=e.parameters;if("BoxGeometry"===e.type){var r=void 0!==n.width?n.width/2:.5,i=void 0!==n.height?n.height/2:.5,a=void 0!==n.depth?n.depth/2:.5,o=new t.btBoxShape(new t.btVector3(r,i,a));return o.setMargin(.05),o}if("SphereGeometry"===e.type||"IcosahedronGeometry"===e.type){var s=void 0!==n.radius?n.radius:1,l=new t.btSphereShape(s);return l.setMargin(.05),l}return null},"Ammo"in window!==!1){e.next=9;break}return console.error("AmmoPhysics: Couldn't find Ammo.js"),e.abrupt("return");case 9:return e.next=11,Ammo();case 11:return t=e.sent,60,n=new t.btDefaultCollisionConfiguration,r=new t.btCollisionDispatcher(n),i=new t.btDbvtBroadphase,a=new t.btSequentialImpulseConstraintSolver,(o=new t.btDiscreteDynamicsWorld(r,i,a,n)).setGravity(new t.btVector3(0,-9.8,0)),s=new t.btTransform,u=[],g=new WeakMap,h=0,setInterval(C,1e3/60),e.abrupt("return",{addMesh:c,setMeshPosition:I});case 25:case"end":return e.stop()}}),e)}))),pg.apply(this,arguments)}function mg(e,t,n,r){var i=t.x(),a=t.y(),o=t.z(),s=t.w(),l=i+i,u=a+a,g=o+o,c=i*l,d=i*u,A=i*g,I=a*u,h=a*g,C=o*g,f=s*l,p=s*u,m=s*g;n[r+0]=1-(I+C),n[r+1]=d+m,n[r+2]=A-p,n[r+3]=0,n[r+4]=d-m,n[r+5]=1-(c+C),n[r+6]=h+f,n[r+7]=0,n[r+8]=A+p,n[r+9]=h-f,n[r+10]=1-(c+I),n[r+11]=0,n[r+12]=e.x(),n[r+13]=e.y(),n[r+14]=e.z(),n[r+15]=1}var vg=null,yg=null,bg=null,Bg=null,Gg=null,wg=null;function Zg(e,t,n){var r=n.length-e-1;if(t>=n[r])return r-1;if(t<=n[e])return e;for(var i=e,a=r,o=Math.floor((i+a)/2);t =n[o+1];)t =w&&(B[b][0]=B[y][0]/u[x+1][S],Z=B[b][0]*u[S][x]);for(var R=v-1<=x?w-1:n-v,k=S>=-1?1:-S;k<=R;++k)B[b][k]=(B[y][k]-B[y][k-1])/u[x+1][S+k],Z+=B[b][k]*u[S+k][x];v<=x&&(B[b][w]=-B[y][w-1]/u[x+1][v],Z+=B[b][w]*u[v][x]),s[w][v]=Z;var E=y;y=b,b=E}}for(var M=n,N=1;N<=r;++N){for(var W=0;W<=n;++W)s[N][W]*=M;M*=n-N}return s}function kg(e,t,n,r,i){for(var a=i =21&&t===ic(e,0,21)}function Qg(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],n=0;function r(t){var r=e[t-1];return e=e.slice(n+t),n++,r}for(var i=0;i 1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2?arguments[2]:void 0,r=[],i=(0,l.Z)({letterSpacing:0,lineHeight:1},n),a=gc(e,t,this.data,i),o=0,s=a.length;o 0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return(0,h.Z)(this,n),(e=t.call(this,null)).isData3DTexture=!0,e.image={data:r,width:i,height:a,depth:o},e.magFilter=m.NearestFilter,e.minFilter=m.NearestFilter,e.wrapR=m.ClampToEdgeWrapping,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return(0,C.Z)(n)}(m.Texture),Ic=null,hc=null,Cc={type:function(e){switch(e){case"uchar":case"unsigned char":case"uint8":case"uint8_t":this.__array=Uint8Array;break;case"signed char":case"int8":case"int8_t":this.__array=Int8Array;break;case"short":case"short int":case"signed short":case"signed short int":case"int16":case"int16_t":this.__array=Int16Array;break;case"ushort":case"unsigned short":case"unsigned short int":case"uint16":case"uint16_t":this.__array=Uint16Array;break;case"int":case"signed int":case"int32":case"int32_t":this.__array=Int32Array;break;case"uint":case"unsigned int":case"uint32":case"uint32_t":this.__array=Uint32Array;break;case"float":this.__array=Float32Array;break;case"double":this.__array=Float64Array;break;default:throw new Error("Unsupported NRRD data type: "+e)}return this.type=e},endian:function(e){return this.endian=e},encoding:function(e){return this.encoding=e},dimension:function(e){return this.dim=parseInt(e,10)},sizes:function(e){var t;return this.sizes=function(){for(var n=e.split(/\s+/),r=[],i=0,a=n.length;i0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:U),he=Ie;function Ce(e,t){for(var n=-1,r=null==e?0:e.length;++n-1}var ye=9007199254740991,be=/^(?:0|[1-9]\d*)$/;function Be(e,t){var n=typeof e;return!!(t=null==t?ye:t)&&("number"==n||"symbol"!=n&&be.test(e))&&e>-1&&e%1==0&&e -1&&e%1==0&&e<=Ee}function Ne(e){return null!=e&&Me(e.length)&&!O(e)}function We(e,t,n){if(!W(n))return!1;var r=typeof t;return!!("number"==r?Ne(n)&&Be(t,n.length):"string"==r&&t in n)&&we(n[t],e)}var Fe=Object.prototype;function Ve(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fe)}function Te(e){return b(e)&&"[object Arguments]"==y(e)}var Le=Object.prototype,He=Le.hasOwnProperty,Xe=Le.propertyIsEnumerable,Ye=Te(function(){return arguments}())?Te:function(e){return b(e)&&He.call(e,"callee")&&!Xe.call(e,"callee")},_e=Ye;var Ke="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ue=Ke&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Ue&&Ue.exports===Ke?n.Buffer:void 0,De=(ze?ze.isBuffer:void 0)||function(){return!1},Pe={};function Qe(e){return function(t){return e(t)}}Pe["[object Float32Array]"]=Pe["[object Float64Array]"]=Pe["[object Int8Array]"]=Pe["[object Int16Array]"]=Pe["[object Int32Array]"]=Pe["[object Uint8Array]"]=Pe["[object Uint8ClampedArray]"]=Pe["[object Uint16Array]"]=Pe["[object Uint32Array]"]=!0,Pe["[object Arguments]"]=Pe["[object Array]"]=Pe["[object ArrayBuffer]"]=Pe["[object Boolean]"]=Pe["[object DataView]"]=Pe["[object Date]"]=Pe["[object Error]"]=Pe["[object Function]"]=Pe["[object Map]"]=Pe["[object Number]"]=Pe["[object Object]"]=Pe["[object RegExp]"]=Pe["[object Set]"]=Pe["[object String]"]=Pe["[object WeakMap]"]=!1;var Oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Je=Oe&&"object"==typeof module&&module&&!module.nodeType&&module,je=Je&&Je.exports===Oe&&e.process,qe=function(){try{var e=Je&&Je.require&&Je.require("util").types;return e||je&&je.binding&&je.binding("util")}catch(t){}}(),$e=qe&&qe.isTypedArray,et=$e?Qe($e):function(e){return b(e)&&Me(e.length)&&!!Pe[y(e)]},tt=Object.prototype.hasOwnProperty;function nt(e,t){var n=Z(e),r=!n&&_e(e),i=!n&&!r&&De(e),a=!n&&!r&&!i&&et(e),o=n||r||i||a,s=o?function(e,t){for(var n=-1,r=Array(e);++n 1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(i=lt.length>3&&"function"==typeof i?(r--,i):void 0,a&&We(t[0],t[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++n -1},Bt.prototype.set=function(e,t){var n=this.__data__,r=yt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Gt=se(n,"Map");function wt(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t 0&&n(s)?t>1?Ht(s,t-1,n,r,i):Vt(i,s):r||(i[i.length]=s)}return i}function Xt(e){return(null==e?0:e.length)?Ht(e,1):[]}var Yt=rt(Object.getPrototypeOf,Object);function _t(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var u=a.get(e),g=a.get(t);if(u&&g)return u==t&&g==e;var c=-1,d=!0,A=n&dr?new lr:void 0;for(a.set(e,t),a.set(t,e);++c 2?t[2]:void 0;for(i&&We(t[0],t[1],i)&&(r=1);++n=200&&(a=gr,o=!1,t=new lr(t));e:for(;++i -1?r[i?e[a]:a]:void 0});function bi(e){return e&&e.length?e[0]:void 0}function Bi(e,t){var n=-1,r=Ne(e)?Array(e.length):[];return ni(e,(function(e,i,a){r[++n]=t(e,i,a)})),r}function Gi(e,t){return(Z(e)?w:Bi)(e,jr(t))}function wi(e,t){return Ht(Gi(e,t),1)}var Zi,Si,xi=Object.prototype.hasOwnProperty,Ri=(Zi=function(e,t,n){xi.call(e,n)?e[n].push(t):Ge(e,n,[t])},function(e,t){var n=Z(e)?qr:ri,r=Si?Si():{};return n(e,Zi,jr(t),r)}),ki=Object.prototype.hasOwnProperty;function Ei(e,t){return null!=e&&ki.call(e,t)}function Mi(e,t){return null!=e&&Dr(e,t,Ei)}var Ni="[object String]";function Wi(e){return"string"==typeof e||!Z(e)&&b(e)&&y(e)==Ni}function Fi(e){return null==e?[]:function(e,t){return w(t,(function(t){return e[t]}))}(e,st(e))}var Vi=Math.max;function Ti(e,t,n,r){e=Ne(e)?e:Fi(e),n=n&&!r?K(n):0;var i=e.length;return n<0&&(n=Vi(i+n,0)),Wi(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&me(e,t,n)>-1}var Li=Math.max;function Hi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:K(n);return i<0&&(i=Li(r+i,0)),me(e,t,i)}var Xi="[object Map]",Yi="[object Set]",_i=Object.prototype.hasOwnProperty;function Ki(e){if(null==e)return!0;if(Ne(e)&&(Z(e)||"string"==typeof e||"function"==typeof e.splice||De(e)||et(e)||_e(e)))return!e.length;var t=mn(e);if(t==Xi||t==Yi)return!e.size;if(Ve(e))return!ot(e).length;for(var n in e)if(_i.call(e,n))return!1;return!0}var Ui=qe&&qe.isRegExp,zi=Ui?Qe(Ui):function(e){return b(e)&&"[object RegExp]"==y(e)};function Di(e){return void 0===e}var Pi="Expected a function";function Qi(e,t,n,r){if(!W(e))return e;for(var i=-1,a=(t=Mt(t,e)).length,o=a-1,s=e;null!=s&&++i=na){var u=t?null:ta(e);if(u)return hr(u);o=!1,i=gr,l=new lr}else l=t?[]:s;e:for(;++r1&&void 0!==arguments[1]?arguments[1]:[];return!!(e instanceof Aa||e instanceof Ca||e instanceof fa)||(e instanceof pa?ea(e.definition,(function(e){return ba(e,t)})):!(e instanceof ga&&Ti(t,e))&&(e instanceof ua&&(e instanceof ga&&t.push(e),Ci(e.definition,(function(e){return ba(e,t)})))))}function Ba(e){if(e instanceof ga)return"SUBRULE";if(e instanceof Aa)return"OPTION";if(e instanceof pa)return"OR";if(e instanceof Ia)return"AT_LEAST_ONE";if(e instanceof ha)return"AT_LEAST_ONE_SEP";if(e instanceof fa)return"MANY_SEP";if(e instanceof Ca)return"MANY";if(e instanceof ma)return"CONSUME";throw Error("non exhaustive match")}var Ga=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"walk",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Ai(e.definition,(function(r,i){var a=ci(e.definition,i+1);if(r instanceof ga)t.walkProdRef(r,a,n);else if(r instanceof ma)t.walkTerminal(r,a,n);else if(r instanceof da)t.walkFlat(r,a,n);else if(r instanceof Aa)t.walkOption(r,a,n);else if(r instanceof Ia)t.walkAtLeastOne(r,a,n);else if(r instanceof ha)t.walkAtLeastOneSep(r,a,n);else if(r instanceof fa)t.walkManySep(r,a,n);else if(r instanceof Ca)t.walkMany(r,a,n);else{if(!(r instanceof pa))throw Error("non exhaustive match");t.walkOr(r,a,n)}}))}},{key:"walkTerminal",value:function(e,t,n){}},{key:"walkProdRef",value:function(e,t,n){}},{key:"walkFlat",value:function(e,t,n){var r=t.concat(n);this.walk(e,r)}},{key:"walkOption",value:function(e,t,n){var r=t.concat(n);this.walk(e,r)}},{key:"walkAtLeastOne",value:function(e,t,n){var r=[new Aa({definition:e.definition})].concat(t,n);this.walk(e,r)}},{key:"walkAtLeastOneSep",value:function(e,t,n){var r=wa(e,t,n);this.walk(e,r)}},{key:"walkMany",value:function(e,t,n){var r=[new Aa({definition:e.definition})].concat(t,n);this.walk(e,r)}},{key:"walkManySep",value:function(e,t,n){var r=wa(e,t,n);this.walk(e,r)}},{key:"walkOr",value:function(e,t,n){var r=this,i=t.concat(n);Ai(e.definition,(function(e){var t=new da({definition:[e]});r.walk(t,i)}))}}]),e}();function wa(e,t,n){return[new Aa({definition:[new ma({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Za(e){if(e instanceof ga)return Za(e.referencedRule);if(e instanceof ma)return[e.terminalType];if(function(e){return e instanceof da||e instanceof Aa||e instanceof Ca||e instanceof Ia||e instanceof ha||e instanceof fa||e instanceof ma||e instanceof ca}(e))return function(e){var t,n=[],r=e.definition,i=0,a=r.length>i,o=!0;for(;a&&o;)o=ba(t=r[i]),n=n.concat(Za(t)),i+=1,a=r.length>i;return ra(n)}(e);if(function(e){return e instanceof pa}(e))return function(e){var t=Gi(e.definition,(function(e){return Za(e)}));return ra(Xt(t))}(e);throw Error("non exhaustive match")}var Sa="_~IN~_",xa=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,h.Z)(this,n),(r=t.call(this)).topProd=e,r.follows={},r}return(0,C.Z)(n,[{key:"startWalking",value:function(){return this.walk(this.topProd),this.follows}},{key:"walkTerminal",value:function(e,t,n){}},{key:"walkProdRef",value:function(e,t,n){var r,i,a=(r=e.referencedRule,i=e.idx,r.name+i+Sa+this.topProd.name),o=t.concat(n),s=Za(new da({definition:o}));this.follows[a]=s}}]),n}(Ga);function Ra(e){return e.charCodeAt(0)}function ka(e,t){Array.isArray(e)?e.forEach((function(e){t.push(e)})):t.push(e)}function Ea(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t],e[t]=!0}function Ma(e){if(void 0===e)throw Error("Internal Error - Should never get here!");return!0}function Na(e){return"Character"===e.type}for(var Wa=[],Fa=Ra("0");Fa<=Ra("9");Fa++)Wa.push(Fa);for(var Va=[Ra("_")].concat(Wa),Ta=Ra("a");Ta<=Ra("z");Ta++)Va.push(Ta);for(var La=Ra("A");La<=Ra("Z");La++)Va.push(La);var Ha=[Ra(" "),Ra("\f"),Ra("\n"),Ra("\r"),Ra("\t"),Ra("\v"),Ra("\t"),Ra("\xa0"),Ra("\u1680"),Ra("\u2000"),Ra("\u2001"),Ra("\u2002"),Ra("\u2003"),Ra("\u2004"),Ra("\u2005"),Ra("\u2006"),Ra("\u2007"),Ra("\u2008"),Ra("\u2009"),Ra("\u200a"),Ra("\u2028"),Ra("\u2029"),Ra("\u202f"),Ra("\u205f"),Ra("\u3000"),Ra("\ufeff")],Xa=/[0-9a-fA-F]/,Ya=/[0-9]/,_a=/[1-9]/,Ka=function(){function e(){(0,h.Z)(this,e),this.idx=0,this.input="",this.groupIdx=0}return(0,C.Z)(e,[{key:"saveState",value:function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}},{key:"restoreState",value:function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}},{key:"pattern",value:function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");for(var n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":Ea(n,"global");break;case"i":Ea(n,"ignoreCase");break;case"m":Ea(n,"multiLine");break;case"u":Ea(n,"unicode");break;case"y":Ea(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}},{key:"disjunction",value:function(){var e=[],t=this.idx;for(e.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}},{key:"alternative",value:function(){for(var e=[],t=this.idx;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}},{key:"term",value:function(){return this.isAssertion()?this.assertion():this.atom()}},{key:"assertion",value:function(){var e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}Ma(t);var n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return function(){throw Error("Internal Error - Should never get here!")}()}},{key:"quantifier",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=void 0,n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var r=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:r,atMost:r};break;case",":t=this.isDigit()?{atLeast:r,atMost:this.integerIncludingZero()}:{atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===e&&void 0===t)return;Ma(t)}if(!0!==e||void 0!==t)return Ma(t)?("?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t):void 0}},{key:"atom",value:function(){var e,t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}if(void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ma(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}},{key:"dotAll",value:function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Ra("\n"),Ra("\r"),Ra("\u2028"),Ra("\u2029")]}}},{key:"atomEscape",value:function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}},{key:"decimalEscapeAtom",value:function(){return{type:"GroupBackReference",value:this.positiveInteger()}}},{key:"characterClassEscape",value:function(){var e,t=!1;switch(this.popChar()){case"d":e=Wa;break;case"D":e=Wa,t=!0;break;case"s":e=Ha;break;case"S":e=Ha,t=!0;break;case"w":e=Va;break;case"W":e=Va,t=!0}if(Ma(e))return{type:"Set",value:e,complement:t}}},{key:"controlEscapeAtom",value:function(){var e;switch(this.popChar()){case"f":e=Ra("\f");break;case"n":e=Ra("\n");break;case"r":e=Ra("\r");break;case"t":e=Ra("\t");break;case"v":e=Ra("\v")}if(Ma(e))return{type:"Character",value:e}}},{key:"controlLetterEscapeAtom",value:function(){this.consumeChar("c");var e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}},{key:"nulCharacterAtom",value:function(){return this.consumeChar("0"),{type:"Character",value:Ra("\0")}}},{key:"hexEscapeSequenceAtom",value:function(){return this.consumeChar("x"),this.parseHexDigits(2)}},{key:"regExpUnicodeEscapeSequenceAtom",value:function(){return this.consumeChar("u"),this.parseHexDigits(4)}},{key:"identityEscapeAtom",value:function(){return{type:"Character",value:Ra(this.popChar())}}},{key:"classPatternCharacterAtom",value:function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:Ra(this.popChar())}}}},{key:"characterClass",value:function(){var e=[],t=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);this.isClassAtom();){var n=this.classAtom();if(n.type,Na(n)&&this.isRangeDash()){this.consumeChar("-");var r=this.classAtom();if(r.type,Na(r)){if(r.value0&&void 0!==arguments[0]?arguments[0]:0;switch(this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}},{key:"isTerm",value:function(){return this.isAtom()||this.isAssertion()}},{key:"isAtom",value:function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}},{key:"isAssertion",value:function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}}},{key:"isQuantifier",value:function(){var e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(e)}}},{key:"isPatternCharacter",value:function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}},{key:"parseHexDigits",value:function(e){for(var t="",n=0;n 0&&void 0!==arguments[0]?arguments[0]:0;return this.input[this.idx+e]}},{key:"popChar",value:function(){var e=this.peekChar(0);return this.consumeChar(void 0),e}},{key:"consumeChar",value:function(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}},{key:"loc",value:function(e){return{begin:e,end:this.idx}}}]),e}(),Ua=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"visitChildren",value:function(e){var t=this;for(var n in e){var r=e[n];e.hasOwnProperty(n)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach((function(e){t.visit(e)}),this))}}},{key:"visit",value:function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}},{key:"visitPattern",value:function(e){}},{key:"visitFlags",value:function(e){}},{key:"visitDisjunction",value:function(e){}},{key:"visitAlternative",value:function(e){}},{key:"visitStartAnchor",value:function(e){}},{key:"visitEndAnchor",value:function(e){}},{key:"visitWordBoundary",value:function(e){}},{key:"visitNonWordBoundary",value:function(e){}},{key:"visitLookahead",value:function(e){}},{key:"visitNegativeLookahead",value:function(e){}},{key:"visitCharacter",value:function(e){}},{key:"visitSet",value:function(e){}},{key:"visitGroup",value:function(e){}},{key:"visitGroupBackReference",value:function(e){}},{key:"visitQuantifier",value:function(e){}}]),e}(),za={},Da=new Ka;function Pa(e){var t=e.toString();if(za.hasOwnProperty(t))return za[t];var n=Da.pattern(t);return za[t]=n,n}var Qa="Complement Sets are not supported for first char optimization",Oa='Unable to use "first char" lexer optimizations:\n';function Ja(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{var n=Pa(e);return ja(n.value,{},n.flags.ignoreCase)}catch(i){if(i.message===Qa)t&&aa("".concat(Oa,"\tUnable to optimize: < ").concat(e.toString()," >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details."));else{var r="";t&&(r="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),ia("".concat(Oa,"\n\tFailed parsing: < ").concat(e.toString()," >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues")+r)}}return[]}function ja(e,t,n){switch(e.type){case"Disjunction":for(var r=0;r =yo)for(var o=r.from>=yo?r.from:yo,s=r.to,l=Bo(o),u=Bo(s),g=l;g<=u;g++)t[g]=g}}}));break;case"Group":ja(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}var l=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===eo(s)||"Group"!==s.type&&!1===l)break}break;default:throw Error("non exhaustive match!")}return Fi(t)}function qa(e,t,n){var r=Bo(e);t[r]=r,!0===n&&function(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){var i=Bo(r.charCodeAt(0));t[i]=i}else{var a=n.toLowerCase();if(a!==n){var o=Bo(a.charCodeAt(0));t[o]=o}}}(e,t)}function $a(e,t){return yi(e.value,(function(e){if("number"===typeof e)return Ti(t,e);var n=e;return void 0!==yi(t,(function(e){return n.from<=e&&e<=n.to}))}))}function eo(e){var t=e.quantifier;return!(!t||0!==t.atLeast)||!!e.value&&(Z(e.value)?Ci(e.value,eo):eo(e.value))}var to=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,h.Z)(this,n),(r=t.call(this)).targetCharCodes=e,r.found=!1,r}return(0,C.Z)(n,[{key:"visitChildren",value:function(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}(0,A.Z)((0,I.Z)(n.prototype),"visitChildren",this).call(this,e)}}},{key:"visitCharacter",value:function(e){Ti(this.targetCharCodes,e.value)&&(this.found=!0)}},{key:"visitSet",value:function(e){e.complement?void 0===$a(e,this.targetCharCodes)&&(this.found=!0):void 0!==$a(e,this.targetCharCodes)&&(this.found=!0)}}]),n}(Ua);function no(e,t){if(t instanceof RegExp){var n=Pa(t),r=new to(e);return r.visit(n),r.found}return void 0!==yi(t,(function(t){return Ti(e,t.charCodeAt(0))}))}var ro="PATTERN",io="defaultMode",ao="modes",oo="boolean"===typeof new RegExp("(?:)").sticky;function so(e,t){var n,r=(t=oi(t,{useSticky:oo,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;r("initCharCodeToOptimizedIndexMap",(function(){!function(){if(Ki(bo)){bo=new Array(65536);for(var e=0;e<65536;e++)bo[e]=e>255?255+~~(e/255):e}}()})),r("Reject Lexer.NA",(function(){n=qi(e,(function(e){return e[ro]===Vo.NA}))}));var i,a,o,s,l,u,g,c,d,A,I,h=!1;r("Transform Patterns",(function(){h=!1,i=Gi(n,(function(e){var n=e[ro];if(zi(n)){var r=n.source;return 1!==r.length||"^"===r||"$"===r||"."===r||n.ignoreCase?2!==r.length||"\\"!==r[0]||Ti(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?t.useSticky?Ao(n):co(n):r[1]:r}if(O(n))return h=!0,{exec:n};if("object"===typeof n)return h=!0,n;if("string"===typeof n){if(1===n.length)return n;var i=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),a=new RegExp(i);return t.useSticky?Ao(a):co(a)}throw Error("non exhaustive match")}))})),r("misc mapping",(function(){a=Gi(n,(function(e){return e.tokenTypeIdx})),o=Gi(n,(function(e){var t=e.GROUP;if(t!==Vo.SKIPPED){if(Wi(t))return t;if(Di(t))return!1;throw Error("non exhaustive match")}})),s=Gi(n,(function(e){var t=e.LONGER_ALT;if(t)return Z(t)?Gi(t,(function(e){return Hi(n,e)})):[Hi(n,t)]})),l=Gi(n,(function(e){return e.PUSH_MODE})),u=Gi(n,(function(e){return Mi(e,"POP_MODE")}))})),r("Line Terminator Handling",(function(){var e=mo(t.lineTerminatorCharacters);g=Gi(n,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(g=Gi(n,(function(t){return Mi(t,"LINE_BREAKS")?!!t.LINE_BREAKS:!1===po(t,e)&&no(e,t.PATTERN)})))})),r("Misc Mapping #2",(function(){c=Gi(n,ho),d=Gi(i,Co),A=ji(n,(function(e,t){var n=t.GROUP;return Wi(n)&&n!==Vo.SKIPPED&&(e[n]=[]),e}),{}),I=Gi(i,(function(e,t){return{pattern:i[t],longerAlt:s[t],canLineTerminator:g[t],isCustom:c[t],short:d[t],group:o[t],push:l[t],pop:u[t],tokenTypeIdx:a[t],tokenType:n[t]}}))}));var C=!0,f=[];return t.safeMode||r("First Char Optimization",(function(){f=ji(n,(function(e,n,r){if("string"===typeof n.PATTERN){var i=Bo(n.PATTERN.charCodeAt(0));vo(e,i,I[r])}else if(Z(n.START_CHARS_HINT)){var a;Ai(n.START_CHARS_HINT,(function(t){var n=Bo("string"===typeof t?t.charCodeAt(0):t);a!==n&&(a=n,vo(e,n,I[r]))}))}else if(zi(n.PATTERN))if(n.PATTERN.unicode)C=!1,t.ensureOptimizations&&ia("".concat(Oa,"\tUnable to analyze < ").concat(n.PATTERN.toString()," > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE"));else{var o=Ja(n.PATTERN,t.ensureOptimizations);Ki(o)&&(C=!1),Ai(o,(function(t){vo(e,t,I[r])}))}else t.ensureOptimizations&&ia("".concat(Oa,"\tTokenType: <").concat(n.name,"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE")),C=!1;return e}),[])})),{emptyGroups:A,patternIdxToConfig:I,charCodeToPatternIdxToConfig:f,hasCustom:h,canBeOptimized:C}}function lo(e,t){var n=[],r=function(e){var t=pi(e,(function(e){return!Mi(e,ro)})),n=Gi(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:No.MISSING_PATTERN,tokenTypes:[e]}})),r=ui(e,t);return{errors:n,valid:r}}(e);n=n.concat(r.errors);var i=function(e){var t=pi(e,(function(e){var t=e[ro];return!zi(t)&&!O(t)&&!Mi(t,"exec")&&!Wi(t)})),n=Gi(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:No.INVALID_PATTERN,tokenTypes:[e]}})),r=ui(e,t);return{errors:n,valid:r}}(r.valid),a=i.valid;return n=(n=n.concat(i.errors)).concat(function(e){var t=[],n=pi(e,(function(e){return zi(e[ro])}));return t=t.concat(function(e){var t=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,h.Z)(this,n),(e=t.apply(this,arguments)).found=!1,e}return(0,C.Z)(n,[{key:"visitEndAnchor",value:function(e){this.found=!0}}]),n}(Ua),n=pi(e,(function(e){var n=e.PATTERN;try{var r=Pa(n),i=new t;return i.visit(r),i.found}catch(a){return uo.test(n.source)}})),r=Gi(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:No.EOI_ANCHOR_FOUND,tokenTypes:[e]}}));return r}(n)),t=t.concat(function(e){var t=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,h.Z)(this,n),(e=t.apply(this,arguments)).found=!1,e}return(0,C.Z)(n,[{key:"visitStartAnchor",value:function(e){this.found=!0}}]),n}(Ua),n=pi(e,(function(e){var n=e.PATTERN;try{var r=Pa(n),i=new t;return i.visit(r),i.found}catch(a){return go.test(n.source)}})),r=Gi(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:No.SOI_ANCHOR_FOUND,tokenTypes:[e]}}));return r}(n)),t=t.concat(function(e){var t=pi(e,(function(e){var t=e[ro];return t instanceof RegExp&&(t.multiline||t.global)})),n=Gi(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:No.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}));return n}(n)),t=t.concat(function(e){var t=[],n=Gi(e,(function(n){return ji(e,(function(e,r){return n.PATTERN.source!==r.PATTERN.source||Ti(t,r)||r.PATTERN===Vo.NA||(t.push(r),e.push(r)),e}),[])})),r=Gi(pi(n=sr(n),(function(e){return e.length>1})),(function(e){var t=Gi(e,(function(e){return e.name})),n=bi(e).PATTERN;return{message:"The same RegExp pattern ->".concat(n,"<-has been used in all of the following Token Types: ").concat(t.join(", ")," <-"),type:No.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return r}(n)),t=t.concat(function(e){var t=pi(e,(function(e){return e.PATTERN.test("")})),n=Gi(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:No.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}));return n}(n)),t}(a)),n=n.concat(function(e){var t=pi(e,(function(e){if(!Mi(e,"GROUP"))return!1;var t=e.GROUP;return t!==Vo.SKIPPED&&t!==Vo.NA&&!Wi(t)})),n=Gi(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:No.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}));return n}(a)),n=n.concat(function(e,t){var n=pi(e,(function(e){return void 0!==e.PUSH_MODE&&!Ti(t,e.PUSH_MODE)})),r=Gi(n,(function(e){return{message:"Token Type: ->".concat(e.name,"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->").concat(e.PUSH_MODE,"<-which does not exist"),type:No.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}));return r}(a,t)),n=n.concat(function(e){var t=[],n=ji(e,(function(e,t,n){var r,i=t.PATTERN;return i===Vo.NA||(Wi(i)?e.push({str:i,idx:n,tokenType:t}):zi(i)&&(r=i,void 0===yi([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(function(e){return-1!==r.source.indexOf(e)})))&&e.push({str:i.source,idx:n,tokenType:t})),e}),[]);return Ai(e,(function(e,r){Ai(n,(function(n){var i=n.str,a=n.idx,o=n.tokenType;if(r").concat(e.name,"<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE");t.push({message:s,type:No.UNREACHABLE_PATTERN,tokenTypes:[e,o]})}}))})),t}(a)),n}var uo=/[^\\][$]/;var go=/[^\\[][\^]|^\^/;function co(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:".concat(e.source,")"),t)}function Ao(e){var t=e.ignoreCase?"iy":"y";return new RegExp("".concat(e.source),t)}function Io(e,t,n){var r=[],i=!1,a=qi(sr(Xt(Fi(e.modes))),(function(e){return e[ro]===Vo.NA})),o=mo(n);return t&&Ai(a,(function(e){var t=po(e,o);if(!1!==t){var n=function(e,t){if(t.issue===No.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <".concat(e.name,"> Token Type\n\t Root cause: ").concat(t.errMsg,".\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR");if(t.issue===No.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <".concat(e.name,"> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK");throw Error("non exhaustive match")}(e,t),a={message:n,type:t.issue,tokenType:e};r.push(a)}else Mi(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):no(o,e.PATTERN)&&(i=!0)})),t&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:No.NO_LINE_BREAKS_FLAGS}),r}function ho(e){var t=e.PATTERN;if(zi(t))return!1;if(O(t))return!0;if(Mi(t,"exec"))return!0;if(Wi(t))return!1;throw Error("non exhaustive match")}function Co(e){return!(!Wi(e)||1!==e.length)&&e.charCodeAt(0)}var fo={test:function(e){for(var t=e.length,n=this.lastIndex;n 0}))}function Ro(e,t){Ai(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),Ai(t.CATEGORIES,(function(n){var r=e.concat(t);Ti(r,n)||Ro(r,n)}))}function ko(e){return Mi(e,"tokenTypeIdx")}function Eo(e){return Mi(e,"CATEGORIES")}function Mo(e){return Mi(e,"tokenTypeIdx")}var No,Wo;(Wo=No||(No={}))[Wo.MISSING_PATTERN=0]="MISSING_PATTERN",Wo[Wo.INVALID_PATTERN=1]="INVALID_PATTERN",Wo[Wo.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",Wo[Wo.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",Wo[Wo.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",Wo[Wo.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",Wo[Wo.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",Wo[Wo.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",Wo[Wo.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",Wo[Wo.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",Wo[Wo.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",Wo[Wo.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",Wo[Wo.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",Wo[Wo.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",Wo[Wo.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",Wo[Wo.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",Wo[Wo.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",Wo[Wo.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var Fo={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->".concat(e.image,"<- The Mode Stack is empty")},buildUnexpectedCharactersMessage:function(e,t,n,r,i){return"unexpected character: ->".concat(e.charAt(t),"<- at offset: ").concat(t,", skipped ").concat(n," characters.")}},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Fo);var Vo=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fo;if((0,h.Z)(this,e),this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=function(e,t){if(!0===n.traceInitPerf){n.traceInitIndent++;var r=new Array(n.traceInitIndent+1).join("\t");n.traceInitIndent "));var i=oa(t),a=i.time,o=i.value,s=a>10?console.warn:console.log;return n.traceInitIndent time: ").concat(a,"ms")),n.traceInitIndent--,o}return t()},"boolean"===typeof r)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=gt({},Fo,r);var i=this.config.traceInitPerf;!0===i?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"===typeof i&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var e,i=!0;n.TRACE_INIT("Lexer Config handling",(function(){if(n.config.lineTerminatorsPattern===Fo.lineTerminatorsPattern)n.config.lineTerminatorsPattern=fo;else if(n.config.lineTerminatorCharacters===Fo.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),Z(t)?e={modes:{defaultMode:or(t)},defaultMode:io}:(i=!1,e=or(t))})),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(function(e,t,n){var r=[];return Mi(e,io)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+io+"> property in its definition\n",type:No.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Mi(e,ao)||r.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:No.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Mi(e,ao)&&Mi(e,io)&&!Mi(e.modes,e.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a ".concat(io,": <").concat(e.defaultMode,">which does not exist\n"),type:No.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Mi(e,ao)&&Ai(e.modes,(function(e,t){Ai(e,(function(n,i){Di(n)?r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<".concat(t,"> at index: <").concat(i,">\n"),type:No.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Mi(n,"LONGER_ALT")&&Ai(Z(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT],(function(i){Di(i)||Ti(e,i)||r.push({message:"A MultiMode Lexer cannot be initialized with a longer_alt <".concat(i.name,"> on token <").concat(n.name,"> outside of mode <").concat(t,">\n"),type:No.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}))})),r}(e,n.trackStartLines,n.config.lineTerminatorCharacters))})),n.TRACE_INIT("performWarningRuntimeChecks",(function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(Io(e,n.trackStartLines,n.config.lineTerminatorCharacters))}))),e.modes=e.modes?e.modes:{},Ai(e.modes,(function(t,n){e.modes[n]=qi(t,(function(e){return Di(e)}))}));var a=st(e.modes);if(Ai(e.modes,(function(e,t){n.TRACE_INIT("Mode: <".concat(t,"> processing"),(function(){var i;(n.modes.push(t),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(lo(e,a))})),Ki(n.lexerDefinitionErrors))&&(xo(e),n.TRACE_INIT("analyzeTokenTypes",(function(){i=so(e,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:n.TRACE_INIT})})),n.patternIdxToConfig[t]=i.patternIdxToConfig,n.charCodeToPatternIdxToConfig[t]=i.charCodeToPatternIdxToConfig,n.emptyGroups=gt({},n.emptyGroups,i.emptyGroups),n.hasCustom=i.hasCustom||n.hasCustom,n.canModeBeOptimized[t]=i.canBeOptimized)}))})),n.defaultMode=e.defaultMode,!Ki(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var o=Gi(n.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+o)}Ai(n.lexerDefinitionWarning,(function(e){aa(e.message)})),n.TRACE_INIT("Choosing sub-methods implementations",(function(){if(oo?(n.chopInput=U,n.match=n.matchWithTest):(n.updateLastIndex=ce,n.match=n.matchWithExec),i&&(n.handleModes=ce),!1===n.trackStartLines&&(n.computeNewColumn=U),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=ce),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else{if(!/onlyOffset/i.test(n.config.positionTracking))throw Error('Invalid config option: "'.concat(n.config.positionTracking,'"'));n.createTokenInstance=n.createOffsetOnlyToken}n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)})),n.TRACE_INIT("Failed Optimization Warnings",(function(){var e=ji(n.canModeBeOptimized,(function(e,t,n){return!1===t&&e.push(n),e}),[]);if(r.ensureOptimizations&&!Ki(e))throw Error("Lexer Modes: < ".concat(e.join(", "),' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.'))})),n.TRACE_INIT("clearRegExpParserCache",(function(){za={}})),n.TRACE_INIT("toFastProperties",(function(){sa(n)}))}))}return(0,C.Z)(e,[{key:"tokenize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultMode;if(!Ki(this.lexerDefinitionErrors)){var n=Gi(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(e,t)}},{key:"tokenizeInternal",value:function(e,t){var n,r,i,a,o,s,l,u,g,c,d,A,I,h,C,f,p=this,m=e,v=m.length,y=0,b=0,B=this.hasCustom?0:Math.floor(e.length/10),G=new Array(B),w=[],S=this.trackStartLines?1:void 0,x=this.trackStartLines?1:void 0,R=function(e){var t={};return Ai(st(e),(function(n){var r=e[n];if(!Z(r))throw Error("non exhaustive match");t[n]=[]})),t}(this.emptyGroups),k=this.trackStartLines,E=this.config.lineTerminatorsPattern,M=0,N=[],W=[],F=[],V=[];function T(){return N}function L(e){var t=Bo(e),n=W[t];return void 0===n?V:n}Object.freeze(V);var H,X=function(e){if(1===F.length&&void 0===e.tokenType.PUSH_MODE){var t=p.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);w.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{F.pop();var n=gi(F);N=p.patternIdxToConfig[n],W=p.charCodeToPatternIdxToConfig[n],M=N.length;var r=p.canModeBeOptimized[n]&&!1===p.config.safeMode;f=W&&r?L:T}};function Y(e){F.push(e),W=this.charCodeToPatternIdxToConfig[e],N=this.patternIdxToConfig[e],M=N.length,M=N.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;f=W&&t?L:T}Y.call(this,t);for(var _=this.config.recoveryEnabled;y s.length){s=a,l=u,H=O;break}}}break}}if(null!==s){if(g=s.length,void 0!==(c=H.group)&&(d=H.tokenTypeIdx,A=this.createTokenInstance(s,y,d,H.tokenType,S,x,g),this.handlePayload(A,l),!1===c?b=this.addToken(G,b,A):R[c].push(A)),e=this.chopInput(e,g),y+=g,x=this.computeNewColumn(x,g),!0===k&&!0===H.canLineTerminator){var j=0,q=void 0,$=void 0;E.lastIndex=0;do{!0===(q=E.test(s))&&($=E.lastIndex-1,j++)}while(!0===q);0!==j&&(S+=j,x=g-$,this.updateTokenEndLineColumnLocation(A,c,$,j,S,x,g))}this.handleModes(H,X,Y,A)}else{for(var ee=y,te=S,ne=x,re=!1===_;!1===re&&y ")+a}};Object.freeze(jo);var qo={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},$o={buildDuplicateFoundError:function(e,t){var n,r=e.name,i=bi(t),a=i.idx,o=Ba(i),s=(n=i)instanceof ma?n.terminalType.name:n instanceof ga?n.nonTerminalName:"",l=a>0,u="->".concat(o).concat(l?a:"","<- ").concat(s?"with argument: ->".concat(s,"<-"):"","\n appears more than once (").concat(t.length," times) in the top level rule: ->").concat(r,"<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n ");return u=(u=u.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <".concat(e.name,">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.")},buildAlternationPrefixAmbiguityError:function(e){var t=Gi(e.prefixPath,(function(e){return To(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <".concat(e.ambiguityIndices.join(" ,"),"> due to common lookahead prefix\nin inside <").concat(e.topLevelRule.name,"> Rule,\n<").concat(t,"> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.")},buildAlternationAmbiguityError:function(e){var t=Gi(e.prefixPath,(function(e){return To(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx,r="Ambiguous Alternatives Detected: <".concat(e.ambiguityIndices.join(" ,"),"> in inside <").concat(e.topLevelRule.name,"> Rule,\n<").concat(t,"> may appears as a prefix path in all these alternatives.\n");return r+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=Ba(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <".concat(t,"> within Rule <").concat(e.topLevelRule.name,"> can never consume any tokens.\nThis could lead to an infinite loop.")},buildTokenNameError:function(e){return"deprecated"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <".concat(e.emptyChoiceIdx+1,"> in inside <").concat(e.topLevelRule.name,"> Rule.\nOnly the last alternative may be an empty alternative.")},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n inside <").concat(e.topLevelRule.name,"> Rule.\n has ").concat(e.alternation.definition.length+1," alternatives.")},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,n=Gi(e.leftRecursionPath,(function(e){return e.name})),r="".concat(t," --\x3e ").concat(n.concat([t]).join(" --\x3e "));return"Left Recursion found in grammar.\nrule: <".concat(t,"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ").concat(r,"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.")},buildInvalidRuleNameError:function(e){return"deprecated"},buildDuplicateRuleNameError:function(e){var t;return t=e.topLevelRule instanceof ca?e.topLevelRule.name:e.topLevelRule,"Duplicate definition, rule: ->".concat(t,"<- is already defined in the grammar: ->").concat(e.grammarName,"<-")}};var es,ts,ns=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).nameToTopRule=e,i.errMsgProvider=r,i.errors=[],i}return(0,C.Z)(n,[{key:"resolveRefs",value:function(){var e=this;Ai(Fi(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))}},{key:"visitNonTerminal",value:function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Ml.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}]),n}(ya),rs=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).topProd=e,i.path=r,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}return(0,C.Z)(n,[{key:"startWalking",value:function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=or(this.path.ruleStack).reverse(),this.occurrenceStack=or(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}},{key:"walk",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.found||(0,A.Z)((0,I.Z)(n.prototype),"walk",this).call(this,e,t)}},{key:"walkProdRef",value:function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}},{key:"updateExpectedNext",value:function(){Ki(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}]),n}(Ga),is=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this,e,r)).path=r,i.nextTerminalName="",i.nextTerminalOccurrence=0,i.nextTerminalName=i.path.lastTok.name,i.nextTerminalOccurrence=i.path.lastTokOccurrence,i}return(0,C.Z)(n,[{key:"walkTerminal",value:function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),i=new da({definition:r});this.possibleTokTypes=Za(i),this.found=!0}}}]),n}(rs),as=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i;return(0,h.Z)(this,n),(i=t.call(this)).topRule=e,i.occurrence=r,i.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},i}return(0,C.Z)(n,[{key:"startWalking",value:function(){return this.walk(this.topRule),this.result}}]),n}(Ga),os=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),t.apply(this,arguments)}return(0,C.Z)(n,[{key:"walkMany",value:function(e,t,r){if(e.idx===this.occurrence){var i=bi(t.concat(r));this.result.isEndOfRule=void 0===i,i instanceof ma&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else(0,A.Z)((0,I.Z)(n.prototype),"walkMany",this).call(this,e,t,r)}}]),n}(as),ss=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),t.apply(this,arguments)}return(0,C.Z)(n,[{key:"walkManySep",value:function(e,t,r){if(e.idx===this.occurrence){var i=bi(t.concat(r));this.result.isEndOfRule=void 0===i,i instanceof ma&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else(0,A.Z)((0,I.Z)(n.prototype),"walkManySep",this).call(this,e,t,r)}}]),n}(as),ls=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),t.apply(this,arguments)}return(0,C.Z)(n,[{key:"walkAtLeastOne",value:function(e,t,r){if(e.idx===this.occurrence){var i=bi(t.concat(r));this.result.isEndOfRule=void 0===i,i instanceof ma&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else(0,A.Z)((0,I.Z)(n.prototype),"walkAtLeastOne",this).call(this,e,t,r)}}]),n}(as),us=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),t.apply(this,arguments)}return(0,C.Z)(n,[{key:"walkAtLeastOneSep",value:function(e,t,r){if(e.idx===this.occurrence){var i=bi(t.concat(r));this.result.isEndOfRule=void 0===i,i instanceof ma&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else(0,A.Z)((0,I.Z)(n.prototype),"walkAtLeastOneSep",this).call(this,e,t,r)}}]),n}(as);function gs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];n=or(n);var r=[],i=0;function a(a){var o=gs(a.concat(ci(e,i+1)),t,n);return r.concat(o)}for(;n.length =0;L--){var H={idx:I,def:f.definition[L].definition.concat(ci(A)),ruleStack:h,occurrenceStack:C};c.push(H),c.push(o)}else if(f instanceof da)c.push({idx:I,def:f.definition.concat(ci(A)),ruleStack:h,occurrenceStack:C});else{if(!(f instanceof ca))throw Error("non exhaustive match");c.push(ds(f,I,h,C))}}}else s&&gi(c).idx<=u&&c.pop()}return g}function ds(e,t,n,r){var i=or(n);i.push(e.name);var a=or(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}function As(e){if(e instanceof Aa||"Option"===e)return es.OPTION;if(e instanceof Ca||"Repetition"===e)return es.REPETITION;if(e instanceof Ia||"RepetitionMandatory"===e)return es.REPETITION_MANDATORY;if(e instanceof ha||"RepetitionMandatoryWithSeparator"===e)return es.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof fa||"RepetitionWithSeparator"===e)return es.REPETITION_WITH_SEPARATOR;if(e instanceof pa||"Alternation"===e)return es.ALTERNATION;throw Error("non exhaustive match")}function Is(e,t,n,r){var i=e.length,a=Ci(e,(function(e){return Ci(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var r=Gi(t,(function(e){return e.GATE})),a=0;a1}))),(function(n){var r=bi(n),i=t.buildDuplicateFoundError(e,n),a=Ba(r),o={message:i,type:Ml.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=xs(r);return s&&(o.parameter=s),o}));return i}(e,n)})),a=function(e,t,n){var r=[],i=Gi(t,(function(e){return e.name}));return Ai(e,(function(e){var t=e.name;if(Ti(i,t)){var a=n.buildNamespaceConflictError(e);r.push({message:a,type:Ml.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),r}(e,t,n),o=wi(e,(function(e){return function(e,t){var n=new Ms;e.accept(n);var r=wi(n.alternations,(function(n){return n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:Ml.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[]}));return r}(e,n)})),s=wi(e,(function(t){return function(e,t,n,r){var i=[],a=ji(t,(function(t,n){return n.name===e.name?t+1:t}),0);if(a>1){var o=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:o,type:Ml.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n)}));return i.concat(a,o,s)}function Ss(e){return"".concat(Ba(e),"_#_").concat(e.idx,"_#_").concat(xs(e))}function xs(e){return e instanceof ma?e.terminalType.name:e instanceof ga?e.nonTerminalName:""}var Rs=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,h.Z)(this,n),(e=t.apply(this,arguments)).allProductions=[],e}return(0,C.Z)(n,[{key:"visitNonTerminal",value:function(e){this.allProductions.push(e)}},{key:"visitOption",value:function(e){this.allProductions.push(e)}},{key:"visitRepetitionWithSeparator",value:function(e){this.allProductions.push(e)}},{key:"visitRepetitionMandatory",value:function(e){this.allProductions.push(e)}},{key:"visitRepetitionMandatoryWithSeparator",value:function(e){this.allProductions.push(e)}},{key:"visitRepetition",value:function(e){this.allProductions.push(e)}},{key:"visitAlternation",value:function(e){this.allProductions.push(e)}},{key:"visitTerminal",value:function(e){this.allProductions.push(e)}}]),n}(ya);function ks(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=[],a=Es(t.definition);if(Ki(a))return[];var o=e.name;Ti(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Ml.LEFT_RECURSION,ruleName:o});var s=wi(ui(a,r.concat([e])),(function(t){var i=or(r);return i.push(t),ks(e,t,n,i)}));return i.concat(s)}function Es(e){var t=[];if(Ki(e))return t;var n=bi(e);if(n instanceof ga)t.push(n.referencedRule);else if(n instanceof da||n instanceof Aa||n instanceof Ia||n instanceof ha||n instanceof fa||n instanceof Ca)t=t.concat(Es(n.definition));else if(n instanceof pa)t=Xt(Gi(n.definition,(function(e){return Es(e.definition)})));else if(!(n instanceof ma))throw Error("non exhaustive match");var r=ba(n),i=e.length>1;if(r&&i){var a=ci(e);return t.concat(Es(a))}return t}var Ms=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;return(0,h.Z)(this,n),(e=t.apply(this,arguments)).alternations=[],e}return(0,C.Z)(n,[{key:"visitAlternation",value:function(e){this.alternations.push(e)}}]),n}(ya);function Ns(e,t,n){var r=new Ms;e.accept(r);var i=r.alternations,a=wi(i=qi(i,(function(e){return!0===e.ignoreAmbiguities})),(function(r){var i=r.idx,a=r.maxLookahead||t,o=bs(i,e,a,r),s=function(e,t,n,r){var i=[],a=ji(e,(function(n,r,a){return!0===t.definition[a].ignoreAmbiguities||Ai(r,(function(r){var o=[a];Ai(e,(function(e,n){a!==n&&Gs(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)})),o.length>1&&!Gs(i,r)&&(i.push(r),n.push({alts:o,path:r}))})),n}),[]),o=Gi(a,(function(e){var i=Gi(e.alts,(function(e){return e+1}));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Ml.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}}));return o}(o,r,e,n),l=function(e,t,n,r){var i=ji(e,(function(e,t,n){var r=Gi(t,(function(e){return{idx:n,path:e}}));return e.concat(r)}),[]),a=sr(wi(i,(function(e){if(!0===t.definition[e.idx].ignoreAmbiguities)return[];var a=e.idx,o=e.path;return Gi(pi(i,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx on ").concat(e.constructor.name," CST Visitor."),type:ll.MISSING_METHOD,methodName:t}}));return sr(r)}(e,t);return n}(this,t);if(!Ki(e)){var n=Gi(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <".concat(this.constructor.name,">:\n\t").concat(n.join("\n\n").replace(/\n/g,"\n\t")))}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(ul=ll||(ll={}))[ul.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",ul[ul.MISSING_METHOD=1]="MISSING_METHOD";var Il=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initTreeBuilder",value:function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Mi(e,"nodeLocationTracking")?e.nodeLocationTracking:Wl.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=sl,this.setNodeLocationFromNode=sl,this.cstPostRule=ce,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ce,this.setNodeLocationFromNode=ce,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ol,this.setNodeLocationFromNode=ol,this.cstPostRule=ce,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ce,this.setNodeLocationFromNode=ce,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid config option: "'.concat(e.nodeLocationTracking,'"'));this.setNodeLocationFromToken=ce,this.setNodeLocationFromNode=ce,this.cstPostRule=ce,this.setInitialNodeLocation=ce}else this.cstInvocationStateUpdate=ce,this.cstFinallyStateUpdate=ce,this.cstPostTerminal=ce,this.cstPostNonTerminal=ce,this.cstPostRule=ce}},{key:"setInitialNodeLocationOnlyOffsetRecovery",value:function(e){e.location={startOffset:NaN,endOffset:NaN}}},{key:"setInitialNodeLocationOnlyOffsetRegular",value:function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}},{key:"setInitialNodeLocationFullRecovery",value:function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}},{key:"setInitialNodeLocationFullRegular",value:function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}},{key:"cstInvocationStateUpdate",value:function(e){var t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}},{key:"cstFinallyStateUpdate",value:function(){this.CST_STACK.pop()}},{key:"cstPostRuleFull",value:function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset===!0?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}},{key:"cstPostRuleOnlyOffset",value:function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset===!0?n.endOffset=t.endOffset:n.startOffset=NaN}},{key:"cstPostTerminal",value:function(e,t){var n,r,i,a=this.CST_STACK[this.CST_STACK.length-1];r=t,i=e,void 0===(n=a).children[i]?n.children[i]=[r]:n.children[i].push(r),this.setNodeLocationFromToken(a.location,t)}},{key:"cstPostNonTerminal",value:function(e,t){var n=this.CST_STACK[this.CST_STACK.length-1];!function(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}},{key:"getBaseCstVisitorConstructor",value:function(){if(Di(this.baseCstVisitorConstructor)){var e=Al(this.className,st(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}},{key:"getBaseCstVisitorConstructorWithDefaults",value:function(){if(Di(this.baseCstVisitorWithDefaultsConstructor)){var e=function(e,t,n){var r=function(){};cl(r,e+"BaseSemanticsWithDefaults");var i=Object.create(n.prototype);return Ai(t,(function(e){i[e]=dl})),(r.prototype=i).constructor=r,r}(this.className,st(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}},{key:"getLastExplicitRuleShortName",value:function(){var e=this.RULE_STACK;return e[e.length-1]}},{key:"getPreviousExplicitRuleShortName",value:function(){var e=this.RULE_STACK;return e[e.length-2]}},{key:"getLastExplicitRuleOccurrenceIndex",value:function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}]),e}(),hl=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initLexerAdapter",value:function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}},{key:"input",get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}},{key:"SKIP_TOKEN",value:function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):El}},{key:"LA",value:function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?El:this.tokVector[t]}},{key:"consumeToken",value:function(){this.currIdx++}},{key:"exportLexerState",value:function(){return this.currIdx}},{key:"importLexerState",value:function(e){this.currIdx=e}},{key:"resetLexerState",value:function(){this.currIdx=-1}},{key:"moveToTerminatedState",value:function(){this.currIdx=this.tokVector.length-1}},{key:"getLexerPosition",value:function(){return this.exportLexerState()}}]),e}(),Cl=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"ACTION",value:function(e){return e.call(this)}},{key:"consume",value:function(e,t,n){return this.consumeInternal(t,e,n)}},{key:"subrule",value:function(e,t,n){return this.subruleInternal(t,e,n)}},{key:"option",value:function(e,t){return this.optionInternal(t,e)}},{key:"or",value:function(e,t){return this.orInternal(t,e)}},{key:"many",value:function(e,t){return this.manyInternal(e,t)}},{key:"atLeastOne",value:function(e,t){return this.atLeastOneInternal(e,t)}},{key:"CONSUME",value:function(e,t){return this.consumeInternal(e,0,t)}},{key:"CONSUME1",value:function(e,t){return this.consumeInternal(e,1,t)}},{key:"CONSUME2",value:function(e,t){return this.consumeInternal(e,2,t)}},{key:"CONSUME3",value:function(e,t){return this.consumeInternal(e,3,t)}},{key:"CONSUME4",value:function(e,t){return this.consumeInternal(e,4,t)}},{key:"CONSUME5",value:function(e,t){return this.consumeInternal(e,5,t)}},{key:"CONSUME6",value:function(e,t){return this.consumeInternal(e,6,t)}},{key:"CONSUME7",value:function(e,t){return this.consumeInternal(e,7,t)}},{key:"CONSUME8",value:function(e,t){return this.consumeInternal(e,8,t)}},{key:"CONSUME9",value:function(e,t){return this.consumeInternal(e,9,t)}},{key:"SUBRULE",value:function(e,t){return this.subruleInternal(e,0,t)}},{key:"SUBRULE1",value:function(e,t){return this.subruleInternal(e,1,t)}},{key:"SUBRULE2",value:function(e,t){return this.subruleInternal(e,2,t)}},{key:"SUBRULE3",value:function(e,t){return this.subruleInternal(e,3,t)}},{key:"SUBRULE4",value:function(e,t){return this.subruleInternal(e,4,t)}},{key:"SUBRULE5",value:function(e,t){return this.subruleInternal(e,5,t)}},{key:"SUBRULE6",value:function(e,t){return this.subruleInternal(e,6,t)}},{key:"SUBRULE7",value:function(e,t){return this.subruleInternal(e,7,t)}},{key:"SUBRULE8",value:function(e,t){return this.subruleInternal(e,8,t)}},{key:"SUBRULE9",value:function(e,t){return this.subruleInternal(e,9,t)}},{key:"OPTION",value:function(e){return this.optionInternal(e,0)}},{key:"OPTION1",value:function(e){return this.optionInternal(e,1)}},{key:"OPTION2",value:function(e){return this.optionInternal(e,2)}},{key:"OPTION3",value:function(e){return this.optionInternal(e,3)}},{key:"OPTION4",value:function(e){return this.optionInternal(e,4)}},{key:"OPTION5",value:function(e){return this.optionInternal(e,5)}},{key:"OPTION6",value:function(e){return this.optionInternal(e,6)}},{key:"OPTION7",value:function(e){return this.optionInternal(e,7)}},{key:"OPTION8",value:function(e){return this.optionInternal(e,8)}},{key:"OPTION9",value:function(e){return this.optionInternal(e,9)}},{key:"OR",value:function(e){return this.orInternal(e,0)}},{key:"OR1",value:function(e){return this.orInternal(e,1)}},{key:"OR2",value:function(e){return this.orInternal(e,2)}},{key:"OR3",value:function(e){return this.orInternal(e,3)}},{key:"OR4",value:function(e){return this.orInternal(e,4)}},{key:"OR5",value:function(e){return this.orInternal(e,5)}},{key:"OR6",value:function(e){return this.orInternal(e,6)}},{key:"OR7",value:function(e){return this.orInternal(e,7)}},{key:"OR8",value:function(e){return this.orInternal(e,8)}},{key:"OR9",value:function(e){return this.orInternal(e,9)}},{key:"MANY",value:function(e){this.manyInternal(0,e)}},{key:"MANY1",value:function(e){this.manyInternal(1,e)}},{key:"MANY2",value:function(e){this.manyInternal(2,e)}},{key:"MANY3",value:function(e){this.manyInternal(3,e)}},{key:"MANY4",value:function(e){this.manyInternal(4,e)}},{key:"MANY5",value:function(e){this.manyInternal(5,e)}},{key:"MANY6",value:function(e){this.manyInternal(6,e)}},{key:"MANY7",value:function(e){this.manyInternal(7,e)}},{key:"MANY8",value:function(e){this.manyInternal(8,e)}},{key:"MANY9",value:function(e){this.manyInternal(9,e)}},{key:"MANY_SEP",value:function(e){this.manySepFirstInternal(0,e)}},{key:"MANY_SEP1",value:function(e){this.manySepFirstInternal(1,e)}},{key:"MANY_SEP2",value:function(e){this.manySepFirstInternal(2,e)}},{key:"MANY_SEP3",value:function(e){this.manySepFirstInternal(3,e)}},{key:"MANY_SEP4",value:function(e){this.manySepFirstInternal(4,e)}},{key:"MANY_SEP5",value:function(e){this.manySepFirstInternal(5,e)}},{key:"MANY_SEP6",value:function(e){this.manySepFirstInternal(6,e)}},{key:"MANY_SEP7",value:function(e){this.manySepFirstInternal(7,e)}},{key:"MANY_SEP8",value:function(e){this.manySepFirstInternal(8,e)}},{key:"MANY_SEP9",value:function(e){this.manySepFirstInternal(9,e)}},{key:"AT_LEAST_ONE",value:function(e){this.atLeastOneInternal(0,e)}},{key:"AT_LEAST_ONE1",value:function(e){return this.atLeastOneInternal(1,e)}},{key:"AT_LEAST_ONE2",value:function(e){this.atLeastOneInternal(2,e)}},{key:"AT_LEAST_ONE3",value:function(e){this.atLeastOneInternal(3,e)}},{key:"AT_LEAST_ONE4",value:function(e){this.atLeastOneInternal(4,e)}},{key:"AT_LEAST_ONE5",value:function(e){this.atLeastOneInternal(5,e)}},{key:"AT_LEAST_ONE6",value:function(e){this.atLeastOneInternal(6,e)}},{key:"AT_LEAST_ONE7",value:function(e){this.atLeastOneInternal(7,e)}},{key:"AT_LEAST_ONE8",value:function(e){this.atLeastOneInternal(8,e)}},{key:"AT_LEAST_ONE9",value:function(e){this.atLeastOneInternal(9,e)}},{key:"AT_LEAST_ONE_SEP",value:function(e){this.atLeastOneSepFirstInternal(0,e)}},{key:"AT_LEAST_ONE_SEP1",value:function(e){this.atLeastOneSepFirstInternal(1,e)}},{key:"AT_LEAST_ONE_SEP2",value:function(e){this.atLeastOneSepFirstInternal(2,e)}},{key:"AT_LEAST_ONE_SEP3",value:function(e){this.atLeastOneSepFirstInternal(3,e)}},{key:"AT_LEAST_ONE_SEP4",value:function(e){this.atLeastOneSepFirstInternal(4,e)}},{key:"AT_LEAST_ONE_SEP5",value:function(e){this.atLeastOneSepFirstInternal(5,e)}},{key:"AT_LEAST_ONE_SEP6",value:function(e){this.atLeastOneSepFirstInternal(6,e)}},{key:"AT_LEAST_ONE_SEP7",value:function(e){this.atLeastOneSepFirstInternal(7,e)}},{key:"AT_LEAST_ONE_SEP8",value:function(e){this.atLeastOneSepFirstInternal(8,e)}},{key:"AT_LEAST_ONE_SEP9",value:function(e){this.atLeastOneSepFirstInternal(9,e)}},{key:"RULE",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Fl;if(Ti(this.definedRulesNames,e)){var r={message:$o.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ml.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(r)}this.definedRulesNames.push(e);var i=this.defineRule(e,t,n);return this[e]=i,i}},{key:"OVERRIDE_RULE",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Fl,r=function(e,t,n){var r,i=[];return Ti(t,e)||(r="Invalid rule override, rule: ->".concat(e,"<- cannot be overridden in the grammar: ->").concat(n,"<-as it is not defined in any of the super grammars "),i.push({message:r,type:Ml.INVALID_RULE_OVERRIDE,ruleName:e})),i}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);var i=this.defineRule(e,t,n);return this[e]=i,i}},{key:"BACKTRACK",value:function(e,t){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,t),!0}catch(r){if(Ys(r))return!1;throw r}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}},{key:"getGAstProductions",value:function(){return this.gastProductionsCache}},{key:"getSerializedGastProductions",value:function(){return Gi(Fi(this.gastProductionsCache),va)}}]),e}(),fl=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initRecognizerEngine",value:function(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=wo,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Mi(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Z(e)){if(Ki(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"===typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Z(e))this.tokensMap=ji(e,(function(e,t){return e[t.name]=t,e}),{});else if(Mi(e,"modes")&&Ci(Xt(Fi(e.modes)),Mo)){var n=ra(Xt(Fi(e.modes)));this.tokensMap=ji(n,(function(e,t){return e[t.name]=t,e}),{})}else{if(!W(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=or(e)}this.tokensMap.EOF=Oo;var r=Ci(Mi(e,"modes")?Xt(Fi(e.modes)):Fi(e),(function(e){return Ki(e.categoryMatches)}));this.tokenMatcher=r?wo:Go,xo(Fi(this.tokensMap))}},{key:"defineRule",value:function(e,t,n){if(this.selfAnalysisDone)throw Error("Grammar rule <".concat(e,"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called."));var r,i=Mi(n,"resyncEnabled")?n.resyncEnabled:Fl.resyncEnabled,a=Mi(n,"recoveryValueFunc")?n.recoveryValueFunc:Fl.recoveryValueFunc,o=this.ruleShortNameIdx<<12;return this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o,r=!0===this.outputCst?function(){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx);for(var n=arguments.length,r=new Array(n),s=0;s t}},{key:"orInternal",value:function(e,t){var n=this.getKeyForAutomaticLookahead(256,t),r=Z(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}},{key:"ruleFinallyStateUpdate",value:function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new zs(t,e))}}},{key:"subruleInternal",value:function(e,t,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}},{key:"subruleInternalError",value:function(e,t,n){throw Ys(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e}},{key:"consumeInternal",value:function(e,t,n){var r;try{var i=this.LA(1);!0===this.tokenMatcher(i,e)?(this.consumeToken(),r=i):this.consumeInternalError(e,i,n)}catch(a){r=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r}},{key:"consumeInternalError",value:function(e,t,n){var r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Ks(r,t,i))}},{key:"consumeInternalRecovery",value:function(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(i){throw i.name===Qs?n:i}}},{key:"saveRecogState",value:function(){var e=this.errors,t=or(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}},{key:"reloadRecogState",value:function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}},{key:"ruleInvocationStateUpdate",value:function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}},{key:"isBackTracking",value:function(){return 0!==this.isBackTrackingStack.length}},{key:"getCurrRuleFullName",value:function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}},{key:"shortRuleNameToFullName",value:function(e){return this.shortRuleNameToFull[e]}},{key:"isAtEndOfInput",value:function(){return this.tokenMatcher(this.LA(1),Oo)}},{key:"reset",value:function(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}]),e}(),pl=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initErrorHandler",value:function(e){this._errors=[],this.errorMessageProvider=Mi(e,"errorMessageProvider")?e.errorMessageProvider:Wl.errorMessageProvider}},{key:"SAVE_ERROR",value:function(e){if(Ys(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:or(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}},{key:"errors",get:function(){return or(this._errors)},set:function(e){this._errors=e}},{key:"raiseEarlyExitException",value:function(e,t,n){for(var r=this.getCurrRuleFullName(),i=Bs(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],a=[],o=1;o<=this.maxLookahead;o++)a.push(this.LA(o));var s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Ds(s,this.LA(1),this.LA(0)))}},{key:"raiseNoAltException",value:function(e,t){for(var n=this.getCurrRuleFullName(),r=bs(e,this.getGAstProductions()[n],this.maxLookahead),i=[],a=1;a<=this.maxLookahead;a++)i.push(this.LA(a));var o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Us(s,this.LA(1),o))}}]),e}(),ml=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initContentAssist",value:function(){}},{key:"computeContentAssist",value:function(e,t){var n=this.gastProductionsCache[e];if(Di(n))throw Error("Rule ->".concat(e,"<- does not exist in this grammar."));return cs([n],t,this.tokenMatcher,this.maxLookahead)}},{key:"getNextPossibleTokenTypes",value:function(e){var t=bi(e.ruleStack),n=this.getGAstProductions()[t];return new is(n,e).startWalking()}}]),e}(),vl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vl);var yl=Math.pow(2,8)-1,bl=Qo({name:"RECORDING_PHASE_TOKEN",pattern:Vo.NA});xo([bl]);var Bl=Jo(bl,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Bl);var Gl={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},wl=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initGastRecorder",value:function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}},{key:"enableRecording",value:function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var n=t>0?t:"";e["CONSUME".concat(n)]=function(e,n){return this.consumeInternalRecord(e,t,n)},e["SUBRULE".concat(n)]=function(e,n){return this.subruleInternalRecord(e,t,n)},e["OPTION".concat(n)]=function(e){return this.optionInternalRecord(e,t)},e["OR".concat(n)]=function(e){return this.orInternalRecord(e,t)},e["MANY".concat(n)]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP".concat(n)]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE".concat(n)]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP".concat(n)]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))}},{key:"disableRecording",value:function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=e,n=0;n<10;n++){var r=n>0?n:"";delete t["CONSUME".concat(r)],delete t["SUBRULE".concat(r)],delete t["OPTION".concat(r)],delete t["OR".concat(r)],delete t["MANY".concat(r)],delete t["MANY_SEP".concat(r)],delete t["AT_LEAST_ONE".concat(r)],delete t["AT_LEAST_ONE_SEP".concat(r)]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA}))}},{key:"ACTION_RECORD",value:function(e){}},{key:"BACKTRACK_RECORD",value:function(e,t){return function(){return!0}}},{key:"LA_RECORD",value:function(e){return El}},{key:"topLevelRuleRecord",value:function(e,t){try{var n=new ca({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(r){if(!0!==r.KNOWN_RECORDER_ERROR)try{r.message=r.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(i){throw r}throw r}}},{key:"optionInternalRecord",value:function(e,t){return Zl.call(this,Aa,e,t)}},{key:"atLeastOneInternalRecord",value:function(e,t){Zl.call(this,Ia,t,e)}},{key:"atLeastOneSepFirstInternalRecord",value:function(e,t){Zl.call(this,ha,t,e,true)}},{key:"manyInternalRecord",value:function(e,t){Zl.call(this,Ca,t,e)}},{key:"manySepFirstInternalRecord",value:function(e,t){Zl.call(this,fa,t,e,true)}},{key:"orInternalRecord",value:function(e,t){return Sl.call(this,e,t)}},{key:"subruleInternalRecord",value:function(e,t,n){if(Rl(t),!e||!1===Mi(e,"ruleName")){var r=new Error(" argument is invalid expecting a Parser method reference but got: <").concat(JSON.stringify(e),">\n inside top level rule: <").concat(this.recordingProdStack[0].name,">"));throw r.KNOWN_RECORDER_ERROR=!0,r}var i=gi(this.recordingProdStack),a=e.ruleName,o=new ga({idx:t,nonTerminalName:a,label:null===n||void 0===n?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?Gl:vl}},{key:"consumeInternalRecord",value:function(e,t,n){if(Rl(t),!ko(e)){var r=new Error(" argument is invalid expecting a TokenType reference but got: <").concat(JSON.stringify(e),">\n inside top level rule: <").concat(this.recordingProdStack[0].name,">"));throw r.KNOWN_RECORDER_ERROR=!0,r}var i=gi(this.recordingProdStack),a=new ma({idx:t,terminalType:e,label:null===n||void 0===n?void 0:n.LABEL});return i.definition.push(a),Bl}}]),e}();function Zl(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Rl(n);var i=gi(this.recordingProdStack),a=O(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),Mi(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),vl}function Sl(e,t){var n=this;Rl(t);var r=gi(this.recordingProdStack),i=!1===Z(e),a=!1===i?e:e.DEF,o=new pa({definition:[],idx:t,ignoreAmbiguities:i&&!0===e.IGNORE_AMBIGUITIES});Mi(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD);var s=ea(a,(function(e){return O(e.GATE)}));return o.hasPredicates=s,r.definition.push(o),Ai(a,(function(e){var t=new da({definition:[]});o.definition.push(t),Mi(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Mi(e,"GATE")&&(t.ignoreAmbiguities=!0),n.recordingProdStack.push(t),e.ALT.call(n),n.recordingProdStack.pop()})),vl}function xl(e){return 0===e?"":"".concat(e)}function Rl(e){if(e<0||e>yl){var t=new Error("Invalid DSL Method idx value: <".concat(e,">\n\tIdx value must be a none negative value smaller than ").concat(yl+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}var kl=function(){function e(){(0,h.Z)(this,e)}return(0,C.Z)(e,[{key:"initPerformanceTracer",value:function(e){if(Mi(e,"traceInitPerf")){var t=e.traceInitPerf,n="number"===typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Wl.traceInitPerf;this.traceInitIndent=-1}},{key:"TRACE_INIT",value:function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent "));var r=oa(t),i=r.time,a=r.value,o=i>10?console.warn:console.log;return this.traceInitIndent time: ").concat(i,"ms")),this.traceInitIndent--,a}return t()}}]),e}();var El=Jo(Oo,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(El);var Ml,Nl,Wl=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:jo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Fl=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});(Nl=Ml||(Ml={}))[Nl.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",Nl[Nl.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",Nl[Nl.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",Nl[Nl.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",Nl[Nl.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",Nl[Nl.LEFT_RECURSION=5]="LEFT_RECURSION",Nl[Nl.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",Nl[Nl.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",Nl[Nl.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",Nl[Nl.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",Nl[Nl.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",Nl[Nl.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",Nl[Nl.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",Nl[Nl.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION";var Vl,Tl=function(){function e(t,n){(0,h.Z)(this,e),this.definitionErrors=[],this.selfAnalysisDone=!1;var r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(t,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),Mi(n,"ignoredIssues"))throw new Error("The IParserConfig property has been deprecated.\n\tPlease use the flag on the relevant DSL method instead.\n\tSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n\tFor further details.");this.skipValidations=Mi(n,"skipValidations")?n.skipValidations:Wl.skipValidations}return(0,C.Z)(e,[{key:"performSelfAnalysis",value:function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var n;t.selfAnalysisDone=!0;var r=t.className;t.TRACE_INIT("toFastProps",(function(){sa(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),Ai(t.definedRulesNames,(function(e){var n,r=t[e].originalGrammarAction;t.TRACE_INIT("".concat(e," Rule"),(function(){n=t.topLevelRuleRecord(e,r)})),t.gastProductionsCache[e]=n}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=Fs({rules:Fi(t.gastProductionsCache)}),t.definitionErrors=t.definitionErrors.concat(i)})),t.TRACE_INIT("Grammar Validations",(function(){if(Ki(i)&&!1===t.skipValidations){var e=(a={rules:Fi(t.gastProductionsCache),tokenTypes:Fi(t.tokensMap),errMsgProvider:$o,grammarName:r},Zs((a=oi(a,{errMsgProvider:$o})).rules,a.tokenTypes,a.errMsgProvider,a.grammarName)),n=function(e){return Gi(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),(function(e){return Object.assign({type:Ml.CUSTOM_LOOKAHEAD_VALIDATION},e)}))}({lookaheadStrategy:t.lookaheadStrategy,rules:Fi(t.gastProductionsCache),tokenTypes:Fi(t.tokensMap),grammarName:r});t.definitionErrors=t.definitionErrors.concat(e,n)}var a})),Ki(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=function(e){var t={};return Ai(e,(function(e){var n=new xa(e).startWalking();gt(t,n)})),t}(Fi(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){var e,n;null===(n=(e=t.lookaheadStrategy).initialize)||void 0===n||n.call(e,{rules:Fi(t.gastProductionsCache)}),t.preComputeLookaheadFunctions(Fi(t.gastProductionsCache))}))),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!Ki(t.definitionErrors))throw n=Gi(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n ".concat(n.join("\n-------------------------------\n")))}))}}],[{key:"performSelfAnalysis",value:function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated.\t\nUse the **instance** method with the same name instead.")}}]),e}();Tl.DEFER_DEFINITION_ERRORS_HANDLING=!1,Vl=Tl,[Js,rl,Il,hl,fl,Cl,pl,ml,wl,kl].forEach((function(e){var t=e.prototype;Object.getOwnPropertyNames(t).forEach((function(n){if("constructor"!==n){var r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(Vl.prototype,n,r):Vl.prototype[n]=e.prototype[n]}}))}));var Ll=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wl;(0,h.Z)(this,n);var i=or(r);return i.outputCst=!0,t.call(this,e,i)}return(0,C.Z)(n)}(Tl);return{CstParser:Ll,Lexer:Vo,createToken:Qo}}(),Zc=wc.CstParser,Sc=wc.Lexer,xc=wc.createToken,Rc=null,kc=null,Ec=null,Mc=null,Nc={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4},Wc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;(0,h.Z)(this,e),this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}return(0,C.Z)(e,[{key:"_initWorker",value:function(e){if(!this.workers[e]){var t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}},{key:"_getIdleWorker",value:function(){for(var e=0;e 1&&void 0!==arguments[1]?arguments[1]:0;if(!ud)throw new Error("ZSTDDecoder: Await .init() before decoding.");var n=e.byteLength,r=ud.exports.malloc(n);gd.set(e,r),t=t||Number(ud.exports.ZSTD_findDecompressedSize(r,n));var i=ud.exports.malloc(t),a=ud.exports.ZSTD_decompress(i,t,r,n),o=gd.slice(i,i+a);return ud.exports.free(r),ud.exports.free(i),o}}]),e}(),hd="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQ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ABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIA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gAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2A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iADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJA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IQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQ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MAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCG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IQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Cd=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,r,i,a,o,s){var l;return(0,h.Z)(this,n),(l=t.call(this,e,r,i,o,s)).isCompressedArrayTexture=!0,l.image.depth=a,l.wrapR=m.ClampToEdgeWrapping,l}return(0,C.Z)(n)}(m.CompressedTexture),fd=new WeakMap,pd=0,md,vd=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,h.Z)(this,n),(r=t.call(this,e)).transcoderPath="",r.transcoderBinary=null,r.transcoderPending=null,r.workerPool=new Wc,r.workerSourceURL="",r.workerConfig=null,"undefined"!==typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.'),r}return(0,C.Z)(n,[{key:"setTranscoderPath",value:function(e){return this.transcoderPath=e,this}},{key:"setWorkerLimit",value:function(e){return this.workerPool.setWorkerLimit(e),this}},{key:"detectSupport",value:function(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}},{key:"init",value:function(){var e=this;if(!this.transcoderPending){var t=new m.FileLoader(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);var r=t.loadAsync("basis_transcoder.js"),i=new m.FileLoader(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);var a=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([r,a]).then((function(t){var r=(0,o.Z)(t,2),i=r[0],a=r[1],s=n.BasisWorker.toString(),l=["/* constants */","let _EngineFormat = "+JSON.stringify(n.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(n.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(n.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([l])),e.transcoderBinary=a,e.workerPool.setWorkerCreator((function(){var t=new Worker(e.workerSourceURL),n=e.transcoderBinary.slice(0);return t.postMessage({type:"init",config:e.workerConfig,transcoderBinary:n},[n]),t}))})),pd>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),pd++}return this.transcoderPending}},{key:"load",value:function(e,t,n,r){var i=this;if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");var a=new m.FileLoader(this.manager);a.setResponseType("arraybuffer"),a.setWithCredentials(this.withCredentials),a.load(e,(function(e){if(fd.has(e))return fd.get(e).promise.then(t).catch(r);i._createTexture(e).then((function(e){return t?t(e):null})).catch(r)}),n,r)}},{key:"_createTextureFrom",value:function(e,t){var n=e.mipmaps,r=e.width,i=e.height,a=e.format,o=e.type,s=e.error,l=e.dfdTransferFn,u=e.dfdFlags;if("error"===o)return Promise.reject(s);var g=t.layerCount>1?new Cd(n,r,i,t.layerCount,a,m.UnsignedByteType):new m.CompressedTexture(n,r,i,a,m.UnsignedByteType);return g.minFilter=1===n.length?m.LinearFilter:m.LinearMipmapLinearFilter,g.magFilter=m.LinearFilter,g.generateMipmaps=!1,g.needsUpdate=!0,"colorSpace"in g?g.colorSpace=l===Kc?"srgb":"srgb-linear":g.encoding=l===Kc?3001:3e3,g.premultiplyAlpha=!!(u&_c),g}},{key:"_createTexture",value:function(){var e=(0,g.Z)((0,u.Z)().mark((function e(t){var n,r,i,a,o=this,s=arguments;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},(r=dd(new Uint8Array(t))).vkFormat===Dc){e.next=4;break}return e.abrupt("return",wd(r));case 4:return i=n,a=this.init().then((function(){return o.workerPool.postMessage({type:"transcode",buffer:t,taskConfig:i},[t])})).then((function(e){return o._createTextureFrom(e.data,r)})),fd.set(t,{promise:a}),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"dispose",value:function(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),pd--,this}}]),n}(m.Loader),yd=vd;m.RGBAFormat,m.RGBA_ASTC_4x4_Format,m.RGBA_BPTC_Format,m.RGBA_ETC2_EAC_Format,m.RGBA_PVRTC_4BPPV1_Format,m.RGBA_S3TC_DXT5_Format,m.RGB_ETC1_Format,m.RGB_ETC2_Format,m.RGB_PVRTC_4BPPV1_Format,m.RGB_S3TC_DXT1_Format;var bd=(y={},(0,r.Z)(y,id,m.RGBAFormat),(0,r.Z)(y,td,m.RGBAFormat),(0,r.Z)(y,jc,m.RGBAFormat),(0,r.Z)(y,qc,m.RGBAFormat),(0,r.Z)(y,rd,m.RGFormat),(0,r.Z)(y,ed,m.RGFormat),(0,r.Z)(y,Oc,m.RGFormat),(0,r.Z)(y,Jc,m.RGFormat),(0,r.Z)(y,nd,m.RedFormat),(0,r.Z)(y,$c,m.RedFormat),(0,r.Z)(y,Qc,m.RedFormat),(0,r.Z)(y,Pc,m.RedFormat),y),Bd=(b={},(0,r.Z)(b,id,m.FloatType),(0,r.Z)(b,td,m.HalfFloatType),(0,r.Z)(b,jc,m.UnsignedByteType),(0,r.Z)(b,qc,m.UnsignedByteType),(0,r.Z)(b,rd,m.FloatType),(0,r.Z)(b,ed,m.HalfFloatType),(0,r.Z)(b,Oc,m.UnsignedByteType),(0,r.Z)(b,Jc,m.UnsignedByteType),(0,r.Z)(b,nd,m.FloatType),(0,r.Z)(b,$c,m.HalfFloatType),(0,r.Z)(b,Qc,m.UnsignedByteType),(0,r.Z)(b,Pc,m.UnsignedByteType),b),Gd=(B={},(0,r.Z)(B,qc,3001),(0,r.Z)(B,Jc,3001),(0,r.Z)(B,Qc,3001),B);function wd(e){return Zd.apply(this,arguments)}function Zd(){return Zd=(0,g.Z)((0,u.Z)().mark((function e(t){var n,r,i,a,o,s,l,c;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.vkFormat,r=t.pixelWidth,i=t.pixelHeight,a=t.pixelDepth,void 0!==bd[n]){e.next=3;break}throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");case 3:if(o=t.levels[0],t.supercompressionScheme!==Fc){e.next=8;break}s=o.levelData,e.next=16;break;case 8:if(t.supercompressionScheme!==Vc){e.next=15;break}return md||(md=new Promise(function(){var e=(0,g.Z)((0,u.Z)().mark((function e(t){var n;return(0,u.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Id,e.next=3,n.init();case 3:t(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),e.next=12,md;case 12:s=e.sent.decode(o.levelData,o.uncompressedByteLength),e.next=16;break;case 15:throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");case 16:return l=Bd[n]===m.FloatType?new Float32Array(s.buffer,s.byteOffset,s.byteLength/Float32Array.BYTES_PER_ELEMENT):Bd[n]===m.HalfFloatType?new Uint16Array(s.buffer,s.byteOffset,s.byteLength/Uint16Array.BYTES_PER_ELEMENT):s,(c=0===a?new m.DataTexture(l,r,i):new Ac(l,r,i,a)).type=Bd[n],c.format=bd[n],c.encoding=Gd[n]||3e3,c.needsUpdate=!0,e.abrupt("return",Promise.resolve(c));case 23:case"end":return e.stop()}}),e)}))),Zd.apply(this,arguments)}var Sd=null,xd=null,Rd=function(){var e=0,t=-3;function n(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function r(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new n,this.dtree=new n}var i=new n,a=new n,o=new Uint8Array(30),s=new Uint16Array(30),l=new Uint8Array(30),u=new Uint16Array(30),g=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=new n,d=new Uint8Array(320);function A(e,t,n,r){var i,a;for(i=0;i >>=1,t}function f(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]< >>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function p(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]< >>=1,++i,n+=t.table[i],r-=t.table[i]}while(r>=0);return e.tag=a,e.bitcount-=i,t.trans[n+r]}function m(e,t,n){var r,i,a,o,s,l;for(r=f(e,5,257),i=f(e,5,1),a=f(e,4,4),o=0;o<19;++o)d[o]=0;for(o=0;o8;)n.sourceIndex--,n.bitcount-=8;if((r=256*(r=n.source[n.sourceIndex+1])+n.source[n.sourceIndex])!==(65535&~(256*n.source[n.sourceIndex+3]+n.source[n.sourceIndex+2])))return t;for(n.sourceIndex+=4,i=r;i;--i)n.dest[n.destLen++]=n.source[n.sourceIndex++];return n.bitcount=0,e}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(i,a),A(o,s,4,3),A(l,u,2,1),o[28]=0,s[28]=258;var b=function(n,o){var s,l,u=new r(n,o);do{switch(s=C(u),f(u,2,0)){case 0:l=y(u);break;case 1:l=v(u,i,a);break;case 2:m(u,u.ltree,u.dtree),l=v(u,u.ltree,u.dtree);break;default:l=t}if(l!==e)throw new Error("Data error")}while(!s);return u.destLen this.x2&&(this.x2=e)),"number"===typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t this.y2&&(this.y2=t))},G.prototype.addX=function(e){this.addPoint(e,null)},G.prototype.addY=function(e){this.addPoint(null,e)},G.prototype.addBezier=function(e,t,n,r,i,a,o,s){var l=[e,t],u=[n,r],g=[i,a],c=[o,s];this.addPoint(e,t),this.addPoint(o,s);for(var d=0;d<=1;d++){var A=6*l[d]-12*u[d]+6*g[d],I=-3*l[d]+9*u[d]-9*g[d]+3*c[d],h=3*u[d]-3*l[d];if(0!==I){var C=Math.pow(A,2)-4*h*I;if(!(C<0)){var f=(-A+Math.sqrt(C))/(2*I);0 =0&&r>0&&(n+=" "),n+=t(i)}return n}e=void 0!==e?e:2;for(var r="",i=0;i "},w.prototype.toDOMElement=function(e){var t=this.toPathData(e),n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),n};var x={fail:Z,argument:S,assert:S},R=2147483648,k={},E={},M={};function N(e){return function(){return e}}E.BYTE=function(e){return x.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},M.BYTE=N(1),E.CHAR=function(e){return[e.charCodeAt(0)]},M.CHAR=N(1),E.CHARARRAY=function(e){"undefined"===typeof e&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var t=[],n=0;n >8&255,255&e]},M.USHORT=N(2),E.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},M.SHORT=N(2),E.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},M.UINT24=N(3),E.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},M.ULONG=N(4),E.LONG=function(e){return e>=R&&(e=-(2*R-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},M.LONG=N(4),E.FIXED=E.ULONG,M.FIXED=M.ULONG,E.FWORD=E.SHORT,M.FWORD=M.SHORT,E.UFWORD=E.USHORT,M.UFWORD=M.USHORT,E.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},M.LONGDATETIME=N(8),E.TAG=function(e){return x.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},M.TAG=N(4),E.Card8=E.BYTE,M.Card8=M.BYTE,E.Card16=E.USHORT,M.Card16=M.USHORT,E.OffSize=E.BYTE,M.OffSize=M.BYTE,E.SID=E.USHORT,M.SID=M.USHORT,E.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?E.NUMBER16(e):E.NUMBER32(e)},M.NUMBER=function(e){return E.NUMBER(e).length},E.NUMBER16=function(e){return[28,e>>8&255,255&e]},M.NUMBER16=N(3),E.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},M.NUMBER32=N(5),E.REAL=function(e){var t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){var r=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*r)/r).toString()}for(var i="",a=0,o=t.length;a >8&255,t[t.length]=255&r}return t},M.UTF16=function(e){return 2*e.length};var W={"x-mac-croatian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\u0160\u2122\xb4\xa8\u2260\u017d\xd8\u221e\xb1\u2264\u2265\u2206\xb5\u2202\u2211\u220f\u0161\u222b\xaa\xba\u03a9\u017e\xf8\xbf\xa1\xac\u221a\u0192\u2248\u0106\xab\u010c\u2026 \xc0\xc3\xd5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\uf8ff\xa9\u2044\u20ac\u2039\u203a\xc6\xbb\u2013\xb7\u201a\u201e\u2030\xc2\u0107\xc1\u010d\xc8\xcd\xce\xcf\xcc\xd3\xd4\u0111\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u03c0\xcb\u02da\xb8\xca\xe6\u02c7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\xb0\u0490\xa3\xa7\u2022\xb6\u0406\xae\xa9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\xb1\u2264\u2265\u0456\xb5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e","x-mac-gaelic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u1e02\xb1\u2264\u2265\u1e03\u010a\u010b\u1e0a\u1e0b\u1e1e\u1e1f\u0120\u0121\u1e40\xe6\xf8\u1e41\u1e56\u1e57\u027c\u0192\u017f\u1e60\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u1e61\u1e9b\xff\u0178\u1e6a\u20ac\u2039\u203a\u0176\u0177\u1e6b\xb7\u1ef2\u1ef3\u204a\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\u2663\xd2\xda\xdb\xd9\u0131\xdd\xfd\u0174\u0175\u1e84\u1e85\u1e80\u1e81\u1e82\u1e83","x-mac-greek":"\xc4\xb9\xb2\xc9\xb3\xd6\xdc\u0385\xe0\xe2\xe4\u0384\xa8\xe7\xe9\xe8\xea\xeb\xa3\u2122\xee\xef\u2022\xbd\u2030\xf4\xf6\xa6\u20ac\xf9\xfb\xfc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\xdf\xae\xa9\u03a3\u03aa\xa7\u2260\xb0\xb7\u0391\xb1\u2264\u2265\xa5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\xac\u039f\u03a1\u2248\u03a4\xab\xbb\u2026 \u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\xf7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\xad","x-mac-icelandic":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\xdd\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\xd0\xf0\xde\xfe\xfd\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140a\u140b\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144e\u144f\u1450\u1451\u1455\u1456\u1466\u146d\u146e\u146f\u1470\u1472\u1473\u1483\u148b\u148c\u148d\u148e\u1490\u1491\xb0\u14a1\u14a5\u14a6\u2022\xb6\u14a7\xae\xa9\u2122\u14a8\u14aa\u14ab\u14bb\u14c2\u14c3\u14c4\u14c5\u14c7\u14c8\u14d0\u14ef\u14f0\u14f1\u14f2\u14f4\u14f5\u1505\u14d5\u14d6\u14d7\u14d8\u14da\u14db\u14ea\u1528\u1529\u152a\u152b\u152d\u2026 \u152e\u153e\u1555\u1556\u1557\u2013\u2014\u201c\u201d\u2018\u2019\u1558\u1559\u155a\u155d\u1546\u1547\u1548\u1549\u154b\u154c\u1550\u157f\u1580\u1581\u1582\u1583\u1584\u1585\u158f\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15a0\u15a1\u15a2\u15a3\u15a4\u15a5\u15a6\u157c\u0141\u0142","x-mac-ce":"\xc4\u0100\u0101\xc9\u0104\xd6\xdc\xe1\u0105\u010c\xe4\u010d\u0106\u0107\xe9\u0179\u017a\u010e\xed\u010f\u0112\u0113\u0116\xf3\u0117\xf4\xf6\xf5\xfa\u011a\u011b\xfc\u2020\xb0\u0118\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\u0119\xa8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\xac\u221a\u0144\u0147\u2206\xab\xbb\u2026 \u0148\u0150\xd5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\xc1\u0164\u0165\xcd\u017d\u017e\u016a\xd3\xd4\u016b\u016e\xda\u016f\u0170\u0171\u0172\u0173\xdd\xfd\u0137\u017b\u0141\u017c\u0122\u02c7",macintosh:"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\ufb01\ufb02\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-romanian":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\u0102\u0218\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\u0103\u0219\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7","x-mac-turkish":"\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026 \xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\uf8a0\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7"};k.MACSTRING=function(e,t,n,r){var i=W[r];if(void 0!==i){for(var a="",o=0;o =-128&&e<=127}function L(e,t,n){for(var r=0,i=e.length;t>8&255,l+256&255)}return a}E.MACSTRING=function(e,t){var n=function(e){if(!F)for(var t in F={},W)F[t]=new String(t);var n=F[e];if(void 0!==n){if(V){var r=V.get(n);if(void 0!==r)return r}var i=W[e];if(void 0!==i){for(var a={},o=0;o =128&&void 0===(a=n[a]))return;r[i]=a}return r}},M.MACSTRING=function(e,t){var n=E.MACSTRING(e,t);return void 0!==n?n.length:0},E.VARDELTAS=function(e){for(var t=0,n=[];t =-128&&r<=127?H(e,t,n):X(e,t,n)}return n},E.INDEX=function(e){for(var t=1,n=[t],r=[],i=0;i >8,t[c+1]=255&d,t=t.concat(r[g])}return t},M.TABLE=function(e){for(var t=0,n=e.fields.length,r=0;r 0)return new ne(this.data,this.offset+t).parseStruct(e)},ne.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new ne(this.data,this.offset+t).parseStruct(e)},ne.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),n=t.length,r=this.relativeOffset,i=new Array(n),a=0;a =0;i-=1){var a=ie.getUShort(e,t+4+8*i),o=ie.getUShort(e,t+4+8*i+2);if(3===a&&(0===o||1===o||10===o)||0===a&&(0===o||1===o||2===o||3===o||4===o)){r=ie.getULong(e,t+4+8*i+4);break}}if(-1===r)throw new Error("No valid cmap sub-tables found.");var s=new ie.Parser(e,t+r);if(n.format=s.parseUShort(),12===n.format)!function(e,t){var n;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(var r=0;r >1,t.skip("uShort",3),e.glyphIndexMap={};for(var o=new ie.Parser(n,r+i+14),s=new ie.Parser(n,r+i+16+2*a),l=new ie.Parser(n,r+i+16+4*a),u=new ie.Parser(n,r+i+16+6*a),g=r+i+16+8*a,c=0;c 0;t-=1){if(e.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),n=!1;break}}var r=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:n?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:n?12:20}];n||(r=r.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),r=r.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var i=new J.Table("cmap",r);for(i.segments=[],t=0;t >4,a=15&r;if(15===i)break;if(t+=n[i],15===a)break;t+=n[a]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return 256*(t-247)+e.parseByte()+108;if(t>=251&&t<=254)return 256*-(t-251)-e.parseByte()-108;throw new Error("Invalid b0 "+t)}function we(e,t,n){t=void 0!==t?t:0;var r=new ie.Parser(e,t),i=[],a=[];for(n=void 0!==n?n:e.length;r.relativeOffset >1,d.length=0,I=!0}return function n(u){for(var p,m,B,G,w,Z,S,x,R,k,E,M,N=0;N 1&&!I&&(v=d.shift()+g,I=!0),f+=d.pop(),y(C,f);break;case 5:for(;d.length>0;)C+=d.shift(),f+=d.shift(),c.lineTo(C,f);break;case 6:for(;d.length>0&&(C+=d.shift(),c.lineTo(C,f),0!==d.length);)f+=d.shift(),c.lineTo(C,f);break;case 7:for(;d.length>0&&(f+=d.shift(),c.lineTo(C,f),0!==d.length);)C+=d.shift(),c.lineTo(C,f);break;case 8:for(;d.length>0;)r=C+d.shift(),i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),C=a+d.shift(),f=o+d.shift(),c.curveTo(r,i,a,o,C,f);break;case 10:w=d.pop()+l,(Z=s[w])&&n(Z);break;case 11:return;case 12:switch(W=u[N],N+=1,W){case 35:r=C+d.shift(),i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),S=a+d.shift(),x=o+d.shift(),R=S+d.shift(),k=x+d.shift(),E=R+d.shift(),M=k+d.shift(),C=E+d.shift(),f=M+d.shift(),d.shift(),c.curveTo(r,i,a,o,S,x),c.curveTo(R,k,E,M,C,f);break;case 34:r=C+d.shift(),i=f,a=r+d.shift(),o=i+d.shift(),S=a+d.shift(),x=o,R=S+d.shift(),k=o,E=R+d.shift(),M=f,C=E+d.shift(),c.curveTo(r,i,a,o,S,x),c.curveTo(R,k,E,M,C,f);break;case 36:r=C+d.shift(),i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),S=a+d.shift(),x=o,R=S+d.shift(),k=o,E=R+d.shift(),M=k+d.shift(),C=E+d.shift(),c.curveTo(r,i,a,o,S,x),c.curveTo(R,k,E,M,C,f);break;case 37:r=C+d.shift(),i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),S=a+d.shift(),x=o+d.shift(),R=S+d.shift(),k=x+d.shift(),E=R+d.shift(),M=k+d.shift(),Math.abs(E-C)>Math.abs(M-f)?C=E+d.shift():f=M+d.shift(),c.curveTo(r,i,a,o,S,x),c.curveTo(R,k,E,M,C,f);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+W),d.length=0}break;case 14:d.length>0&&!I&&(v=d.shift()+g,I=!0),h&&(c.closePath(),h=!1);break;case 19:case 20:b(),N+=A+7>>3;break;case 21:d.length>2&&!I&&(v=d.shift()+g,I=!0),f+=d.pop(),y(C+=d.pop(),f);break;case 22:d.length>1&&!I&&(v=d.shift()+g,I=!0),y(C+=d.pop(),f);break;case 24:for(;d.length>2;)r=C+d.shift(),i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),C=a+d.shift(),f=o+d.shift(),c.curveTo(r,i,a,o,C,f);C+=d.shift(),f+=d.shift(),c.lineTo(C,f);break;case 25:for(;d.length>6;)C+=d.shift(),f+=d.shift(),c.lineTo(C,f);r=C+d.shift(),i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),C=a+d.shift(),f=o+d.shift(),c.curveTo(r,i,a,o,C,f);break;case 26:for(d.length%2&&(C+=d.shift());d.length>0;)r=C,i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),C=a,f=o+d.shift(),c.curveTo(r,i,a,o,C,f);break;case 27:for(d.length%2&&(f+=d.shift());d.length>0;)r=C+d.shift(),i=f,a=r+d.shift(),o=i+d.shift(),C=a+d.shift(),f=o,c.curveTo(r,i,a,o,C,f);break;case 28:p=u[N],m=u[N+1],d.push((p<<24|m<<16)>>16),N+=2;break;case 29:w=d.pop()+e.gsubrsBias,(Z=e.gsubrs[w])&&n(Z);break;case 30:for(;d.length>0&&(r=C,i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),C=a+d.shift(),f=o+(1===d.length?d.shift():0),c.curveTo(r,i,a,o,C,f),0!==d.length);)r=C+d.shift(),i=f,a=r+d.shift(),o=i+d.shift(),f=o+d.shift(),C=a+(1===d.length?d.shift():0),c.curveTo(r,i,a,o,C,f);break;case 31:for(;d.length>0&&(r=C+d.shift(),i=f,a=r+d.shift(),o=i+d.shift(),f=o+d.shift(),C=a+(1===d.length?d.shift():0),c.curveTo(r,i,a,o,C,f),0!==d.length);)r=C,i=f+d.shift(),a=r+d.shift(),o=i+d.shift(),C=a+d.shift(),f=o+(1===d.length?d.shift():0),c.curveTo(r,i,a,o,C,f);break;default:W<32?console.log("Glyph "+t.index+": unknown operator "+W):W<247?d.push(W-139):W<251?(p=u[N],N+=1,d.push(256*(W-247)+p+108)):W<255?(p=u[N],N+=1,d.push(256*-(W-251)-p-108)):(p=u[N],m=u[N+1],B=u[N+2],G=u[N+3],N+=4,d.push((p<<24|m<<16|B<<8|G)/65536))}}}(n),t.advanceWidth=v,c}function We(e,t){var n,r=se.indexOf(e);return r>=0&&(n=r),(r=t.indexOf(e))>=0?n=r+se.length:(n=se.length+t.length,t.push(e)),n}function Fe(e,t,n){for(var r={},i=0;i =r)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+r+")");a.push(i)}else{if(3!==s)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+s);var u,g=o.parseCard16(),c=o.parseCard16();if(0!==c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var d=0;d =r)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+r+")");if(u>n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+u);for(;c=1&&(n.ulCodePageRange1=r.parseULong(),n.ulCodePageRange2=r.parseULong()),n.version>=2&&(n.sxHeight=r.parseShort(),n.sCapHeight=r.parseShort(),n.usDefaultChar=r.parseUShort(),n.usBreakChar=r.parseUShort(),n.usMaxContent=r.parseUShort()),n},make:function(e){return new J.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:it,getUnicodeRange:function(e){for(var t=0;t =n.begin&&e =ge.length){var o=r.parseChar();n.names.push(r.parseString(o))}break;case 2.5:n.numberOfGlyphs=r.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(var s=0;s t.value.tag?1:-1})),t.fields=t.fields.concat(r),t.fields=t.fields.concat(i),t}function Ct(e,t,n){for(var r=0;r 0)return e.glyphs.get(i).getMetrics()}return n}function ft(e){for(var t=0,n=0;n C||void 0===t)&&C>0&&(t=C),u 123 are reserved for internal usage");A|=1< 0?Ke.make(M):void 0,F=ot.make(),V=He.make(e.glyphs,{version:e.getEnglishName("version"),fullName:x,familyName:Z,weightName:S,postScriptName:R,unitsPerEm:e.unitsPerEm,fontBBox:[0,m.yMin,m.ascender,m.advanceWidthMax]}),T=e.metas&&Object.keys(e.metas).length>0?ct.make(e.metas):void 0,L=[v,y,b,B,N,w,F,V,G];W&&L.push(W),e.tables.gsub&&L.push(gt.make(e.tables.gsub)),T&&L.push(T);for(var H=ht(L),X=At(H.encode()),Y=H.fields,_=!1,K=0;K >>1,a=e[i].tag;if(a===t)return i;a >>1,a=e[i];if(a===t)return i;a >>1,o=(n=e[a]).start;if(o===t)return n;o 0)return t>(n=e[r-1]).end?0:n}function bt(e,t){this.font=e,this.tableName=t}function Bt(e){bt.call(this,e,"gpos")}function Gt(e){bt.call(this,e,"gsub")}function wt(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r 0?(a=e.parseByte(),0===(t&i)&&(a=-a),a=n+a):a=(t&i)>0?n:n+e.parseShort(),a}function Rt(e,t,n){var r,i,a=new ie.Parser(t,n);if(e.numberOfContours=a.parseShort(),e._xMin=a.parseShort(),e._yMin=a.parseShort(),e._xMax=a.parseShort(),e._yMax=a.parseShort(),e.numberOfContours>0){for(var o=e.endPointIndices=[],s=0;s 0)for(var c=a.parseByte(),d=0;d 0){var A,I=[];if(u>0){for(var h=0;h=0,I.push(A);for(var C=0,f=0;f