/*! For license information please see common.c11589dd.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(131).concat([function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return d}));var r=n(0),i=n.n(r);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var c=i.a.createContext({}),l=function(t){var e=i.a.useContext(c),n=e;return t&&(n="function"==typeof t?t(e):s(s({},e),t)),n},h=function(t){var e=l(t.components);return i.a.createElement(c.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return i.a.createElement(i.a.Fragment,{},e)}},p=i.a.forwardRef((function(t,e){var n=t.components,r=t.mdxType,o=t.originalType,a=t.parentName,c=u(t,["components","mdxType","originalType","parentName"]),h=l(n),p=r,d=h["".concat(a,".").concat(p)]||h[p]||f[p]||o;return n?i.a.createElement(d,s(s({ref:e},c),{},{components:n})):i.a.createElement(d,s({ref:e},c))}));function d(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var o=n.length,a=new Array(o);a[0]=p;var s={};for(var u in e)hasOwnProperty.call(e,u)&&(s[u]=e[u]);s.originalType=t,s.mdxType="string"==typeof t?t:r,a[1]=s;for(var c=2;c0)&&(h.unobserve(e),h.disconnect(),n())}))}))).observe(e))},to:E||""},f&&{activeClassName:m}))}},function(t,e,n){"use strict";var r=n(136),i=n(0),o=n.n(i),a=n(141),s=n(135),u=n(132),c=function(){var t=Object(i.useState)({}),e=t[0],n=t[1],r=Object(i.useCallback)((function(t,e){try{localStorage.setItem("docusaurus.tab."+t,e)}catch(n){console.error(n)}}),[]);return Object(i.useEffect)((function(){try{for(var t={},e=0;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function g(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,i)}function b(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){g(o,r,i,a,s,"next",t)}function s(t){g(o,r,i,a,s,"throw",t)}a(void 0)}))}}var x=n(166),_=function(t){return t.split(" ").map((function(t){return t.trim().toLowerCase()})).filter((function(t){return t.length>0}))},w=x,E=n(167),S=n.n(E),T=n(142),M=n(168),P=n.n(M);n(46),n(47);function O(t,e){if(e.endsWith("/"))throw new Error("prefix must not end with a /. This is a bug.");return t===e||t.startsWith(e+"/")}function A(t){return fetch(t+"search-index.json").then((function(t){return t.json()})).then((function(t){return{documents:t.documents,index:w.Index.load(t.index)}}))}function C(){return R.apply(this,arguments)}function R(){return(R=b(m.a.mark((function t(){var e;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.e(78).then(n.t.bind(null,211,7));case 2:return(e=t.sent).noConflict(),t.abrupt("return",e.default);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var I=function(t){var e=t.isSearchBarExpanded,n=t.handleSearchBarToggle,a=Object(i.useRef)("empty"),u=Object(i.useRef)(null),c=Object(s.a)().siteConfig.baseUrl,l=P()(),h=l.versioningEnabled,f=l.versions,p=l.latestVersion,d=Object(T.useHistory)(),y=Object(T.useLocation)(),g=Object(i.useRef)(!1),x=Object(i.useState)(p),E=x[0],M=x[1];Object(i.useEffect)((function(){h&&M(function(t,e,n,r){for(var i,o=v(["next"].concat(r.slice(1)));!(i=o()).done;){var a=i.value;if(O(t,""+e+n+"/"+a))return a}return r[0]}(y.pathname,c,"docs",f))}),[y,c,f]),Object(i.useEffect)((function(){var t,e=function(t,e){var n=t.search;0===n.indexOf("?")&&(n=n.slice(1));for(var r,i=e+"=",o=v(n.split("&"));!(r=o()).done;){var a=r.value;if(a.startsWith(i))return a.substr(i.length)}return null}(y,"highlight");if(e&&(t=function(t){return window.location.pathname.startsWith(t+"docs")||window.location.pathname.startsWith(t+"blog")}(c)?document.getElementsByTagName("article")[0]:document.getElementsByTagName("main")[0])){var n=e.split(/(?0})).map((function(t){return t.replace(/~~/g,"~")}));if(0!==n.length){var r=new S.a(t),i={ignoreJoiners:!0};return r.mark(n,i),function(){return r.unmark(i)}}}}),[y,c]);var R=function(){var t=b(m.a.mark((function t(){var e,n,r,i,o;return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("empty"===a.current){t.next=2;break}return t.abrupt("return");case 2:return a.current="loading",t.next=5,Promise.all([A(c),C()]);case 5:e=t.sent,n=e[0],r=n.index,i=n.documents,(o=e[1])(u.current,{hint:!1,autoselect:!0,cssClasses:{root:"d-s-l-a"}},[{source:function(t,e){var n=_(t);e(r.query((function(t){t.term(n,{fields:["title"],boost:5}),t.term(n,{fields:["title"],boost:5,wildcard:w.Query.wildcard.TRAILING}),t.term(n,{fields:["content"],boost:1}),t.term(n,{fields:["content"],boost:1,wildcard:w.Query.wildcard.TRAILING}),h&&t.term(E,{fields:["version"],boost:0,presence:w.Query.presence.REQUIRED})})).filter((function(t){return t.score>0})).slice(0,8).map((function(t){return{document:i.find((function(e){return e.id.toString()===t.ref})),score:t.score,terms:n}})))},templates:{suggestion:function(t){var e=t.document,n=(t.score,o.escapeHighlightedString),r=''+n(e.pageTitle)+"";return e.pageTitle!==e.sectionTitle&&(r+=''+n(e.sectionTitle)+""),r},empty:function(){return''}}}]).on("autocomplete:selected",(function(t,e,n,r){var i=e.document,o=e.terms,a=i.sectionRoute.split("#"),s=a[0],u=a[1],c=s;c+="?highlight="+encodeURIComponent(o.map((function(t){return t.replace(/~/g,"~~")})).join("~")),u&&(c+="#"+u),d.push(c)})),g.current&&u.current.focus(),a.current="done";case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),I=function(){var t=b(m.a.mark((function t(){return m.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R();case 2:u.current.focus(),n(!e);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),k="Search";return h&&(k+=" ["+E+"]"),o.a.createElement("div",{className:"navbar__search",key:"search-box"},o.a.createElement("span",{"aria-label":"expand searchbar",role:"button",className:Object(r.a)("search-icon",{"search-icon-hidden":e}),onClick:I,onKeyDown:I,tabIndex:0}),o.a.createElement("input",{id:"search_input_react",type:"search",placeholder:k,"aria-label":"Search",className:Object(r.a)("navbar__search-input",{"search-bar-expanded":e},{"search-bar":!e}),onMouseOver:function(){R()},onFocus:function(){g.current=!0,R()},onBlur:function(){n(!e)},ref:u}))},k=n(152),L=n(153),j=n(170),D=n.n(j),N=n(6),B=n(150),F={default:function(){return B.a},docsVersion:function(){return n(171).default},docsVersionDropdown:function(){return n(175).default}};function U(t){var e=t.type,n=Object(N.a)(t,["type"]),r=function(t){void 0===t&&(t="default");var e=F[t];if(!e)throw new Error("No NavbarItem component found for type="+t+".");return e()}(e);return o.a.createElement(r,n)}var G=function(){var t=Object(s.a)(),e=t.siteConfig.themeConfig.navbar,n=e.items,a=e.logo,u=t.isClient,c=Object(i.useState)(!1),l=c[0],h=c[1],f=Object(i.useState)(!1),d=f[0],m=f[1];Object(k.a)(l);var y=Object(i.useCallback)((function(){h(!0)}),[]),v=Object(i.useCallback)((function(){h(!1)}),[]),g=Object(L.a)();Object(i.useEffect)((function(){g===L.b.desktop&&h(!1)}),[g]);var b=function(t){return{leftItems:t.filter((function(t){var e;return"left"===(null!==(e=t.position)&&void 0!==e?e:"right")})),rightItems:t.filter((function(t){var e;return"right"===(null!==(e=t.position)&&void 0!==e?e:"right")}))}}(n),x=b.leftItems,_=b.rightItems;return o.a.createElement("nav",{className:Object(r.a)("navbar","navbar--light","navbar--fixed-top",{"navbar-sidebar--show":l})},o.a.createElement("div",{className:"navbar__inner"},o.a.createElement("div",{className:"navbar__items"},o.a.createElement("div",{"aria-label":"Navigation bar toggle",className:"navbar__toggle",role:"button",tabIndex:0,onClick:y,onKeyDown:y},o.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",role:"img",focusable:"false"},o.a.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))),o.a.createElement("a",{className:Object(r.a)("navbar__brand",D.a.brand),href:"/"},o.a.createElement("img",{alt:a.alt,className:"navbar__logo",key:u.toString(),src:a.src})),x.map((function(t,e){return o.a.createElement(U,Object(p.a)({},t,{key:e}))}))),o.a.createElement("div",{className:"navbar__items navbar__items--right"},_.map((function(t,e){return o.a.createElement(U,Object(p.a)({},t,{key:e}))})),o.a.createElement(I,{handleSearchBarToggle:m,isSearchBarExpanded:d}))),o.a.createElement("div",{role:"presentation",className:"navbar-sidebar__backdrop",onClick:v}),o.a.createElement("div",{className:"navbar-sidebar"},o.a.createElement("div",{className:"navbar-sidebar__brand"},o.a.createElement("a",{className:Object(r.a)("navbar__brand",D.a.brand),href:"/",onClick:v},o.a.createElement("img",{alt:a.alt,key:u.toString(),className:"navbar__logo",src:a.src}))),o.a.createElement("div",{className:"navbar-sidebar__items"},o.a.createElement("div",{className:"menu"},o.a.createElement("ul",{className:"menu__list"},n.map((function(t,e){return o.a.createElement(U,Object(p.a)({mobile:!0},t,{onClick:v,key:e}))})))))))},H=n(144),z=n(146),V=n.n(z),W=n(176),X=n.n(W),Y=function(){var t,e=Object(s.a)().siteConfig,n=Object(H.b)();return o.a.createElement("footer",{className:Object(r.a)(X.a.footer,V.a.section,(t={},t[X.a["footer--alt"]]=!0===n.altFooter,t))},o.a.createElement("div",{className:X.a.footer__bottom},o.a.createElement("p",{className:X.a.footer__copyright},e.customFields.copyright,",\xa0",o.a.createElement("a",{href:"mailto:vesecky.adam@gmail.com"},"vesecky.adam@gmail.com"))))},q=n(177),K=n.n(q),J=function(t){var e,n=t.children,i=t.flex,c=t.title,l=t.noFooter,h=t.description,p=t.image,d=t.permalink,m=Object(s.a)().siteConfig,y=m.title,v=m.themeConfig.image,g=m.url,b=c?c+" | "+y:y,x=p||v,_=Object(u.a)(x,{absolute:!0});return o.a.createElement(f,null,o.a.createElement(a.a,null,o.a.createElement("title",null,b),d&&o.a.createElement("link",{rel:"canonical",href:g+d}),h&&o.a.createElement("meta",{name:"description",content:h}),o.a.createElement("meta",{property:"og:image",content:_}),o.a.createElement("meta",{property:"og:url",content:""+g+(d||"")}),o.a.createElement("meta",{property:"og:title",content:b}),h&&o.a.createElement("meta",{property:"og:description",content:h}),o.a.createElement("meta",{name:"twitter:image",content:_}),h&&o.a.createElement("meta",{name:"twitter:description",content:h}),o.a.createElement("meta",{name:"twitter:title",content:b}),o.a.createElement("meta",{name:"twitter:image:alt",content:'Image for "'+b+'"'})),o.a.createElement(G,null),o.a.createElement("div",{className:Object(r.a)(K.a.wrapper,(e={},e[K.a.flex]=i,e))},n),!l&&o.a.createElement(Y,null))};J.defaultProps={flex:!1};e.a=J},,function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(161);e.a=function(t){return i.a.createElement(o.a,Object.assign({},t))}},function(t,e,n){"use strict";n.r(e);var r=n(13);n.d(e,"MemoryRouter",(function(){return r.d})),n.d(e,"Prompt",(function(){return r.f})),n.d(e,"Redirect",(function(){return r.g})),n.d(e,"Route",(function(){return r.h})),n.d(e,"Router",(function(){return r.i})),n.d(e,"StaticRouter",(function(){return r.j})),n.d(e,"Switch",(function(){return r.k})),n.d(e,"generatePath",(function(){return r.l})),n.d(e,"matchPath",(function(){return r.m})),n.d(e,"useHistory",(function(){return r.n})),n.d(e,"useLocation",(function(){return r.o})),n.d(e,"useParams",(function(){return r.p})),n.d(e,"useRouteMatch",(function(){return r.q})),n.d(e,"withRouter",(function(){return r.r})),n.d(e,"BrowserRouter",(function(){return r.a})),n.d(e,"HashRouter",(function(){return r.b})),n.d(e,"Link",(function(){return r.c})),n.d(e,"NavLink",(function(){return r.e}))},function(t,e,n){try{t.exports=n(172)}catch(r){t.exports={}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n.n(r),o={altFooter:!1},a=Object(r.createContext)(o),s=function(t){var e=t.children,n=t.value;return i.a.createElement(a.Provider,{value:n||o},e)};e.b=function(){return Object(r.useContext)(a)}},function(t,e,n){"use strict";function r(t){return!0===/^(\w*:|\/\/)/.test(t)}function i(t){return void 0!==t&&!r(t)}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}))},function(t,e,n){t.exports={section:"section_11A8","section--inner":"section--inner_3jy1","section--odd":"section--odd_-Y1y",section__title:"section__title_2gOF",section__subtitle:"section__subtitle_1hHa"}},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(136),a=n(131),s=n(141),u=n(138),c=n(158),l=n(132),h=n(91),f=n.n(h),p=["January","February","March","April","May","June","July","August","September","October","November","December"];e.a=function(t){var e,n,r,h,d,m=t.children,y=t.frontMatter,v=t.metadata,g=t.truncated,b=t.isBlogPostPage,x=void 0!==b&&b,_=v.date,w=v.permalink,E=v.tags,S=v.readingTime,T=y.author,M=y.title,P=y.image,O=y.keywords,A=y.author_url||y.authorURL,C=y.author_title||y.authorTitle,R=y.author_image_url||y.authorImageURL,I=Object(l.a)(P,{absolute:!0});return i.a.createElement(i.a.Fragment,null,i.a.createElement(s.a,null,O&&O.length&&i.a.createElement("meta",{name:"keywords",content:O.join(",")}),P&&i.a.createElement("meta",{property:"og:image",content:I}),P&&i.a.createElement("meta",{property:"twitter:image",content:I}),P&&i.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+M})),i.a.createElement("article",{className:x?void 0:"margin-bottom--xl"},(e=x?"h1":"h2",n=_.substring(0,10).split("-"),r=n[0],h=p[parseInt(n[1],10)-1],d=parseInt(n[2],10),i.a.createElement("header",null,i.a.createElement(e,{className:Object(o.a)("margin-bottom--sm",f.a.blogPostTitle)},x?M:i.a.createElement(u.a,{to:w},M)),i.a.createElement("div",{className:"margin-vert--md"},i.a.createElement("time",{dateTime:_,className:f.a.blogPostDate},h," ",d,", ",r," ",S&&i.a.createElement(i.a.Fragment,null," \xb7 ",Math.ceil(S)," min read"))),i.a.createElement("div",{className:"avatar margin-vert--md"},R&&i.a.createElement("a",{className:"avatar__photo-link avatar__photo",href:A,target:"_blank",rel:"noreferrer noopener"},i.a.createElement("img",{src:R,alt:T})),i.a.createElement("div",{className:"avatar__intro"},T&&i.a.createElement(i.a.Fragment,null,i.a.createElement("h4",{className:"avatar__name"},i.a.createElement("a",{href:A,target:"_blank",rel:"noreferrer noopener"},T)),i.a.createElement("small",{className:"avatar__subtitle"},C)))))),i.a.createElement("section",{className:"markdown"},i.a.createElement(a.a,{components:c.a},m)),(E.length>0||g)&&i.a.createElement("footer",{className:"row margin-vert--lg"},E.length>0&&i.a.createElement("div",{className:"col"},i.a.createElement("strong",null,"Tags:"),E.map((function(t){var e=t.label,n=t.permalink;return i.a.createElement(u.a,{key:n,className:"margin-horiz--sm",to:n},e)}))),g&&i.a.createElement("div",{className:"col text--right"},i.a.createElement(u.a,{to:v.permalink,"aria-label":"Read more about "+M},i.a.createElement("strong",null,"Read More"))))))}},,,function(t,e,n){"use strict";var r,i=n(2),o=n(6),a=n(0),s=n.n(a),u=n(136),c=n(138),l=n(132);var h=function(){if(void 0!==r)return r;var t=!1,e={get passive(){t=!0}},n=function(){};return window.addEventListener("t",n,e),window.removeEventListener("t",n,e),r=t,t},f=a.useLayoutEffect,p=function(t){var e=Object(a.useRef)(t);return f((function(){e.current=t})),e},d=["mousedown","touchstart"],m=function(t){if("touchstart"===t)return h()?{passive:!0}:void 0};var y=function(t,e){var n=p(e);Object(a.useEffect)((function(){if(e){var r=function(e){t.current&&n.current&&!t.current.contains(e.target)&&n.current(e)};return d.forEach((function(t){document.addEventListener(t,r,m(t))})),function(){d.forEach((function(t){document.removeEventListener(t,r,m(t))}))}}}),[!e])};function v(t){var e=t.activeBasePath,n=t.activeBaseRegex,r=t.to,a=t.href,u=t.label,h=t.activeClassName,f=void 0===h?"navbar__link--active":h,p=t.prependBaseUrlToHref,d=Object(o.a)(t,["activeBasePath","activeBaseRegex","to","href","label","activeClassName","prependBaseUrlToHref"]),m=Object(l.a)(r),y=Object(l.a)(e),v=Object(l.a)(a,{forcePrependBaseUrl:!0});return s.a.createElement(c.a,Object(i.a)({},a?{target:"_blank",rel:"noopener noreferrer",href:p?v:a}:Object.assign({isNavLink:!0,activeClassName:f,to:m},e||n?{isActive:function(t,e){return n?new RegExp(n).test(e.pathname):e.pathname.startsWith(y)}}:null),d),u)}function g(t){var e=t.items,n=t.position,r=t.className,c=Object(o.a)(t,["items","position","className"]),l=s.a.useRef(null),h=s.a.useRef(null),f=Object(a.useState)(!1),p=f[0],d=f[1];function m(t){if(t){var e,n,r=null==h||null===(e=h.current)||void 0===e||null===(n=e.firstChild)||void 0===n?void 0:n.firstChild;r&&r.focus()}d(t)}y(l,(function(){return m(!1)}));var g=function(t,e){return void 0===e&&(e=!1),Object(u.a)({"navbar__item navbar__link":!e,dropdown__link:e},t)};return e?s.a.createElement("div",{ref:l,className:Object(u.a)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--left":"left"===n,"dropdown--right":"right"===n,"dropdown--show":p})},s.a.createElement(v,Object(i.a)({className:g(r)},c,{onClick:c.to?void 0:function(t){return t.preventDefault()},onKeyDown:function(t){("Enter"===t.key&&!c.to||"Tab"===t.key)&&(t.preventDefault(),m(!0))}}),c.label),s.a.createElement("ul",{ref:h,className:"dropdown__menu"},e.map((function(t,n){var r=t.className,a=Object(o.a)(t,["className"]);return s.a.createElement("li",{key:n},s.a.createElement(v,Object(i.a)({onKeyDown:function(t){n===e.length-1&&"Tab"===t.key&&(t.preventDefault(),m(!1))},activeClassName:"dropdown__link--active",className:g(r,!0)},a)))})))):s.a.createElement(v,Object(i.a)({className:g(r)},c))}function b(t){var e=t.items,n=(t.position,t.className),r=Object(o.a)(t,["items","position","className"]),a=function(t,e){return void 0===e&&(e=!1),Object(u.a)("menu__link",{"menu__link--sublist":e},t)};return e?s.a.createElement("li",{className:"menu__list-item"},s.a.createElement(v,Object(i.a)({className:a(n,!0)},r),r.label),s.a.createElement("ul",{className:"menu__list"},e.map((function(t,e){var n=t.className,u=Object(o.a)(t,["className"]);return s.a.createElement("li",{className:"menu__list-item",key:e},s.a.createElement(v,Object(i.a)({activeClassName:"menu__link--active",className:a(n)},u,{onClick:r.onClick})))})))):s.a.createElement("li",{className:"menu__list-item"},s.a.createElement(v,Object(i.a)({className:a(n)},r)))}e.a=function(t){var e=t.mobile,n=void 0!==e&&e,r=Object(o.a)(t,["mobile"]),i=n?b:g;return s.a.createElement(i,r)}},function(t,e,n){"use strict";var r=n(0),i=Object(r.createContext)(void 0);e.a=i},function(t,e,n){"use strict";var r=n(0);e.a=function(t){void 0===t&&(t=!0),Object(r.useEffect)((function(){return document.body.style.overflow=t?"hidden":"visible",function(){document.body.style.overflow="visible"}}),[t])}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i}));var r=n(0),i={desktop:"desktop",mobile:"mobile"};e.a=function(){var t="undefined"!=typeof window;function e(){if(t)return window.innerWidth>996?i.desktop:i.mobile}var n=Object(r.useState)(e),o=n[0],a=n[1];return Object(r.useEffect)((function(){if(t)return window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)};function n(){a(e())}}),[]),o}},,,,,function(t,e,n){"use strict";var r=n(2),i=n(0),o=n.n(i),a=n(138),s=n(136),u={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","at-rule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},c={Prism:n(20).a,theme:u};function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h(){return(h=Object.assign||function(t){for(var e=1;e0&&t[n-1]===e?t:t.concat(e)},m=function(t,e){var n=t.plain,r=Object.create(null),i=t.styles.reduce((function(t,n){var r=n.languages,i=n.style;return r&&!r.includes(e)||n.types.forEach((function(e){var n=h({},t[e],i);t[e]=n})),t}),r);return i.root=n,i.plain=h({},n,{backgroundColor:null}),i};function y(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}var v=function(t){function e(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),l(this,"getThemeDict",(function(t){if(void 0!==e.themeDict&&t.theme===e.prevTheme&&t.language===e.prevLanguage)return e.themeDict;e.prevTheme=t.theme,e.prevLanguage=t.language;var n=t.theme?m(t.theme,t.language):void 0;return e.themeDict=n})),l(this,"getLineProps",(function(t){var n=t.key,r=t.className,i=t.style,o=h({},y(t,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),a=e.getThemeDict(e.props);return void 0!==a&&(o.style=a.plain),void 0!==i&&(o.style=void 0!==o.style?h({},o.style,i):i),void 0!==n&&(o.key=n),r&&(o.className+=" "+r),o})),l(this,"getStyleForToken",(function(t){var n=t.types,r=t.empty,i=n.length,o=e.getThemeDict(e.props);if(void 0!==o){if(1===i&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===i&&!r)return o[n[0]];var a=r?{display:"inline-block"}:{},s=n.map((function(t){return o[t]}));return Object.assign.apply(Object,[a].concat(s))}})),l(this,"getTokenProps",(function(t){var n=t.key,r=t.className,i=t.style,o=t.token,a=h({},y(t,["key","className","style","token"]),{className:"token "+o.types.join(" "),children:o.content,style:e.getStyleForToken(o),key:void 0});return void 0!==i&&(a.style=void 0!==a.style?h({},a.style,i):i),void 0!==n&&(a.key=n),r&&(a.className+=" "+r),a}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=this.props,e=t.Prism,n=t.language,r=t.code,i=t.children,o=this.getThemeDict(this.props),a=e.languages[n];return i({tokens:function(t){for(var e=[[]],n=[t],r=[0],i=[t.length],o=0,a=0,s=[],u=[s];a>-1;){for(;(o=r[a]++)0?l:["plain"],c=h):(l=d(l,h.type),h.alias&&(l=d(l,h.alias)),c=h.content),"string"==typeof c){var m=c.split(f),y=m.length;s.push({types:l,content:m[0]});for(var v=1;v0}))}a&&O.test(a)&&(S=a.match(O)[0].split("title=")[1].replace(/"+/g,""));var R=n&&n.replace(/language-/,"");!R&&l.defaultLanguage&&(R=l.defaultLanguage);var I=e.replace(/\n$/,"");if(0===x.length&&void 0!==R){for(var k,L="",j=function(t){switch(t){case"js":case"javascript":case"ts":case"typescript":return P(["js","jsBlock"]);case"jsx":case"tsx":return P(["js","jsBlock","jsx"]);case"html":return P(["js","jsBlock","html"]);case"python":case"py":return P(["python"]);default:return P()}}(R),D=e.replace(/\n$/,"").split("\n"),N=0;N=0&&o<=n&&(e=i),t+=1}return e}();if(s){var u=0,c=!1;for(i=document.getElementsByClassName(t);u=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},W=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},X=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!1===e?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},Y=function(t){var e=Z(t,x.TITLE),n=Z(t,N);if(n&&e)return n.replace(/%s/g,(function(){return Array.isArray(e)?e.join(""):e}));var r=Z(t,k);return e||r||void 0},q=function(t){return Z(t,D)||function(){}},K=function(t,e){return e.filter((function(e){return void 0!==e[t]})).map((function(e){return e[t]})).reduce((function(t,e){return z({},t,e)}),{})},J=function(t,e){return e.filter((function(t){return void 0!==t[x.BASE]})).map((function(t){return t[x.BASE]})).reverse().reduce((function(e,n){if(!e.length)for(var r=Object.keys(n),i=0;i=0;n--){var r=t[n];if(r.hasOwnProperty(e))return r[e]}return null},$=(r=Date.now(),function(t){var e=Date.now();e-r>16?(r=e,t(e)):setTimeout((function(){$(t)}),0)}),tt=function(t){return clearTimeout(t)},et="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||$:t.requestAnimationFrame||$,nt="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||tt:t.cancelAnimationFrame||tt,rt=function(t){return console&&"function"==typeof console.warn&&console.warn(t)},it=null,ot=function(t,e){var n=t.baseTag,r=t.bodyAttributes,i=t.htmlAttributes,o=t.linkTags,a=t.metaTags,s=t.noscriptTags,u=t.onChangeClientState,c=t.scriptTags,l=t.styleTags,h=t.title,f=t.titleAttributes;ut(x.BODY,r),ut(x.HTML,i),st(h,f);var p={baseTag:ct(x.BASE,n),linkTags:ct(x.LINK,o),metaTags:ct(x.META,a),noscriptTags:ct(x.NOSCRIPT,s),scriptTags:ct(x.SCRIPT,c),styleTags:ct(x.STYLE,l)},d={},m={};Object.keys(p).forEach((function(t){var e=p[t],n=e.newTags,r=e.oldTags;n.length&&(d[t]=n),r.length&&(m[t]=p[t].oldTags)})),e&&e(),u(t,d,m)},at=function(t){return Array.isArray(t)?t.join(""):t},st=function(t,e){void 0!==t&&document.title!==t&&(document.title=at(t)),ut(x.TITLE,e)},ut=function(t,e){var n=document.getElementsByTagName(t)[0];if(n){for(var r=n.getAttribute("data-react-helmet"),i=r?r.split(","):[],o=[].concat(i),a=Object.keys(e),s=0;s=0;h--)n.removeAttribute(o[h]);i.length===o.length?n.removeAttribute("data-react-helmet"):n.getAttribute("data-react-helmet")!==a.join(",")&&n.setAttribute("data-react-helmet",a.join(","))}},ct=function(t,e){var n=document.head||document.querySelector(x.HEAD),r=n.querySelectorAll(t+"[data-react-helmet]"),i=Array.prototype.slice.call(r),o=[],a=void 0;return e&&e.length&&e.forEach((function(e){var n=document.createElement(t);for(var r in e)if(e.hasOwnProperty(r))if(r===T)n.innerHTML=e.innerHTML;else if(r===w)n.styleSheet?n.styleSheet.cssText=e.cssText:n.appendChild(document.createTextNode(e.cssText));else{var s=void 0===e[r]?"":e[r];n.setAttribute(r,s)}n.setAttribute("data-react-helmet","true"),i.some((function(t,e){return a=e,n.isEqualNode(t)}))?i.splice(a,1):o.push(n)})),i.forEach((function(t){return t.parentNode.removeChild(t)})),o.forEach((function(t){return n.appendChild(t)})),{oldTags:i,newTags:o}},lt=function(t){return Object.keys(t).reduce((function(e,n){var r=void 0!==t[n]?n+'="'+t[n]+'"':""+n;return e?e+" "+r:r}),"")},ht=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(e,n){return e[I[n]||n]=t[n],e}),e)},ft=function(t,e,n){switch(t){case x.TITLE:return{toComponent:function(){return t=e.title,n=e.titleAttributes,(r={key:t})["data-react-helmet"]=!0,i=ht(n,r),[d.a.createElement(x.TITLE,i,t)];var t,n,r,i},toString:function(){return function(t,e,n,r){var i=lt(n),o=at(e);return i?"<"+t+' data-react-helmet="true" '+i+">"+X(o,r)+"":"<"+t+' data-react-helmet="true">'+X(o,r)+""}(t,e.title,e.titleAttributes,n)}};case v:case g:return{toComponent:function(){return ht(e)},toString:function(){return lt(e)}};default:return{toComponent:function(){return function(t,e){return e.map((function(e,n){var r,i=((r={key:n})["data-react-helmet"]=!0,r);return Object.keys(e).forEach((function(t){var n=I[t]||t;if(n===T||n===w){var r=e.innerHTML||e.cssText;i.dangerouslySetInnerHTML={__html:r}}else i[n]=e[t]})),d.a.createElement(t,i)}))}(t,e)},toString:function(){return function(t,e,n){return e.reduce((function(e,r){var i=Object.keys(r).filter((function(t){return!(t===T||t===w)})).reduce((function(t,e){var i=void 0===r[e]?e:e+'="'+X(r[e],n)+'"';return t?t+" "+i:i}),""),o=r.innerHTML||r.cssText||"",a=-1===F.indexOf(t);return e+"<"+t+' data-react-helmet="true" '+i+(a?"/>":">"+o+"")}),"")}(t,e,n)}}}},pt=function(t){var e=t.baseTag,n=t.bodyAttributes,r=t.encode,i=t.htmlAttributes,o=t.linkTags,a=t.metaTags,s=t.noscriptTags,u=t.scriptTags,c=t.styleTags,l=t.title,h=void 0===l?"":l,f=t.titleAttributes;return{base:ft(x.BASE,e,r),bodyAttributes:ft(v,n,r),htmlAttributes:ft(g,i,r),link:ft(x.LINK,o,r),meta:ft(x.META,a,r),noscript:ft(x.NOSCRIPT,s,r),script:ft(x.SCRIPT,u,r),style:ft(x.STYLE,c,r),title:ft(x.TITLE,{title:h,titleAttributes:f},r)}},dt=l()((function(t){return{baseTag:J([E,R],t),bodyAttributes:K(v,t),defer:Z(t,L),encode:Z(t,j),htmlAttributes:K(g,t),linkTags:Q(x.LINK,[A,E],t),metaTags:Q(x.META,[P,_,S,O,M],t),noscriptTags:Q(x.NOSCRIPT,[T],t),onChangeClientState:q(t),scriptTags:Q(x.SCRIPT,[C,T],t),styleTags:Q(x.STYLE,[w],t),title:Y(t),titleAttributes:K(b,t)}}),(function(t){it&&nt(it),t.defer?it=et((function(){ot(t,(function(){it=null}))})):(ot(t),it=null)}),pt)((function(){return null})),mt=(i=dt,a=o=function(t){function e(){return G(this,e),W(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.shouldComponentUpdate=function(t){return!f()(this.props,t)},e.prototype.mapNestedChildrenToProps=function(t,e){if(!e)return null;switch(t.type){case x.SCRIPT:case x.NOSCRIPT:return{innerHTML:e};case x.STYLE:return{cssText:e}}throw new Error("<"+t.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},e.prototype.flattenArrayTypeChildren=function(t){var e,n=t.child,r=t.arrayTypeChildren,i=t.newChildProps,o=t.nestedChildren;return z({},r,((e={})[n.type]=[].concat(r[n.type]||[],[z({},i,this.mapNestedChildrenToProps(n,o))]),e))},e.prototype.mapObjectTypeChildren=function(t){var e,n,r=t.child,i=t.newProps,o=t.newChildProps,a=t.nestedChildren;switch(r.type){case x.TITLE:return z({},i,((e={})[r.type]=a,e.titleAttributes=z({},o),e));case x.BODY:return z({},i,{bodyAttributes:z({},o)});case x.HTML:return z({},i,{htmlAttributes:z({},o)})}return z({},i,((n={})[r.type]=z({},o),n))},e.prototype.mapArrayTypeChildrenToProps=function(t,e){var n=z({},e);return Object.keys(t).forEach((function(e){var r;n=z({},n,((r={})[e]=t[e],r))})),n},e.prototype.warnOnInvalidChildren=function(t,e){return!0},e.prototype.mapChildrenToProps=function(t,e){var n=this,r={};return d.a.Children.forEach(t,(function(t){if(t&&t.props){var i=t.props,o=i.children,a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(e,n){return e[B[n]||n]=t[n],e}),e)}(V(i,["children"]));switch(n.warnOnInvalidChildren(t,o),t.type){case x.LINK:case x.META:case x.NOSCRIPT:case x.SCRIPT:case x.STYLE:r=n.flattenArrayTypeChildren({child:t,arrayTypeChildren:r,newChildProps:a,nestedChildren:o});break;default:e=n.mapObjectTypeChildren({child:t,newProps:e,newChildProps:a,nestedChildren:o})}}})),e=this.mapArrayTypeChildrenToProps(r,e)},e.prototype.render=function(){var t=this.props,e=t.children,n=V(t,["children"]),r=z({},n);return e&&(r=this.mapChildrenToProps(e,r)),d.a.createElement(i,r)},H(e,null,[{key:"canUseDOM",set:function(t){i.canUseDOM=t}}]),e}(d.a.Component),o.propTypes={base:u.a.object,bodyAttributes:u.a.object,children:u.a.oneOfType([u.a.arrayOf(u.a.node),u.a.node]),defaultTitle:u.a.string,defer:u.a.bool,encodeSpecialCharacters:u.a.bool,htmlAttributes:u.a.object,link:u.a.arrayOf(u.a.object),meta:u.a.arrayOf(u.a.object),noscript:u.a.arrayOf(u.a.object),onChangeClientState:u.a.func,script:u.a.arrayOf(u.a.object),style:u.a.arrayOf(u.a.object),title:u.a.string,titleAttributes:u.a.object,titleTemplate:u.a.string},o.defaultProps={defer:!0,encodeSpecialCharacters:!0},o.peek=i.peek,o.rewind=function(){var t=i.rewind();return t||(t=pt({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),t},a);mt.renderStatic=mt.rewind}).call(this,n(28))},function(t,e,n){"use strict";var r,i=n(0),o=(r=i)&&"object"==typeof r&&"default"in r?r.default:r;function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=function(t,e,n){if("function"!=typeof t)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof e)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var u,c=[];function l(){u=t(c.map((function(t){return t.props}))),h.canUseDOM?e(u):n&&(u=n(u))}var h=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i.peek=function(){return u},i.rewind=function(){if(i.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var t=u;return u=void 0,c=[],t};var a=i.prototype;return a.UNSAFE_componentWillMount=function(){c.push(this),l()},a.componentDidUpdate=function(){l()},a.componentWillUnmount=function(){var t=c.indexOf(this);c.splice(t,1),l()},a.render=function(){return o.createElement(r,this.props)},i}(i.PureComponent);return a(h,"displayName","SideEffect("+function(t){return t.displayName||t.name||"Component"}(r)+")"),a(h,"canUseDOM",s),h}}},function(t,e){var n="undefined"!=typeof Element,r="function"==typeof Map,i="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;t.exports=function(t,e){try{return function t(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,u,c,l;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(u=s;0!=u--;)if(!t(e[u],a[u]))return!1;return!0}if(r&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(l=e.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;for(l=e.entries();!(u=l.next()).done;)if(!t(u.value[1],a.get(u.value[0])))return!1;return!0}if(i&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(l=e.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(u=s;0!=u--;)if(e[u]!==a[u])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===a.toString();if((s=(c=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(u=s;0!=u--;)if(!Object.prototype.hasOwnProperty.call(a,c[u]))return!1;if(n&&e instanceof Element)return!1;for(u=s;0!=u--;)if(("_owner"!==c[u]&&"__v"!==c[u]&&"__o"!==c[u]||!e.$$typeof)&&!t(e[c[u]],a[c[u]]))return!1;return!0}return e!=e&&a!=a}(t,e)}catch(a){if((a.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw a}}},function(t,e,n){t.exports=n(165)},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(M){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(M){return{type:"throw",arg:M}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};d[i]=function(){return this};var m=Object.getPrototypeOf,y=m&&m(m(S([])));y&&y!==e&&n.call(y,i)&&(d=y);var v=p.prototype=h.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){var r,i;!function(){var o,a,s,u,c,l,h,f,p,d,m,y,v,g,b,x,_,w,E,S,T,M,P,O,A,C,R=function(t){var e=new R.Builder;return e.pipeline.add(R.trimmer,R.stopWordFilter,R.stemmer),e.searchPipeline.add(R.stemmer),t.call(e,e),e.build()};R.version="2.3.9",R.utils={},R.utils.warn=(o=this,function(t){o.console&&console.warn&&console.warn(t)}),R.utils.asString=function(t){return null==t?"":t.toString()},R.utils.clone=function(t){if(null==t)return t;for(var e=Object.create(null),n=Object.keys(t),r=0;r0){var u=R.utils.clone(e)||{};u.position=[a,s],u.index=i.length,i.push(new R.Token(n.slice(a,o),u))}a=o+1}}return i},R.tokenizer.separator=/[\s\-]+/,R.Pipeline=function(){this._stack=[]},R.Pipeline.registeredFunctions=Object.create(null),R.Pipeline.registerFunction=function(t,e){e in this.registeredFunctions&&R.utils.warn("Overwriting existing registered function: "+e),t.label=e,R.Pipeline.registeredFunctions[t.label]=t},R.Pipeline.warnIfFunctionNotRegistered=function(t){t.label&&t.label in this.registeredFunctions||R.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},R.Pipeline.load=function(t){var e=new R.Pipeline;return t.forEach((function(t){var n=R.Pipeline.registeredFunctions[t];if(!n)throw new Error("Cannot load unregistered function: "+t);e.add(n)})),e},R.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach((function(t){R.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)}),this)},R.Pipeline.prototype.after=function(t,e){R.Pipeline.warnIfFunctionNotRegistered(e);var n=this._stack.indexOf(t);if(-1==n)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,e)},R.Pipeline.prototype.before=function(t,e){R.Pipeline.warnIfFunctionNotRegistered(e);var n=this._stack.indexOf(t);if(-1==n)throw new Error("Cannot find existingFn");this._stack.splice(n,0,e)},R.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},R.Pipeline.prototype.run=function(t){for(var e=this._stack.length,n=0;n1&&(ot&&(n=i),o!=t);)r=n-e,i=e+Math.floor(r/2),o=this.elements[2*i];return o==t||o>t?2*i:os?c+=2:a==s&&(e+=n[u+1]*r[c+1],u+=2,c+=2);return e},R.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},R.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),e=1,n=0;e0){var o,a=i.str.charAt(0);a in i.node.edges?o=i.node.edges[a]:(o=new R.TokenSet,i.node.edges[a]=o),1==i.str.length&&(o.final=!0),r.push({node:o,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var s=i.node.edges["*"];else{s=new R.TokenSet;i.node.edges["*"]=s}if(0==i.str.length&&(s.final=!0),r.push({node:s,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&r.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var u=i.node.edges["*"];else{u=new R.TokenSet;i.node.edges["*"]=u}1==i.str.length&&(u.final=!0),r.push({node:u,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var c,l=i.str.charAt(0),h=i.str.charAt(1);h in i.node.edges?c=i.node.edges[h]:(c=new R.TokenSet,i.node.edges[h]=c),1==i.str.length&&(c.final=!0),r.push({node:c,editsRemaining:i.editsRemaining-1,str:l+i.str.slice(2)})}}}return n},R.TokenSet.fromString=function(t){for(var e=new R.TokenSet,n=e,r=0,i=t.length;r=t;e--){var n=this.uncheckedNodes[e],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}},R.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},R.Index.prototype.search=function(t){return this.query((function(e){new R.QueryParser(t,e).parse()}))},R.Index.prototype.query=function(t){for(var e=new R.Query(this.fields),n=Object.create(null),r=Object.create(null),i=Object.create(null),o=Object.create(null),a=Object.create(null),s=0;s1?1:t},R.Builder.prototype.k1=function(t){this._k1=t},R.Builder.prototype.add=function(t,e){var n=t[this._ref],r=Object.keys(this._fields);this._documents[n]=e||{},this.documentCount+=1;for(var i=0;i=this.length)return R.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},R.QueryLexer.prototype.width=function(){return this.pos-this.start},R.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},R.QueryLexer.prototype.backup=function(){this.pos-=1},R.QueryLexer.prototype.acceptDigitRun=function(){var t,e;do{e=(t=this.next()).charCodeAt(0)}while(e>47&&e<58);t!=R.QueryLexer.EOS&&this.backup()},R.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(R.QueryLexer.TERM)),t.ignore(),t.more())return R.QueryLexer.lexText},R.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(R.QueryLexer.EDIT_DISTANCE),R.QueryLexer.lexText},R.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(R.QueryLexer.BOOST),R.QueryLexer.lexText},R.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(R.QueryLexer.TERM)},R.QueryLexer.termSeparator=R.tokenizer.separator,R.QueryLexer.lexText=function(t){for(;;){var e=t.next();if(e==R.QueryLexer.EOS)return R.QueryLexer.lexEOS;if(92!=e.charCodeAt(0)){if(":"==e)return R.QueryLexer.lexField;if("~"==e)return t.backup(),t.width()>0&&t.emit(R.QueryLexer.TERM),R.QueryLexer.lexEditDistance;if("^"==e)return t.backup(),t.width()>0&&t.emit(R.QueryLexer.TERM),R.QueryLexer.lexBoost;if("+"==e&&1===t.width())return t.emit(R.QueryLexer.PRESENCE),R.QueryLexer.lexText;if("-"==e&&1===t.width())return t.emit(R.QueryLexer.PRESENCE),R.QueryLexer.lexText;if(e.match(R.QueryLexer.termSeparator))return R.QueryLexer.lexTerm}else t.escapeCharacter()}},R.QueryParser=function(t,e){this.lexer=new R.QueryLexer(t),this.query=e,this.currentClause={},this.lexemeIdx=0},R.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=R.QueryParser.parseClause;t;)t=t(this);return this.query},R.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},R.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},R.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},R.QueryParser.parseClause=function(t){var e=t.peekLexeme();if(null!=e)switch(e.type){case R.QueryLexer.PRESENCE:return R.QueryParser.parsePresence;case R.QueryLexer.FIELD:return R.QueryParser.parseField;case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+e.type;throw e.str.length>=1&&(n+=" with value '"+e.str+"'"),new R.QueryParseError(n,e.start,e.end)}},R.QueryParser.parsePresence=function(t){var e=t.consumeLexeme();if(null!=e){switch(e.str){case"-":t.currentClause.presence=R.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=R.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+e.str+"'";throw new R.QueryParseError(n,e.start,e.end)}var r=t.peekLexeme();if(null==r){n="expecting term or field, found nothing";throw new R.QueryParseError(n,e.start,e.end)}switch(r.type){case R.QueryLexer.FIELD:return R.QueryParser.parseField;case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:n="expecting term or field, found '"+r.type+"'";throw new R.QueryParseError(n,r.start,r.end)}}},R.QueryParser.parseField=function(t){var e=t.consumeLexeme();if(null!=e){if(-1==t.query.allFields.indexOf(e.str)){var n=t.query.allFields.map((function(t){return"'"+t+"'"})).join(", "),r="unrecognised field '"+e.str+"', possible fields: "+n;throw new R.QueryParseError(r,e.start,e.end)}t.currentClause.fields=[e.str];var i=t.peekLexeme();if(null==i){r="expecting term, found nothing";throw new R.QueryParseError(r,e.start,e.end)}switch(i.type){case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:r="expecting term, found '"+i.type+"'";throw new R.QueryParseError(r,i.start,i.end)}}},R.QueryParser.parseTerm=function(t){var e=t.consumeLexeme();if(null!=e){t.currentClause.term=e.str.toLowerCase(),-1!=e.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var n=t.peekLexeme();if(null!=n)switch(n.type){case R.QueryLexer.TERM:return t.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return t.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return t.nextClause(),R.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+n.type+"'";throw new R.QueryParseError(r,n.start,n.end)}else t.nextClause()}},R.QueryParser.parseEditDistance=function(t){var e=t.consumeLexeme();if(null!=e){var n=parseInt(e.str,10);if(isNaN(n)){var r="edit distance must be numeric";throw new R.QueryParseError(r,e.start,e.end)}t.currentClause.editDistance=n;var i=t.peekLexeme();if(null!=i)switch(i.type){case R.QueryLexer.TERM:return t.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return t.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return t.nextClause(),R.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new R.QueryParseError(r,i.start,i.end)}else t.nextClause()}},R.QueryParser.parseBoost=function(t){var e=t.consumeLexeme();if(null!=e){var n=parseInt(e.str,10);if(isNaN(n)){var r="boost must be numeric";throw new R.QueryParseError(r,e.start,e.end)}t.currentClause.boost=n;var i=t.peekLexeme();if(null!=i)switch(i.type){case R.QueryLexer.TERM:return t.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return t.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return t.nextClause(),R.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new R.QueryParseError(r,i.start,i.end)}else t.nextClause()}},void 0===(i="function"==typeof(r=function(){return R})?r.call(e,n,e,t):r)||(t.exports=i)}()},function(t,e,n){t.exports=function(){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;e(this,t),this.ctx=n,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return n(t,[{key:"getContexts",value:function(){var t=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach((function(e){var n=t.filter((function(t){return t.contains(e)})).length>0;-1!==t.indexOf(e)||n||t.push(e)})),t}},{key:"getIframeContents",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=t.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(o){n()}r&&e(r)}},{key:"isIframeBlank",value:function(t){var e="about:blank",n=t.getAttribute("src").trim();return t.contentWindow.location.href===e&&n!==e&&n}},{key:"observeIframeLoad",value:function(t,e,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(t)||(t.removeEventListener("load",a),r.getIframeContents(t,e,n))}catch(s){n()}}};t.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(t,e,n){try{"complete"===t.contentWindow.document.readyState?this.isIframeBlank(t)?this.observeIframeLoad(t,e,n):this.getIframeContents(t,e,n):this.observeIframeLoad(t,e,n)}catch(r){n()}}},{key:"waitForIframes",value:function(t,e){var n=this,r=0;this.forEachIframe(t,(function(){return!0}),(function(t){r++,n.waitForIframes(t.querySelector("html"),(function(){--r||e()}))}),(function(t){t||e()}))}},{key:"forEachIframe",value:function(e,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=e.querySelectorAll("iframe"),s=a.length,u=0;a=Array.prototype.slice.call(a);var c=function(){--s<=0&&o(u)};s||c(),a.forEach((function(e){t.matches(e,i.exclude)?c():i.onIframeReady(e,(function(t){n(e)&&(u++,r(t)),c()}),c)}))}},{key:"createIterator",value:function(t,e,n){return document.createNodeIterator(t,e,n,!1)}},{key:"createInstanceOnIframe",value:function(e){return new t(e.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(t,e,n){if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===e)return!0;if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(t){var e=t.previousNode();return{prevNode:e,node:(null===e||t.nextNode())&&t.nextNode()}}},{key:"checkIframeFilter",value:function(t,e,n,r){var i=!1,o=!1;return r.forEach((function(t,e){t.val===n&&(i=e,o=t.handled)})),this.compareNodeIframe(t,e,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(t,e,n,r){var i=this;t.forEach((function(t){t.handled||i.getIframeContents(t.val,(function(t){i.createInstanceOnIframe(t).forEachNode(e,n,r)}))}))}},{key:"iterateThroughNodes",value:function(t,e,n,r,i){for(var o,a=this,s=this.createIterator(e,t,r),u=[],c=[],l=void 0,h=void 0;o=void 0,o=a.getIteratorNode(s),h=o.prevNode,l=o.node;)this.iframes&&this.forEachIframe(e,(function(t){return a.checkIframeFilter(l,h,t,u)}),(function(e){a.createInstanceOnIframe(e).forEachNode(t,(function(t){return c.push(t)}),r)})),c.push(l);c.forEach((function(t){n(t)})),this.iframes&&this.handleOpenIframes(u,t,n,r),i()}},{key:"forEachNode",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach((function(o){var s=function(){r.iterateThroughNodes(t,o,e,n,(function(){--a<=0&&i()}))};r.iframes?r.waitForIframes(o,s):s()}))}}],[{key:"matches",value:function(t,e){var n="string"==typeof e?[e]:e,r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;if(r){var i=!1;return n.every((function(e){return!r.call(t,e)||(i=!0,!1)})),i}return!1}}]),t}(),o=function(){function o(t){e(this,o),this.ctx=t,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(o,[{key:"log",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":t(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+e)}},{key:"escapeStr",value:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(t){return"disabled"!==this.opt.wildcards&&(t=this.setupWildcardsRegExp(t)),t=this.escapeStr(t),Object.keys(this.opt.synonyms).length&&(t=this.createSynonymsRegExp(t)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),this.opt.diacritics&&(t=this.createDiacriticsRegExp(t)),t=this.createMergedBlanksRegExp(t),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.createJoinersRegExp(t)),"disabled"!==this.opt.wildcards&&(t=this.createWildcardsRegExp(t)),t=this.createAccuracyRegExp(t)}},{key:"createSynonymsRegExp",value:function(t){var e=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in e)if(e.hasOwnProperty(i)){var o=e[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(t=t.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynomyms(a)+"|"+this.processSynomyms(s)+")"+r))}return t}},{key:"processSynomyms",value:function(t){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),t}},{key:"setupWildcardsRegExp",value:function(t){return(t=t.replace(/(?:\\)*\?/g,(function(t){return"\\"===t.charAt(0)?"?":"\x01"}))).replace(/(?:\\)*\*/g,(function(t){return"\\"===t.charAt(0)?"*":"\x02"}))}},{key:"createWildcardsRegExp",value:function(t){var e="withSpaces"===this.opt.wildcards;return t.replace(/\u0001/g,e?"[\\S\\s]?":"\\S?").replace(/\u0002/g,e?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(t){return t.replace(/[^(|)\\]/g,(function(t,e,n){var r=n.charAt(e+1);return/[(|)\\]/.test(r)||""===r?t:t+"\0"}))}},{key:"createJoinersRegExp",value:function(t){var e=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&e.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&e.push("\\u00ad\\u200b\\u200c\\u200d"),e.length?t.split(/\u0000+/).join("["+e.join("")+"]*"):t}},{key:"createDiacriticsRegExp",value:function(t){var e=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["a\xe0\xe1\u1ea3\xe3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\xe2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\xe4\xe5\u0101\u0105","A\xc0\xc1\u1ea2\xc3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\xc2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\xc4\xc5\u0100\u0104","c\xe7\u0107\u010d","C\xc7\u0106\u010c","d\u0111\u010f","D\u0110\u010e","e\xe8\xe9\u1ebb\u1ebd\u1eb9\xea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\xeb\u011b\u0113\u0119","E\xc8\xc9\u1eba\u1ebc\u1eb8\xca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\xcb\u011a\u0112\u0118","i\xec\xed\u1ec9\u0129\u1ecb\xee\xef\u012b","I\xcc\xcd\u1ec8\u0128\u1eca\xce\xcf\u012a","l\u0142","L\u0141","n\xf1\u0148\u0144","N\xd1\u0147\u0143","o\xf2\xf3\u1ecf\xf5\u1ecd\xf4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edf\u1ee1\u1edb\u1edd\u1ee3\xf6\xf8\u014d","O\xd2\xd3\u1ece\xd5\u1ecc\xd4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1ede\u1ee0\u1eda\u1edc\u1ee2\xd6\xd8\u014c","r\u0159","R\u0158","s\u0161\u015b\u0219\u015f","S\u0160\u015a\u0218\u015e","t\u0165\u021b\u0163","T\u0164\u021a\u0162","u\xf9\xfa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\xfb\xfc\u016f\u016b","U\xd9\xda\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\xdb\xdc\u016e\u016a","y\xfd\u1ef3\u1ef7\u1ef9\u1ef5\xff","Y\xdd\u1ef2\u1ef6\u1ef8\u1ef4\u0178","z\u017e\u017c\u017a","Z\u017d\u017b\u0179"]:["a\xe0\xe1\u1ea3\xe3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\xe2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\xe4\xe5\u0101\u0105A\xc0\xc1\u1ea2\xc3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\xc2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\xc4\xc5\u0100\u0104","c\xe7\u0107\u010dC\xc7\u0106\u010c","d\u0111\u010fD\u0110\u010e","e\xe8\xe9\u1ebb\u1ebd\u1eb9\xea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\xeb\u011b\u0113\u0119E\xc8\xc9\u1eba\u1ebc\u1eb8\xca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\xcb\u011a\u0112\u0118","i\xec\xed\u1ec9\u0129\u1ecb\xee\xef\u012bI\xcc\xcd\u1ec8\u0128\u1eca\xce\xcf\u012a","l\u0142L\u0141","n\xf1\u0148\u0144N\xd1\u0147\u0143","o\xf2\xf3\u1ecf\xf5\u1ecd\xf4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edf\u1ee1\u1edb\u1edd\u1ee3\xf6\xf8\u014dO\xd2\xd3\u1ece\xd5\u1ecc\xd4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1ede\u1ee0\u1eda\u1edc\u1ee2\xd6\xd8\u014c","r\u0159R\u0158","s\u0161\u015b\u0219\u015fS\u0160\u015a\u0218\u015e","t\u0165\u021b\u0163T\u0164\u021a\u0162","u\xf9\xfa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\xfb\xfc\u016f\u016bU\xd9\xda\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\xdb\xdc\u016e\u016a","y\xfd\u1ef3\u1ef7\u1ef9\u1ef5\xffY\xdd\u1ef2\u1ef6\u1ef8\u1ef4\u0178","z\u017e\u017c\u017aZ\u017d\u017b\u0179"],r=[];return t.split("").forEach((function(i){n.every((function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;t=t.replace(new RegExp("["+n+"]","gm"+e),"["+n+"]"),r.push(n)}return!0}))})),t}},{key:"createMergedBlanksRegExp",value:function(t){return t.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(t){var e=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="string"==typeof n?[]:n.limiters,o="";switch(i.forEach((function(t){o+="|"+e.escapeStr(t)})),r){case"partially":default:return"()("+t+")";case"complementary":return"()([^"+(o="\\s"+(o||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xa1\xbf")))+"]*"+t+"[^"+o+"]*)";case"exactly":return"(^|\\s"+o+")("+t+")(?=$|\\s"+o+")"}}},{key:"getSeparatedKeywords",value:function(t){var e=this,n=[];return t.forEach((function(t){e.opt.separateWordSearch?t.split(" ").forEach((function(t){t.trim()&&-1===n.indexOf(t)&&n.push(t)})):t.trim()&&-1===n.indexOf(t)&&n.push(t)})),{keywords:n.sort((function(t,e){return e.length-t.length})),length:n.length}}},{key:"isNumeric",value:function(t){return Number(parseFloat(t))==t}},{key:"checkRanges",value:function(t){var e=this;if(!Array.isArray(t)||"[object Object]"!==Object.prototype.toString.call(t[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(t),[];var n=[],r=0;return t.sort((function(t,e){return t.start-e.start})).forEach((function(t){var i=e.callNoMatchOnInvalidRanges(t,r),o=i.start,a=i.end;i.valid&&(t.start=o,t.length=a-o,n.push(t),r=a)})),n}},{key:"callNoMatchOnInvalidRanges",value:function(t,e){var n=void 0,r=void 0,i=!1;return t&&void 0!==t.start?(r=(n=parseInt(t.start,10))+parseInt(t.length,10),this.isNumeric(t.start)&&this.isNumeric(t.length)&&r-e>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(t)),this.opt.noMatch(t))):(this.log("Ignoring invalid range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(t,e,n){var r=void 0,i=!0,o=n.length,a=e-o,s=parseInt(t.start,10)-a;return(r=(s=s>o?o:s)+parseInt(t.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(t)),this.opt.noMatch(t)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(t){var e=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(function(t){r.push({start:n.length,end:(n+=t.textContent).length,node:t})}),(function(t){return e.matchesExclude(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),(function(){t({value:n,nodes:r})}))}},{key:"matchesExclude",value:function(t){return i.matches(t,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(t,e,n){var r=this.opt.element?this.opt.element:"mark",i=t.splitText(e),o=i.splitText(n-e),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(t,e,n,r,i){var o=this;t.nodes.every((function(a,s){var u=t.nodes[s+1];if(void 0===u||u.start>e){if(!r(a.node))return!1;var c=e-a.start,l=(n>a.end?a.end:n)-a.start,h=t.value.substr(0,a.start),f=t.value.substr(l+a.start);if(a.node=o.wrapRangeInTextNode(a.node,c,l),t.value=h+f,t.nodes.forEach((function(e,n){n>=s&&(t.nodes[n].start>0&&n!==s&&(t.nodes[n].start-=l),t.nodes[n].end-=l)})),n-=l,i(a.node.previousSibling,a.start),!(n>a.end))return!1;e=a.end}return!0}))}},{key:"wrapMatches",value:function(t,e,n,r,i){var o=this,a=0===e?0:e+1;this.getTextNodes((function(e){e.nodes.forEach((function(e){e=e.node;for(var i=void 0;null!==(i=t.exec(e.textContent))&&""!==i[a];)if(n(i[a],e)){var s=i.index;if(0!==a)for(var u=1;u0,versions:r,latestVersion:r[0]}}},function(t){t.exports=JSON.parse("[]")},function(t,e,n){t.exports={brand:"brand_2fDN"}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return c}));var r=n(2),i=n(6),o=n(0),a=n.n(o),s=n(150),u=n(143);function c(t){var e=t.label,n=t.to,o=t.docsPluginId,c=Object(i.a)(t,["label","to","docsPluginId"]),l=Object(u.useActiveVersion)(o),h=Object(u.useLatestVersion)(o),f=null!=l?l:h,p=null!=e?e:f.label,d=null!=n?n:function(t){return t.docs.find((function(e){return e.id===t.mainDocId}))}(f).path;return a.a.createElement(s.a,Object(r.a)({},c,{label:p,to:d}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.useDocVersionSuggestions=e.useActiveDocContext=e.useActiveVersion=e.useLatestVersion=e.useVersions=e.useActivePlugin=void 0;var r=n(142),i=n(173),o=n(174),a=function(t){return i.usePluginData("docusaurus-plugin-content-docs",t)};e.useActivePlugin=function(t){void 0===t&&(t={});var e=i.useAllPluginInstancesData("docusaurus-plugin-content-docs"),n=r.useLocation().pathname;return o.getActivePlugin(e,n,t)},e.useVersions=function(t){return a(t).versions},e.useLatestVersion=function(t){var e=a(t);return o.getLatestVersion(e)},e.useActiveVersion=function(t){var e=a(t),n=r.useLocation().pathname;return o.getActiveVersion(e,n)},e.useActiveDocContext=function(t){var e=a(t),n=r.useLocation().pathname;return o.getActiveDocContext(e,n)},e.useDocVersionSuggestions=function(t){var e=a(t),n=r.useLocation().pathname;return o.getDocVersionSuggestions(e,n)}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i})),n.d(e,"useAllPluginInstancesData",(function(){return o})),n.d(e,"usePluginData",(function(){return a}));var r=n(135);function i(){var t=Object(r.a)().globalData;if(!t)throw new Error("Docusaurus global data not found");return t}function o(t){var e=i()[t];if(!e)throw new Error("Docusaurus plugin global data not found for pluginName="+t);return e}function a(t,e){void 0===e&&(e="default");var n=o(t)[e];if(!n)throw new Error("Docusaurus plugin global data not found for pluginName="+t+" and pluginId="+e);return n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDocVersionSuggestions=e.getActiveDocContext=e.getActiveVersion=e.getLatestVersion=e.getActivePlugin=void 0;var r=n(142);e.getActivePlugin=function(t,e,n){void 0===n&&(n={});var i=Object.entries(t).find((function(t){t[0];var n=t[1];return!!r.matchPath(e,{path:n.path,exact:!1,strict:!1})})),o=i?{pluginId:i[0],pluginData:i[1]}:void 0;if(!o&&n.failfast)throw new Error("Can't find active docs plugin for pathname="+e+", while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: "+Object.values(t).map((function(t){return t.path})).join(", "));return o},e.getLatestVersion=function(t){return t.versions.find((function(t){return t.isLast}))},e.getActiveVersion=function(t,n){var i=e.getLatestVersion(t);return[].concat(t.versions.filter((function(t){return t!==i})),[i]).find((function(t){return!!r.matchPath(n,{path:t.path,exact:!1,strict:!1})}))},e.getActiveDocContext=function(t,n){var i,o,a=e.getActiveVersion(t,n),s=null==a?void 0:a.docs.find((function(t){return!!r.matchPath(n,{path:t.path,exact:!0,strict:!1})}));return{activeVersion:a,activeDoc:s,alternateDocVersions:s?(i=s.id,o={},t.versions.forEach((function(t){t.docs.forEach((function(e){e.id===i&&(o[t.name]=e)}))})),o):{}}},e.getDocVersionSuggestions=function(t,n){var r=e.getLatestVersion(t),i=e.getActiveDocContext(t,n),o=i.activeVersion!==r;return{latestDocSuggestion:o?null==i?void 0:i.alternateDocVersions[r.name]:void 0,latestVersionSuggestion:o?r:void 0}}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return l}));var r=n(2),i=n(6),o=n(0),a=n.n(o),s=n(150),u=n(143),c=function(t){return t.docs.find((function(e){return e.id===t.mainDocId}))};function l(t){var e,n=t.mobile,o=t.docsPluginId,l=Object(i.a)(t,["mobile","docsPluginId"]),h=Object(u.useActiveDocContext)(o),f=Object(u.useVersions)(o),p=Object(u.useLatestVersion)(o);var d=null!==(e=h.activeVersion)&&void 0!==e?e:p,m=n?"Versions":d.label,y=n?void 0:c(d).path;return a.a.createElement(s.a,Object(r.a)({},l,{mobile:n,label:m,to:y,items:function(){if(!(f.length<=2))return f.map((function(t){var e=(null==h?void 0:h.alternateDocVersions[t.name])||c(t);return{isNavLink:!0,label:t.label,to:e.path,isActive:function(){return t===(null==h?void 0:h.activeVersion)}}}))}()}))}},function(t,e,n){t.exports={footer:"footer_1tGs","footer--alt":"footer--alt_1TeZ",footer__inner:"footer__inner_36Qw",footer__column:"footer__column_1ZaJ","footer__column--left":"footer__column--left_vqok","footer__column--right":"footer__column--right_1voQ",footer__logo:"footer__logo_28rX",footer__tagline:"footer__tagline_3pHf",footer__github:"footer__github_3wPx",footer__links:"footer__links_32NO",footer__title:"footer__title_2vV4",footer__link:"footer__link_2yoH",footer__bottom:"footer__bottom_BsTT",footer__items:"footer__items_ovNU",footer__item:"footer__item_39Qw",footer__copyright:"footer__copyright_2Ssw"}},function(t,e,n){t.exports={wrapper:"wrapper_zZNc",flex:"flex_1ikI"}},function(t,e,n){t.exports={wrapper:"wrapper_36Pv",message:"message_3ltz"}},function(t,e,n){"use strict";n.r(e),function(t,e){var r=n(184),i=n(3),o=n(185);parcelRequire=function(t,r,i,o){var a,s="function"==typeof parcelRequire&&parcelRequire;function u(e,i){if(!r[e]){if(!t[e]){var o="function"==typeof parcelRequire&&parcelRequire;if(!i&&o)return o(e,!0);if(s)return s(e,!0);if("string"==typeof e)return n(186)(e);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}l.resolve=function(n){return t[e][1][n]||n},l.cache={};var c=r[e]=new u.Module(e);t[e][0].call(c.exports,l,c,c.exports,this)}return r[e].exports;function l(t){return u(l.resolve(t))}}u.isParcelRequire=!0,u.Module=function(t){this.id=t,this.bundle=u,this.exports={}},u.modules=t,u.cache=r,u.parent=s,u.register=function(e,n){t[e]=[function(t,e){e.exports=n},{}]};for(var c=0;c0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array)},{"es6-promise-polyfill":"rzFO","object-assign":"W2ED"}],oIGN:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=e.userAgent,b=n.split("[FBAN");void 0!==b[1]&&(n=b[0]),void 0!==(b=n.split("Twitter"))[1]&&(n=b[0]);var x=function(t){return function(e){return e.test(t)}}(n),_={apple:{phone:x(r)&&!x(h),ipod:x(i),tablet:!x(r)&&(x(o)||g(e))&&!x(h),universal:x(a),device:(x(r)||x(i)||x(o)||x(a)||g(e))&&!x(h)},amazon:{phone:x(c),tablet:!x(c)&&x(l),device:x(c)||x(l)},android:{phone:!x(h)&&x(c)||!x(h)&&x(s),tablet:!x(h)&&!x(c)&&!x(s)&&(x(l)||x(u)),device:!x(h)&&(x(c)||x(l)||x(s)||x(u))||x(/\bokhttp\b/i)},windows:{phone:x(h),tablet:x(f),device:x(h)||x(f)},other:{blackberry:x(p),blackberry10:x(d),opera:x(m),firefox:x(v),chrome:x(y),device:x(p)||x(d)||x(m)||x(v)||x(y)},any:!1,phone:!1,tablet:!1};return _.any=_.apple.device||_.android.device||_.windows.device||_.other.device,_.phone=_.apple.phone||_.android.phone||_.windows.phone,_.tablet=_.apple.tablet||_.android.tablet||_.windows.tablet,_};var r=/iPhone/i,i=/iPod/i,o=/iPad/i,a=/\biOS-universal(?:.+)Mac\b/i,s=/\bAndroid(?:.+)Mobile\b/i,u=/Android/i,c=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,l=/Silk/i,h=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,d=/BB10/i,m=/Opera Mini/i,y=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i,g=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream}},{}],ZipE:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0});var r={};Object.defineProperty(n,"default",{enumerable:!0,get:function(){return i.default}});var i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("./isMobile"));function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}Object.keys(i).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||Object.defineProperty(n,t,{enumerable:!0,get:function(){return i[t]}}))}))},{"./isMobile":"oIGN"}],HWBD:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.settings=n.isMobile=void 0;var r=(0,function(t){return t&&t.__esModule?t:{default:t}}(t("ismobilejs")).default)(window.navigator);n.isMobile=r;var i={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e,n=!0;return(r.tablet||r.phone)&&(r.apple.device&&(e=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(e[1],10)<11&&(n=!1),r.android.device&&(e=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(e[1],10)<7&&(n=!1)),n?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:r.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!r.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};n.settings=i},{ismobilejs:"ZipE"}],UASB:[function(t,e,n){var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r80*n){r=s=t[0],o=u=t[1];for(var v=n;vs&&(s=c),l>u&&(u=l);f=0!==(f=Math.max(s-r,u-o))?1/f:0}return a(m,y,n,r,o,f),y}function i(t,e,n,r,i){var o,a;if(i===C(t,e,n,r)>0)for(o=e;o=e;o-=r)a=P(o,t[o],t[o+1],a);return a&&_(a,a.next)&&(O(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_(r,r.next)&&0!==x(r.prev,r,r.next))r=r.next;else{if(O(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function a(t,e,n,r,i,h,f){if(t){!f&&h&&m(t,r,i,h);for(var p,d,y=t;t.prev!==t.next;)if(p=t.prev,d=t.next,h?u(t,r,i,h):s(t))e.push(p.i/n),e.push(t.i/n),e.push(d.i/n),O(t),t=d.next,y=d.next;else if((t=d)===y){f?1===f?a(t=c(o(t),e,n),e,n,r,i,h,2):2===f&&l(t,e,n,r,i,h):a(o(t),e,n,r,i,h,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(x(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(g(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&x(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,n,r){var i=t.prev,o=t,a=t.next;if(x(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=y(s,u,e,n,r),f=y(c,l,e,n,r),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&x(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&x(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&x(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&g(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&x(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function c(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!_(i,a)&&w(i,r,r.next,a)&&T(i,a)&&T(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),O(r),O(r.next),r=t=a),r=r.next}while(r!==t);return o(r)}function l(t,e,n,r,i,s){var u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&b(u,c)){var l=M(u,c);return u=o(u,u.next),l=o(l,l.next),a(u,e,n,r,i,s),void a(l,e,n,r,i,s)}c=c.next}u=u.next}while(u!==t)}function h(t,e,n,r){var a,s,u,c=[];for(a=0,s=e.length;a=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&g(on.x||r.x===n.x&&d(n,r)))&&(n=r,f=u)),r=r.next}while(r!==c);return n}(t,e)){var n=M(e,t);o(e,e.next),o(n,n.next)}}function d(t,e){return x(t.prev,t,e.prev)<0&&x(e.next,t,t.next)<0}function m(t,e,n,r){var i=t;do{null===i.z&&(i.z=y(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}function y(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function v(t){var e=t,n=t;do{(e.x=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function b(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(x(t.prev,t,e.prev)||x(t,e.prev,e))||_(t,e)&&x(t.prev,t,t.next)>0&&x(e.prev,e,e.next)>0)}function x(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,n,r){var i=S(x(t,e,n)),o=S(x(t,e,r)),a=S(x(n,r,t)),s=S(x(n,r,e));return i!==o&&a!==s||!(0!==i||!E(t,n,e))||!(0!==o||!E(t,r,e))||!(0!==a||!E(n,t,r))||!(0!==s||!E(n,e,r))}function E(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function S(t){return t>0?1:t<0?-1:0}function T(t,e){return x(t.prev,t,t.next)<0?x(t,e,t.next)>=0&&x(t,t.prev,e)>=0:x(t,e,t.prev)<0||x(t,t.next,e)<0}function M(t,e){var n=new A(t.i,t.x,t.y),r=new A(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function P(t,e,n,r){var i=new A(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(t,e,n,r){for(var i=0,o=e,a=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}},{}],z0xu:[function(t,e,n){var r,i=arguments[3];!function(t){var o="object"==typeof n&&n&&!n.nodeType&&n,a="object"==typeof e&&e&&!e.nodeType&&e,s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self!==s||(t=s);var u,c,l=2147483647,h=36,f=/^xn--/,p=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,v=String.fromCharCode;function g(t){throw RangeError(m[t])}function b(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function x(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+b((t=t.replace(d,".")).split("."),e).join(".")}function _(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=v((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+v(t)})).join("")}function E(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function S(t,e,n){var r=0;for(t=n?y(t/700):t>>1,t+=y(t/e);t>455;r+=h)t=y(t/35);return y(r+36*t/(t+38))}function T(t){var e,n,r,i,o,a,s,u,c,f,p,d=[],m=t.length,v=0,b=128,x=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&g("not-basic"),d.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=m&&g("invalid-input"),((u=(p=t.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:h)>=h||u>y((l-v)/a))&&g("overflow"),v+=u*a,!(u<(c=s<=x?1:s>=x+26?26:s-x));s+=h)a>y(l/(f=h-c))&&g("overflow"),a*=f;x=S(v-o,e=d.length+1,0==o),y(v/e)>l-b&&g("overflow"),b+=y(v/e),v%=e,d.splice(v++,0,b)}return w(d)}function M(t){var e,n,r,i,o,a,s,u,c,f,p,d,m,b,x,w=[];for(d=(t=_(t)).length,e=128,n=0,o=72,a=0;a=e&&py((l-n)/(m=r+1))&&g("overflow"),n+=(s-e)*m,e=s,a=0;al&&g("overflow"),p==e){for(u=n,c=h;!(u<(f=c<=o?1:c>=o+26?26:c-o));c+=h)x=u-f,b=h-f,w.push(v(E(f+x%b,0))),u=y(x/b);w.push(v(E(u,0))),o=S(n,m,r==i),n=0,++r}++n,++e}return w.join("")}if(u={version:"1.3.2",ucs2:{decode:_,encode:w},decode:T,encode:M,toASCII:function(t){return x(t,(function(t){return p.test(t)?"xn--"+M(t):t}))},toUnicode:function(t){return x(t,(function(t){return f.test(t)?T(t.slice(4).toLowerCase()):t}))}},"function"==typeof r&&"object"==typeof r.amd&&r.amd)r("punycode",(function(){return u}));else if(o&&a)if(e.exports==o)a.exports=u;else for(c in u)u.hasOwnProperty(c)&&(o[c]=u[c]);else t.punycode=u}(this)},{}],XvGG:[function(t,e,n){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],nKBU:[function(t,e,n){function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,n,o){e=e||"&",n=n||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(h=m.substr(0,y),f=m.substr(y+1)):(h=m,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),r(a,p)?i(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],sZzK:[function(t,e,n){var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(r(a))+n;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(r(t))})).join(e):s+encodeURIComponent(r(t[a]))})).join(e):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=t("querystring");function b(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o127?k+="x":k+=I[L];if(!k.match(p)){var D=C.slice(0,P),N=C.slice(P+1),B=I.match(d);B&&(D.push(B[1]),N.unshift(B[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[w])for(P=0,R=l.length;P0)&&n.host.split("@"))&&(n.auth=A.shift(),n.host=n.hostname=A.shift())),n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=E.slice(-1)[0],M=(n.host||t.host||E.length>1)&&("."===T||".."===T)||""===T,P=0,O=E.length;O>=0;O--)"."===(T=E[O])?E.splice(O,1):".."===T?(E.splice(O,1),P++):P&&(E.splice(O,1),P--);if(!_&&!w)for(;P--;P)E.unshift("..");!_||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),M&&"/"!==E.join("/").substr(-1)&&E.push("");var A,C=""===E[0]||E[0]&&"/"===E[0].charAt(0);return S&&(n.hostname=n.host=C?"":E.length?E.shift():"",(A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=A.shift(),n.host=n.hostname=A.shift())),(_=_||n.host&&E.length)&&!C&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:"z0xu","./util":"XvGG",querystring:"pjDS"}],u0xz:[function(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,m,y,v,g,b;Object.defineProperty(n,"__esModule",{value:!0}),n.WRAP_MODES=n.TYPES=n.TARGETS=n.SCALE_MODES=n.RENDERER_TYPE=n.PRECISION=n.MSAA_QUALITY=n.MIPMAP_MODES=n.MASK_TYPES=n.GC_MODES=n.FORMATS=n.ENV=n.DRAW_MODES=n.CLEAR_MODES=n.BUFFER_BITS=n.BLEND_MODES=n.ALPHA_MODES=void 0,n.ENV=r,function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(r||(n.ENV=r={})),n.RENDERER_TYPE=i,function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(i||(n.RENDERER_TYPE=i={})),n.BUFFER_BITS=o,function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(o||(n.BUFFER_BITS=o={})),n.BLEND_MODES=a,function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(a||(n.BLEND_MODES=a={})),n.DRAW_MODES=s,function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(s||(n.DRAW_MODES=s={})),n.FORMATS=u,function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(u||(n.FORMATS=u={})),n.TARGETS=c,function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(c||(n.TARGETS=c={})),n.TYPES=l,function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.FLOAT=5126]="FLOAT",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(l||(n.TYPES=l={})),n.SCALE_MODES=h,function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(h||(n.SCALE_MODES=h={})),n.WRAP_MODES=f,function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(f||(n.WRAP_MODES=f={})),n.MIPMAP_MODES=p,function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON"}(p||(n.MIPMAP_MODES=p={})),n.ALPHA_MODES=d,function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(d||(n.ALPHA_MODES=d={})),n.CLEAR_MODES=m,function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(m||(n.CLEAR_MODES=m={})),n.GC_MODES=y,function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(y||(n.GC_MODES=y={})),n.PRECISION=v,function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(v||(n.PRECISION=v={})),n.MASK_TYPES=g,function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(g||(n.MASK_TYPES=g={})),n.MSAA_QUALITY=b,function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(b||(n.MSAA_QUALITY=b={}))},{}],xS69:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.clearTextureCache=function(){var t;for(t in v)delete v[t];for(t in g)delete g[t]},n.correctBlendMode=function(t,e){return f[e?1:0][t]},n.createIndicesForQuads=function(t,e){void 0===e&&(e=null);var n=6*t;if((e=e||new Uint16Array(n)).length!==n)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+n);for(var r=0,i=0;r>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},n.hex2string=function(t){var e=t.toString(16);return"#"+(e="000000".substr(0,6-e.length)+e)},n.interleaveTypedArrays=function(t,e){for(var n=0,r=0,i={},o=0;o65535?1:0)<<4,n=((t>>>=e)>255?1:0)<<3;return e|=n,e|=n=((t>>>=n)>15?1:0)<<2,(e|=n=((t>>>=n)>3?1:0)<<1)|(t>>>=n)>>1},n.nextPow2=function(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},n.premultiplyRgba=function(t,e,n,r){return n=n||new Float32Array(4),r||void 0===r?(n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e):(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=e,n},n.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var n=t>>16&255,r=t>>8&255,i=255&t;return(255*e<<24)+((n=n*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(i=i*e+.5|0)},n.premultiplyTintToRgba=function(t,e,n,r){return(n=n||new Float32Array(4))[0]=(t>>16&255)/255,n[1]=(t>>8&255)/255,n[2]=(255&t)/255,(r||void 0===r)&&(n[0]*=e,n[1]*=e,n[2]*=e),n[3]=e,n},n.removeItems=function(t,e,n){var r,i=t.length;if(!(e>=i||0===n)){var o=i-(n=e+n>i?i-e:n);for(r=e;r-1){var n=["\n %c %c %c PixiJS 5.3.3 - \u2730 "+t+" \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665 \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=window.console).log.apply(e,n)}else window.console&&window.console.log("PixiJS 5.3.3 - "+t+" - http://www.pixijs.com/");h=!0}},n.sign=function(t){return 0===t?0:t<0?-1:1},n.skipHello=function(){h=!0},n.string2hex=function(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)},n.trimCanvas=function(t){var e,n,r,i=t.width,o=t.height,a=t.getContext("2d"),s=a.getImageData(0,0,i,o).data,u=s.length,c={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e=this.x&&t=this.y&&ee!=c>e&&t<(e-s)/(c-s)*(u-a)+a&&(n=!n)}return n},t}();n.Polygon=l;var h=function(){function t(t,e,n,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=20),this.x=t,this.y=e,this.width=n,this.height=r,this.radius=i,this.type=o.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var n=t-(this.x+this.radius),r=e-(this.y+this.radius),i=this.radius*this.radius;if(n*n+r*r<=i)return!0;if((n=t-(this.x+this.width-this.radius))*n+r*r<=i)return!0;if(n*n+(r=e-(this.y+this.height-this.radius))*r<=i)return!0;if((n=t-(this.x+this.radius))*n+r*r<=i)return!0}return!1},t}();n.RoundedRectangle=h;var f=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t}();n.Point=f;var p=function(){function t(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),this._x=n,this._y=r,this.cb=t,this.scope=e}return t.prototype.clone=function(e,n){return void 0===e&&(e=this.cb),void 0===n&&(n=this.scope),new t(e,n,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}();n.ObservablePoint=p;var d=function(){function t(t,e,n,r,i,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===i&&(i=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=n,this.d=r,this.tx=i,this.ty=o}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,n,r,i,o){return this.a=t,this.b=e,this.c=n,this.d=r,this.tx=i,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var n=e||this.array;return t?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},t.prototype.apply=function(t,e){e=e||new f;var n=t.x,r=t.y;return e.x=this.a*n+this.c*r+this.tx,e.y=this.b*n+this.d*r+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new f;var n=1/(this.a*this.d+this.c*-this.b),r=t.x,i=t.y;return e.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,e.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),r=this.a,i=this.c,o=this.tx;return this.a=r*e-this.b*n,this.b=r*n+this.b*e,this.c=i*e-this.d*n,this.d=i*n+this.d*e,this.tx=o*e-this.ty*n,this.ty=o*n+this.ty*e,this},t.prototype.append=function(t){var e=this.a,n=this.b,r=this.c,i=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*n+t.b*i,this.c=t.c*e+t.d*r,this.d=t.c*n+t.d*i,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*n+t.ty*i+this.ty,this},t.prototype.setTransform=function(t,e,n,r,i,o,a,s,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=t-(n*this.a+r*this.c),this.ty=e-(n*this.b+r*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var n=this.a,r=this.c;this.a=n*t.a+this.b*t.c,this.b=n*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,n=this.b,i=this.c,o=this.d,a=-Math.atan2(-i,o),s=Math.atan2(n,e),u=Math.abs(a+s);return u<1e-5||Math.abs(r-u)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=s),t.scale.x=Math.sqrt(e*e+n*n),t.scale.y=Math.sqrt(i*i+o*o),t.position.x=this.tx,t.position.y=this.ty,t},t.prototype.invert=function(){var t=this.a,e=this.b,n=this.c,r=this.d,i=this.tx,o=t*r-e*n;return this.a=r/o,this.b=-e/o,this.c=-n/o,this.d=t/o,this.tx=(n*this.ty-r*i)/o,this.ty=-(t*this.ty-e*i)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}();n.Matrix=d;var m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],y=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],v=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],g=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],x=[],_=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];b.push(e);for(var n=0;n<16;n++)for(var r=_(m[t]*m[n]+v[t]*y[n]),i=_(y[t]*m[n]+g[t]*y[n]),o=_(m[t]*v[n]+v[t]*g[n]),a=_(y[t]*v[n]+g[t]*g[n]),s=0;s<16;s++)if(m[s]===r&&y[s]===i&&v[s]===o&&g[s]===a){e.push(s);break}}for(t=0;t<16;t++){var u=new d;u.set(m[t],y[t],v[t],g[t],0,0),x.push(u)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return m[t]},uY:function(t){return y[t]},vX:function(t){return v[t]},vY:function(t){return g[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return b[t][e]},sub:function(t,e){return b[t][w.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?w.S:w.N:2*Math.abs(e)<=Math.abs(t)?t>0?w.E:w.W:e>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=x[w.inv(e)];i.tx=n,i.ty=r,t.append(i)}};n.groupD8=w;var E=function(){function t(){this.worldTransform=new d,this.localTransform=new d,this.position=new p(this.onChange,this,0,0),this.scale=new p(this.onChange,this,1,1),this.pivot=new p(this.onChange,this,0,0),this.skew=new p(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var n=t.worldTransform,r=this.worldTransform;r.a=e.a*n.a+e.b*n.c,r.b=e.a*n.b+e.b*n.d,r.c=e.c*n.a+e.d*n.c,r.d=e.c*n.b+e.d*n.d,r.tx=e.tx*n.a+e.ty*n.c+n.tx,r.ty=e.tx*n.b+e.ty*n.d+n.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();n.Transform=E},{}],sIot:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.TemporaryDisplayObject=n.DisplayObject=n.Container=n.Bounds=void 0;var r=t("@pixi/settings"),i=t("@pixi/math"),o=t("@pixi/utils");r.settings.SORTABLE_CHILDREN=!1;var a=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((t=t||new i.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addQuad=function(t){var e=this.minX,n=this.minY,r=this.maxX,i=this.maxY,o=t[0],a=t[1];e=or?o:r,i=a>i?a:i,e=(o=t[2])r?o:r,i=a>i?a:i,e=(o=t[4])r?o:r,i=a>i?a:i,e=(o=t[6])r?o:r,i=a>i?a:i,this.minX=e,this.minY=n,this.maxX=r,this.maxY=i},t.prototype.addFrame=function(t,e,n,r,i){this.addFrameMatrix(t.worldTransform,e,n,r,i)},t.prototype.addFrameMatrix=function(t,e,n,r,i){var o=t.a,a=t.b,s=t.c,u=t.d,c=t.tx,l=t.ty,h=this.minX,f=this.minY,p=this.maxX,d=this.maxY,m=o*e+s*n+c,y=a*e+u*n+l;h=mp?m:p,d=y>d?y:d,h=(m=o*r+s*n+c)p?m:p,d=y>d?y:d,h=(m=o*e+s*i+c)p?m:p,d=y>d?y:d,h=(m=o*r+s*i+c)p?m:p,d=y>d?y:d,this.minX=h,this.minY=f,this.maxX=p,this.maxY=d},t.prototype.addVertexData=function(t,e,n){for(var r=this.minX,i=this.minY,o=this.maxX,a=this.maxY,s=e;so?u:o,a=c>a?c:a}this.minX=r,this.minY=i,this.maxX=o,this.maxY=a},t.prototype.addVertices=function(t,e,n,r){this.addVerticesMatrix(t.worldTransform,e,n,r)},t.prototype.addVerticesMatrix=function(t,e,n,r,i,o){void 0===i&&(i=0),void 0===o&&(o=i);for(var a=t.a,s=t.b,u=t.c,c=t.d,l=t.tx,h=t.ty,f=this.minX,p=this.minY,d=this.maxX,m=this.maxY,y=n;yr?t.maxX:r,this.maxY=t.maxY>i?t.maxY:i},t.prototype.addBoundsMask=function(t,e){var n=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,i=t.maxXu?i:u,this.maxY=o>c?o:c}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var n=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,i=t.maxXu?i:u,this.maxY=o>c?o:c}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,n,r,i,o){t-=i,e-=o,n+=i,r+=o,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},t}();n.Bounds=a;var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var c=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new i.Transform,e.alpha=1,e.visible=!0,e.renderable=!0,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new a,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return u(e,t),e.mixin=function(t){for(var n=Object.keys(t),r=0;r1)for(var r=0;rthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var n=this.getChildIndex(t),r=this.getChildIndex(e);this.children[n]=e,this.children[r]=t,this.onChildrenChange(n=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(t);(0,o.removeItems)(this.children,n,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],n=0;n1)for(var r=0;r0&&i<=e){n=this.children.splice(r,i);for(var o=0;o1&&this.children.sort(h),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t title : "+t.title+"
tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData),e.dispatchEvent(t.target.displayObject,"pointertap",e.eventData),e.dispatchEvent(t.target.displayObject,"tap",e.eventData)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}();n.AccessibilityManager=a},{"@pixi/display":"sIot","@pixi/utils":"xS69"}],QEkk:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.UPDATE_PRIORITY=n.TickerPlugin=n.Ticker=void 0;var r,i=t("@pixi/settings");i.settings.TARGET_FPMS=.06,n.UPDATE_PRIORITY=r,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(r||(n.UPDATE_PRIORITY=r={}));var o=function(){function t(t,e,n,r){void 0===e&&(e=null),void 0===n&&(n=0),void 0===r&&(r=!1),this.fn=t,this.context=e,this.priority=n,this.once=r,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),a=function(){function t(){var t=this;this._head=new o(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/i.settings.TARGET_FPMS,this.elapsedMS=1/i.settings.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,n){return void 0===n&&(n=r.NORMAL),this._addListener(new o(t,e,n))},t.prototype.addOnce=function(t,e,n){return void 0===n&&(n=r.NORMAL),this._addListener(new o(t,e,n,!0))},t.prototype._addListener=function(t){var e=this._head.next,n=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(n);break}n=e,e=e.next}t.previous||t.connect(n)}else t.connect(n);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var n=this._head.next;n;)n=n.match(t,e)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var n=t-this._lastFrame|0;if(n=0;l--){var h=c[l],f=this.recursiveFindHit(t,h,n,r,s);if(f){if(!h.parent)continue;s=!1,f&&(t.target&&(r=!1),a=!0)}}return i&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),n&&n(t,e,!!a))),a},t.prototype.findHit=function(t,e,n,r){this.recursiveFindHit(t,e,n,r,!1)},t}(),f={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};n.interactiveTarget=f,o.DisplayObject.mixin(f);var p={target:null,data:{global:null}},d=function(t){function e(e,n){var r=t.call(this)||this;return n=n||{},r.renderer=e,r.autoPreventDefault=void 0===n.autoPreventDefault||n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new s,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new c,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!1,r.supportsTouchEvents="ontouchstart"in window,r.supportsPointerEvents=!!window.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new h,r._tempDisplayObject=new o.TemporaryDisplayObject,r._useSystemTicker=void 0===n.useSystemTicker||n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return function(t,e){function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return p.target=null,p.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(p,e,null,!0),p.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(i.Ticker.system.add(this.tickerUpdate,this,i.UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(i.Ticker.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;window.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;window.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime8)throw new Error("max arguments reached");var u=this.name,c=this.items;this._aliasCount++;for(var l=0,h=c.length;l0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();n.Runner=r,Object.defineProperties(r.prototype,{dispatch:{value:r.prototype.emit},run:{value:r.prototype.emit}})},{}],CJJk:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.autoDetectRenderer=function(t){return ae.create(t)},n.checkMaxIfStatementsInShader=At,n.uniformParsers=n.systems=n.resources=n.defaultVertex=n.defaultFilterVertex=n.ViewableBuffer=n.UniformGroup=n.TextureUvs=n.TextureMatrix=n.Texture=n.System=n.State=n.SpriteMaskFilter=n.Shader=n.Renderer=n.RenderTexturePool=n.RenderTexture=n.QuadUv=n.Quad=n.Program=n.ObjectRenderer=n.MaskData=n.IGLUniformData=n.Geometry=n.GLTexture=n.GLProgram=n.GLFramebuffer=n.Framebuffer=n.FilterState=n.Filter=n.Buffer=n.BatchTextureArray=n.BatchShaderGenerator=n.BatchRenderer=n.BatchPluginFactory=n.BatchGeometry=n.BatchDrawCall=n.BaseTexture=n.BaseRenderTexture=n.Attribute=n.AbstractRenderer=n.AbstractBatchRenderer=void 0;var r=t("@pixi/settings"),i=t("@pixi/constants"),o=t("@pixi/utils"),a=t("@pixi/runner"),s=t("@pixi/ticker"),u=t("@pixi/math");r.settings.PREFER_ENV=o.isMobile.any?i.ENV.WEBGL:i.ENV.WEBGL2,r.settings.STRICT_TEXTURE_CACHE=!1;var c=[];function l(t,e){if(!t)return null;var n="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(n=r[1].toLowerCase())}for(var i=c.length-1;i>=0;--i){var o=c[i];if(o.test&&o.test(t,n))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function f(t,e){function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var p=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new a.Runner("setRealSize"),this.onUpdate=new a.Runner("update"),this.onError=new a.Runner("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,n){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),d=function(t){function e(e,n){var r=this,i=n||{},o=i.width,a=i.height;if(!o||!a)throw new Error("BufferResource width or height invalid");return(r=t.call(this,o,a)||this).data=e,r}return f(e,t),e.prototype.upload=function(t,e,n){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.ALPHA_MODES.UNPACK),n.width===e.width&&n.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(n.width=e.width,n.height=e.height,r.texImage2D(e.target,0,n.internalFormat,e.width,e.height,0,e.format,n.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(p),m={scaleMode:i.SCALE_MODES.NEAREST,format:i.FORMATS.RGBA,alphaMode:i.ALPHA_MODES.NPM},y=function(t){function e(e,n){void 0===e&&(e=null),void 0===n&&(n=null);var a=t.call(this)||this,s=(n=n||{}).alphaMode,u=n.mipmap,c=n.anisotropicLevel,h=n.scaleMode,f=n.width,d=n.height,m=n.wrapMode,y=n.format,v=n.type,g=n.target,b=n.resolution,x=n.resourceOptions;return!e||e instanceof p||((e=l(e,x)).internal=!0),a.width=f||0,a.height=d||0,a.resolution=b||r.settings.RESOLUTION,a.mipmap=void 0!==u?u:r.settings.MIPMAP_TEXTURES,a.anisotropicLevel=void 0!==c?c:r.settings.ANISOTROPIC_LEVEL,a.wrapMode=m||r.settings.WRAP_MODE,a.scaleMode=void 0!==h?h:r.settings.SCALE_MODE,a.format=y||i.FORMATS.RGBA,a.type=v||i.TYPES.UNSIGNED_BYTE,a.target=g||i.TARGETS.TEXTURE_2D,a.alphaMode=void 0!==s?s:i.ALPHA_MODES.UNPACK,void 0!==n.premultiplyAlpha&&(a.premultiplyAlpha=n.premultiplyAlpha),a.uid=(0,o.uid)(),a.touched=0,a.isPowerOfTwo=!1,a._refreshPOT(),a._glTextures={},a.dirtyId=0,a.dirtyStyleId=0,a.cacheId=null,a.valid=f>0&&d>0,a.textureCacheIds=[],a.destroyed=!1,a.resource=null,a._batchEnabled=0,a._batchLocation=0,a.parentTextureArray=null,a.setResource(e),a}return f(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.ceil(this.width*this.resolution-1e-4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.ceil(this.height*this.resolution-1e-4)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var n;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,n=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,n=!0),n&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,n){return this.resolution=n||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,n){return this.resolution=n||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=(0,o.isPow2)(this.realWidth)&&(0,o.isPow2)(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete o.BaseTextureCache[this.cacheId],delete o.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,n,i){void 0===i&&(i=r.settings.STRICT_TEXTURE_CACHE);var a="string"==typeof t,s=null;a?s=t:(t._pixiId||(t._pixiId="pixiid_"+(0,o.uid)()),s=t._pixiId);var u=o.BaseTextureCache[s];if(a&&i&&!u)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return u||((u=new e(t,n)).cacheId=s,e.addToCache(u,s)),u},e.fromBuffer=function(t,n,r,o){t=t||new Float32Array(n*r*4);var a=new d(t,{width:n,height:r}),s=t instanceof Float32Array?i.TYPES.FLOAT:i.TYPES.UNSIGNED_BYTE;return new e(a,Object.assign(m,o||{width:n,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),o.BaseTextureCache[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),o.BaseTextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=o.BaseTextureCache[t];if(e){var n=e.textureCacheIds.indexOf(t);return n>-1&&e.textureCacheIds.splice(n,1),delete o.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=i.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,n,r){for(var i=this.itemDirtyIds,o=0;o]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(b),S=function(t){function e(n,r){var i=this;if(r=r||{},!(n instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof n&&(n=[n]);var a=n[0].src||n[0];b.crossOrigin(o,a,r.crossorigin);for(var s=0;s0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(s.Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(s.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&s.Ticker.shared.remove(this.update,this);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(s.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(s.Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,n){return t instanceof HTMLVideoElement||e.TYPES.indexOf(n)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(b),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.test=function(t){return!!window.createImageBitmap&&t instanceof ImageBitmap},e}(b);c.push(w,T,x,S,E,d,_,g);var M={Resource:p,BaseImageResource:b,INSTALLED:c,autoDetectResource:l,AbstractMultiResource:v,ArrayResource:g,BufferResource:d,CanvasResource:x,CubeResource:_,ImageResource:w,SVGResource:E,VideoResource:S,ImageBitmapResource:T};n.resources=M;var P=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}();n.System=P;var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.upload=function(t,e,n){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.ALPHA_MODES.UNPACK),n.width===e.width&&n.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(n.width=e.width,n.height=e.height,r.texImage2D(e.target,0,1===t.context.webGLVersion?r.DEPTH_COMPONENT:r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(d),A=function(){function t(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new a.Runner("disposeFramebuffer"),this.multisample=i.MSAA_QUALITY.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new y(null,{scaleMode:i.SCALE_MODES.NEAREST,resolution:1,mipmap:i.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new y(new O(null,{width:this.width,height:this.height}),{scaleMode:i.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.MIPMAP_MODES.OFF,format:i.FORMATS.DEPTH_COMPONENT,type:i.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&e.textureCacheIds.splice(n,1),delete o.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var r=0;rthis.baseTexture.width,a=n+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,c="Y: "+n+" + "+i+" = "+(n+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=r&&i&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(o.EventEmitter);function L(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}n.Texture=k,k.EMPTY=new k(new y),L(k.EMPTY),L(k.EMPTY.baseTexture),k.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new k(new y(new x(t)))}(),L(k.WHITE),L(k.WHITE.baseTexture);var j=function(t){function e(e,n){var r=this,i=null;if(!(e instanceof C)){var o=arguments[1],a=arguments[2],s=arguments[3],u=arguments[4];console.warn("Please use RenderTexture.create("+o+", "+a+") instead of the ctor directly."),i=arguments[0],n=null,e=new C({width:o,height:a,scaleMode:s,resolution:u})}return(r=t.call(this,e,n)||this).legacyRenderer=i,r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return f(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,n){void 0===n&&(n=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,n&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new C(t))},e}(k);n.RenderTexture=j;var D=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e){var n=new C(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new j(n)},t.prototype.getOptimalTexture=function(e,n,r){void 0===r&&(r=1);var i=t.SCREEN_KEY;e*=r,n*=r,this.enableFullScreen&&e===this._pixelsWidth&&n===this._pixelsHeight||(i=(65535&(e=(0,o.nextPow2)(e)))<<16|65535&(n=(0,o.nextPow2)(n))),this.texturePool[i]||(this.texturePool[i]=[]);var a=this.texturePool[i].pop();return a||(a=this.createTexture(e,n)),a.filterPoolKey=i,a.setResolution(r),a},t.prototype.getFilterTexture=function(t,e){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution);return n.filterFrame=t.filterFrame,n},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var n=this.texturePool[e];if(n)for(var r=0;r0&&e.height>0,r)for(var i=0;i1){for(var c=0;c1&&this.renderer.framebuffer.blit(),1===n.length)n[0].apply(this,e.renderTexture,c.renderTexture,i.CLEAR_MODES.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var l=e.renderTexture,h=this.getOptimalFilterTexture(l.width,l.height,e.resolution);h.filterFrame=l.filterFrame;var f=0;for(f=0;f=0;--r)t[r]=n[r]||null,t[r]&&(t[r]._batchLocation=r)},e.prototype.boundArray=function(t,e,n,r){for(var i=t.elements,o=t.ids,a=t.count,s=0,u=0;u=0&&l=i.ENV.WEBGL2&&(n=t.getContext("webgl2",e)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var e="WebGL2RenderingContext"in window&&t instanceof window.WebGL2RenderingContext||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=e,e||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(P),nt=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.multisample=i.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null};n.GLFramebuffer=nt;var rt=new u.Rectangle,it=function(t){function e(e){var n=t.call(this,e)||this;return n.managedFramebuffers=[],n.unknownFramebuffer=new A(10,10),n.msaaSamples=null,n}return f(e,t),e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new u.Rectangle,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;r.settings.PREFER_ENV===i.ENV.WEBGL_LEGACY&&(e=null,n=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},e.prototype.bind=function(t,e){var n=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var i=0;i1&&(n.msaaBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,n.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,n.multisample,e.RGBA8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,n.msaaBuffer));for(var i=[],o=0;o1)){var a=t.colorTextures[o],s=a.parentTextureArray||a;this.renderer.texture.bind(s,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,a.target,s._glTextures[this.CONTEXT_UID].texture,0),i.push(e.COLOR_ATTACHMENT0+o)}if(i.length>1&&e.drawBuffers(i),t.depthTexture&&this.writeDepthTexture){var u=t.depthTexture;this.renderer.texture.bind(u,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,u._glTextures[this.CONTEXT_UID].texture,0)}n.stencil||!t.stencil&&!t.depth||(n.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,n.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,n.stencil))},e.prototype.detectSamples=function(t){var e=this.msaaSamples,n=i.MSAA_QUALITY.NONE;if(t<=1||null===e)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(n.framebuffer),n.stencil&&r.deleteRenderbuffer(n.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var a=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=r.data.byteLength,e.bufferData(o,r.data,a)}}}},e.prototype.checkCompatibility=function(t,e){var n=t.attributes,r=e.attributeData;for(var i in r)if(!n[i])throw new Error('shader and geometry incompatible, geometry missing the "'+i+'" attribute')},e.prototype.getSignature=function(t,e){var n=t.attributes,r=e.attributeData,i=["g",t.id];for(var o in n)r[o]&&i.push(o);return i.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var n=this.gl,r=this.CONTEXT_UID,i=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],a=o[i];if(a)return o[e.id]=a,a;var s=t.buffers,u=t.attributes,c={},l={};for(var h in s)c[h]=0,l[h]=0;for(var h in u)!u[h].size&&e.attributeData[h]?u[h].size=e.attributeData[h].size:u[h].size||console.warn("PIXI Geometry attribute '"+h+"' size cannot be determined (likely the bound shader does not have the attribute)"),c[u[h].buffer]+=u[h].size*at[u[h].type];for(var h in u){var f=u[h],p=f.size;void 0===f.stride&&(c[f.buffer]===p*at[f.type]?f.stride=0:f.stride=c[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=p*at[f.type])}a=n.createVertexArray(),n.bindVertexArray(a);for(var d=0;d=i.ENV.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),mt=e}return mt}function vt(t,e,n){if("precision"!==t.substring(0,9)){var r=e;return e===i.PRECISION.HIGH&&n!==i.PRECISION.HIGH&&(r=i.PRECISION.MEDIUM),"precision "+r+" float;\n"+t}return n!==i.PRECISION.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var gt={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function bt(t){return gt[t]}var xt=null,_t={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function wt(t,e){if(!xt){var n=Object.keys(_t);xt={};for(var r=0;r0&&(e+="\nelse "),ne.name?1:-1})),o=0;o0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,n=this.renderer.projection,r=n.transform,i=n.sourceFrame,o=n.destinationFrame,a=e?e.resolution:this.renderer.resolution,s=(t.x-i.x)*a+o.x,u=(t.y-i.y)*a+o.y,c=t.width*a,l=t.height*a;r&&(s+=r.tx*a,u+=r.ty*a),e||(u=this.renderer.height-l-u),this.renderer.gl.scissor(s,u,c,l)},e}(Ut),Ht=function(t){function e(e){var n=t.call(this,e)||this;return n.glConst=WebGLRenderingContext.STENCIL_TEST,n}return f(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,n=this.renderer.gl,r=t._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),n.enable(n.STENCIL_TEST)),t._stencilCounter++,n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.EQUAL,r,this._getBitwiseMask()),n.stencilOp(n.KEEP,n.KEEP,n.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<>=1,n++;this.stateId=t.data}for(n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,n=!1,r=0;rthis.maxIdle&&(t.destroyTexture(i,!0),e[r]=null,n=!0)}if(n){var o=0;for(r=0;r=0;r--)this.unload(t.children[r])},e}(P),ee=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121};n.GLTexture=ee;var ne=function(t){function e(e){var n=t.call(this,e)||this;return n.boundTextures=[],n.currentLocation=-1,n.managedTextures=[],n._unknownBoundTextures=!1,n.unknownTexture=new y,n}return f(e,t),e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var n=0;n=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=i.WRAP_MODES.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var n=this.gl;if(e.mipmap&&n.generateMipmap(t.target),n.texParameteri(t.target,n.TEXTURE_WRAP_S,e.wrapMode),n.texParameteri(t.target,n.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===i.SCALE_MODES.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===i.SCALE_MODES.LINEAR){var o=Math.min(t.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else n.texParameteri(t.target,n.TEXTURE_MIN_FILTER,t.scaleMode===i.SCALE_MODES.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(t.target,n.TEXTURE_MAG_FILTER,t.scaleMode===i.SCALE_MODES.LINEAR?n.LINEAR:n.NEAREST)},e}(P),re={FilterSystem:Q,BatchSystem:$,ContextSystem:et,FramebufferSystem:it,GeometrySystem:st,MaskSystem:Ft,ScissorSystem:Gt,StencilSystem:Ht,ProjectionSystem:zt,RenderTextureSystem:Yt,ShaderSystem:Zt,StateSystem:$t,TextureGCSystem:te,TextureSystem:ne};n.systems=re;var ie=new u.Matrix,oe=function(t){function e(e,n){void 0===e&&(e=i.RENDERER_TYPE.UNKNOWN);var a=t.call(this)||this;return(n=Object.assign({},r.settings.RENDER_OPTIONS,n)).roundPixels&&(r.settings.ROUND_PIXELS=n.roundPixels,(0,o.deprecation)("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),a.options=n,a.type=e,a.screen=new u.Rectangle(0,0,n.width,n.height),a.view=n.view||document.createElement("canvas"),a.resolution=n.resolution||r.settings.RESOLUTION,a.transparent=n.transparent,a.autoDensity=n.autoDensity||n.autoResize||!1,a.preserveDrawingBuffer=n.preserveDrawingBuffer,a.clearBeforeRender=n.clearBeforeRender,a._backgroundColor=0,a._backgroundColorRgba=[0,0,0,0],a._backgroundColorString="#000000",a.backgroundColor=n.backgroundColor||a._backgroundColor,a._lastObjectRendered=null,a.plugins={},a}return f(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px"),this.emit("resize",t,e)},e.prototype.generateTexture=function(t,e,n,r){0===(r=r||t.getLocalBounds(null,!0)).width&&(r.width=1),0===r.height&&(r.height=1);var i=j.create({width:0|r.width,height:0|r.height,scaleMode:e,resolution:n});return ie.tx=-r.x,ie.ty=-r.y,this.render(t,i,!1,ie,!!t.parent),i},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=i.RENDERER_TYPE.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=(0,o.hex2string)(t),(0,o.hex2rgb)(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),e}(o.EventEmitter);n.AbstractRenderer=oe;var ae=function(t){function e(n){var r=t.call(this,i.RENDERER_TYPE.WEBGL,n)||this;return n=r.options,r.gl=null,r.CONTEXT_UID=0,r.runners={destroy:new a.Runner("destroy"),contextChange:new a.Runner("contextChange"),reset:new a.Runner("reset"),update:new a.Runner("update"),postrender:new a.Runner("postrender"),prerender:new a.Runner("prerender"),resize:new a.Runner("resize")},r.globalUniforms=new K({projectionMatrix:new u.Matrix},!0),r.addSystem(Ft,"mask").addSystem(et,"context").addSystem($t,"state").addSystem(Zt,"shader").addSystem(ne,"texture").addSystem(st,"geometry").addSystem(it,"framebuffer").addSystem(Gt,"scissor").addSystem(Ht,"stencil").addSystem(zt,"projection").addSystem(te,"textureGC").addSystem(Q,"filter").addSystem(Yt,"renderTexture").addSystem($,"batch"),r.initPlugins(e.__plugins),n.context?r.context.initFromContext(n.context):r.context.initFromOptions({alpha:!!r.transparent,antialias:n.antialias,premultipliedAlpha:r.transparent&&"notMultiplied"!==r.transparent,stencil:!0,preserveDrawingBuffer:n.preserveDrawingBuffer,powerPreference:r.options.powerPreference}),r.renderingToScreen=!0,(0,o.sayHello)(2===r.context.webGLVersion?"WebGL 2":"WebGL 1"),r.resize(r.options.width,r.options.height),r}return f(e,t),e.create=function(t){if((0,o.isWebGLSupported)())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var n=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=n,this.runners)this.runners[r].add(n);return this},e.prototype.render=function(t,e,n,r,i){if(this.renderingToScreen=!e,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!i){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==n?n:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,n){t.prototype.resize.call(this,e,n),this.runners.resize.emit(e,n)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,n){e.__plugins=e.__plugins||{},e.__plugins[t]=n},e}(oe);n.Renderer=ae;n.defaultVertex="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}";n.defaultFilterVertex="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n";var se=function(){this.texArray=null,this.blend=0,this.type=i.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null};n.BatchDrawCall=se;var ue=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,n=this.MAX_TEXTURES,r=e._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++y._globalBatch,u=0,c=r[0],l=0;i.copyBoundTextures(o,n);for(var h=0;h=n&&(i.boundArray(c,o,s,n),this.buildDrawCalls(c,l,h),l=h,c=r[++u],++s),f._batchEnabled=s,f.touched=a,c.elements[c.count++]=f)}for(c.count>0&&(i.boundArray(c,o,s,n),this.buildDrawCalls(c,l,this._bufferSize),++u,++s),h=0;h0&&(e+="\nelse "),n0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2==(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=n,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(n),this.type=t.TYPE.JSON}catch(c){return void this.abort("Error trying to parse loaded json: "+c)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(n,"text/xml")}else{var o=document.createElement("div");o.innerHTML=n,this.data=o}this.type=t.TYPE.XML}catch(c){return void this.abort("Error trying to parse loaded xml: "+c)}else this.data=e.response||n;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},e._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,m||(m=document.createElement("a")),m.href=t;var n=!(t=(0,r.default)(m.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,i=t.protocol?t.protocol+":":"";return t.host===e.hostname&&n&&i===e.protocol?"":"anonymous"},e._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},e._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},e._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var n=t.indexOf("/");e=t.substring(n+1,t.indexOf(";",n))}else{var r=t.indexOf("?"),i=t.indexOf("#"),o=Math.min(r>-1?r:t.length,i>-1?i:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},e._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},p(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function g(t,e,n){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=n)}function b(t){return t.toString().replace("object ","")}n.Resource=v,v.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},v.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},v.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},v.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},v._loadTypeMap={gif:v.LOAD_TYPE.IMAGE,png:v.LOAD_TYPE.IMAGE,bmp:v.LOAD_TYPE.IMAGE,jpg:v.LOAD_TYPE.IMAGE,jpeg:v.LOAD_TYPE.IMAGE,tif:v.LOAD_TYPE.IMAGE,tiff:v.LOAD_TYPE.IMAGE,webp:v.LOAD_TYPE.IMAGE,tga:v.LOAD_TYPE.IMAGE,svg:v.LOAD_TYPE.IMAGE,"svg+xml":v.LOAD_TYPE.IMAGE,mp3:v.LOAD_TYPE.AUDIO,ogg:v.LOAD_TYPE.AUDIO,wav:v.LOAD_TYPE.AUDIO,mp4:v.LOAD_TYPE.VIDEO,webm:v.LOAD_TYPE.VIDEO},v._xhrTypeMap={xhtml:v.XHR_RESPONSE_TYPE.DOCUMENT,html:v.XHR_RESPONSE_TYPE.DOCUMENT,htm:v.XHR_RESPONSE_TYPE.DOCUMENT,xml:v.XHR_RESPONSE_TYPE.DOCUMENT,tmx:v.XHR_RESPONSE_TYPE.DOCUMENT,svg:v.XHR_RESPONSE_TYPE.DOCUMENT,tsx:v.XHR_RESPONSE_TYPE.DOCUMENT,gif:v.XHR_RESPONSE_TYPE.BLOB,png:v.XHR_RESPONSE_TYPE.BLOB,bmp:v.XHR_RESPONSE_TYPE.BLOB,jpg:v.XHR_RESPONSE_TYPE.BLOB,jpeg:v.XHR_RESPONSE_TYPE.BLOB,tif:v.XHR_RESPONSE_TYPE.BLOB,tiff:v.XHR_RESPONSE_TYPE.BLOB,webp:v.XHR_RESPONSE_TYPE.BLOB,tga:v.XHR_RESPONSE_TYPE.BLOB,json:v.XHR_RESPONSE_TYPE.JSON,text:v.XHR_RESPONSE_TYPE.TEXT,txt:v.XHR_RESPONSE_TYPE.TEXT,ttf:v.XHR_RESPONSE_TYPE.BUFFER,otf:v.XHR_RESPONSE_TYPE.BUFFER},v.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";function x(t){for(var e="",n=0;n>2,i[1]=(3&r[0])<<4|r[1]>>4,i[2]=(15&r[1])<<2|r[2]>>6,i[3]=63&r[2],n-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(var a=0;a16384&&(i=16384),a._properties=[!1,!0,!1,!1,!1],a._maxSize=e,a._batchSize=i,a._buffers=null,a._bufferUpdateIDs=[],a._updateID=0,a.interactiveChildren=!1,a.blendMode=r.BLEND_MODES.NORMAL,a.autoResize=o,a.roundPixels=!0,a.baseTexture=null,a.setProperties(n),a._tint=0,a.tintRgb=new Float32Array(4),a.tint=16777215,a}return c(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,(0,o.hex2rgb)(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthn&&!t.autoResize&&(a=n);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var u=e[0]._texture.baseTexture;this.state.blendMode=(0,o.correctBlendMode)(t.blendMode,u.alphaMode),i.state.set(this.state);var c=i.gl,l=t.worldTransform.copyTo(this.tempMatrix);l.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=(0,o.premultiplyRgba)(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,u.alphaMode),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var h=!1,f=0,p=0;fr&&(d=r),p>=s.length&&s.push(this._generateOneMoreBuffer(t));var m=s[p];m.uploadDynamic(e,f,d);var y=t._bufferUpdateIDs[p]||0;(h=h||m._updateID0,l=u.alpha,h=l<1&&c?(0,o.premultiplyTint)(u._tintRGB,l):u._tintRGB+(255*l<<24);r[a]=h,r[a+i]=h,r[a+2*i]=h,r[a+3*i]=h,a+=4*i}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(a.ObjectRenderer);n.ParticleRenderer=f},{"@pixi/constants":"u0xz","@pixi/display":"sIot","@pixi/utils":"xS69","@pixi/core":"CJJk","@pixi/math":"bSXT"}],mLUG:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.graphicsUtils=n.LineStyle=n.LINE_JOIN=n.LINE_CAP=n.GraphicsGeometry=n.GraphicsData=n.Graphics=n.GRAPHICS_CURVES=n.FillStyle=void 0;var r,i,o=t("@pixi/core"),a=t("@pixi/math"),s=t("@pixi/utils"),u=t("@pixi/constants"),c=t("@pixi/display");n.LINE_JOIN=r,function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(r||(n.LINE_JOIN=r={})),n.LINE_CAP=i,function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(i||(n.LINE_CAP=i={}));var l={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var n=Math.ceil(t/this.maxLength);return nthis.maxSegments&&(n=this.maxSegments),n}};n.GRAPHICS_CURVES=l;var h=function(){function t(){this.color=16777215,this.alpha=1,this.texture=o.Texture.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=o.Texture.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}();n.FillStyle=h;var f=function(t,e){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function p(t,e){function n(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var d={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var n=t.points,r=t.holes,i=e.points,o=e.indices;if(n.length>=6){for(var a=[],u=0;uh&&(h+=2*Math.PI);var f=l,p=h-l,d=Math.abs(p),m=Math.sqrt(u*u+c*c),y=1+(15*d*Math.sqrt(m)/Math.PI>>0),v=p/y;if(f+=v,s){a.push(t,e),a.push(n,r);for(var g=1,b=f;gS?(W?(y.push(Q,Z),y.push(P+R*B,O+I*B),y.push(Q,Z),y.push(P+k*B,O+L*B)):(y.push(P-R*N,O-I*N),y.push($,tt),y.push(P-k*N,O-L*N),y.push($,tt)),g+=2):u.join===r.ROUND?W?(y.push(Q,Z),y.push(P+R*B,O+I*B),g+=_(P,O,P+R*B,O+I*B,P+k*B,O+L*B,y,!0)+4,y.push(Q,Z),y.push(P+k*B,O+L*B)):(y.push(P-R*N,O-I*N),y.push($,tt),g+=_(P,O,P-R*N,O-I*N,P-k*N,O-L*N,y,!1)+4,y.push(P-k*N,O-L*N),y.push($,tt)):(y.push(Q,Z),y.push($,tt))}}T=o[2*(v-2)],M=o[2*(v-2)+1],P=o[2*(v-1)],R=-(M-(O=o[2*(v-1)+1])),I=T-P,R/=j=Math.sqrt(R*R+I*I),I/=j,R*=w,I*=w,y.push(P-R*N,O-I*N),y.push(P+R*B,O+I*B),f||(u.cap===i.ROUND?g+=_(P-R*(N-B)*.5,O-I*(N-B)*.5,P-R*N,O-I*N,P+R*B,O+I*B,y,!1)+2:u.cap===i.SQUARE&&(g+=x(P,O,R,I,N,B,!1,y)));var et=e.indices,nt=l.epsilon*l.epsilon;for(F=b;Fl*s}},t.arc=function(t,e,n,r,i,o,s,u,c){for(var h=s-o,f=l._segmentsCount(Math.abs(h)*i,40*Math.ceil(Math.abs(h)/a.PI_2)),p=h/(2*f),d=2*p,m=Math.cos(p),y=Math.sin(p),v=f-1,g=v%1/v,b=0;b<=v;++b){var x=p+o+d*(b+g*b),_=Math.cos(x),w=-Math.sin(x);c.push((m*_+y*w)*i+n,(m*-w+y*_)*i+r)}},t}(),P=function(){function t(){}return t.curveLength=function(t,e,n,r,i,o,a,s){for(var u=0,c=0,l=0,h=0,f=0,p=0,d=0,m=0,y=0,v=0,g=0,b=t,x=e,_=1;_<=10;++_)v=b-(m=(d=(p=(f=1-(c=_/10))*f)*f)*t+3*p*c*n+3*f*(l=c*c)*i+(h=l*c)*a),g=x-(y=d*e+3*p*c*r+3*f*l*o+h*s),b=m,x=y,u+=Math.sqrt(v*v+g*g);return u},t.curveTo=function(e,n,r,i,o,a,s){var u=s[s.length-2],c=s[s.length-1];s.length-=2;var h=l._segmentsCount(t.curveLength(u,c,e,n,r,i,o,a)),f=0,p=0,d=0,m=0,y=0;s.push(u,c);for(var v=1,g=0;v<=h;++v)d=(p=(f=1-(g=v/h))*f)*f,y=(m=g*g)*g,s.push(d*u+3*p*g*e+3*f*m*r+y*o,d*c+3*p*g*n+3*f*m*i+y*a)},t}(),O=function(){function t(){}return t.curveLength=function(t,e,n,r,i,o){var a=t-2*n+i,s=e-2*r+o,u=2*n-2*t,c=2*r-2*e,l=4*(a*a+s*s),h=4*(a*u+s*c),f=u*u+c*c,p=2*Math.sqrt(l+h+f),d=Math.sqrt(l),m=2*l*d,y=2*Math.sqrt(f),v=h/d;return(m*p+d*h*(p-y)+(4*f*l-h*h)*Math.log((2*d+v+p)/(v+y)))/(4*m)},t.curveTo=function(e,n,r,i,o){for(var a=o[o.length-2],s=o[o.length-1],u=l._segmentsCount(t.curveLength(a,s,e,n,r,i)),c=0,h=0,f=1;f<=u;++f){var p=f/u;c=a+(e-a)*p,h=s+(n-s)*p,o.push(c+(e+(r-e)*p-c)*p,h+(n+(i-n)*p-h)*p)}},t}(),A=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,n){this.reset(),this.style=t,this.start=e,this.attribStart=n},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),C=((S={})[a.SHAPES.POLY]=d,S[a.SHAPES.CIRC]=m,S[a.SHAPES.ELIP]=m,S[a.SHAPES.RECT]=y,S[a.SHAPES.RREC]=b,S),R=[],I=[],k={buildPoly:d,buildCircle:m,buildRectangle:y,buildRoundedRectangle:b,FILL_COMMANDS:C,BATCH_POOL:R,DRAW_CALL_POOL:I,buildLine:E,Star:T,ArcUtils:M,BezierUtils:P,QuadraticUtils:O,BatchPart:A};n.graphicsUtils=k;var L=function(){function t(t,e,n,r){void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=n,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}();n.GraphicsData=L;var j=new a.Point,D=new c.Bounds,N=function(t){function e(){var e=t.call(this)||this;return e.uvsFloat32=null,e.indicesUint16=null,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.dirty=0,e.batchDirty=-1,e.cacheDirty=-1,e.clearDirty=0,e.drawCalls=[],e.batches=[],e.shapeIndex=0,e._bounds=new c.Bounds,e.boundsDirty=-1,e.boundsPadding=0,e.batchable=!1,e.indicesUint16=null,e.uvsFloat32=null,e.closePointEps=1e-4,e}return p(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,n,r){void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null);var i=new L(t,e,n,r);return this.graphicsData.push(i),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var n=new L(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=r.lineStyle,r.holes.push(n),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e0&&(i=(r=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535&&t;this.indicesUint16=g?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&t.texture.baseTexture===e.texture.baseTexture&&t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,n=0;n0&&((i=I.pop())||((i=new o.BatchDrawCall).texArray=new o.BatchTextureArray),this.drawCalls.push(i)),i.start=f,i.size=0,i.texArray.count=0,i.type=h),m.touched=1,m._batchEnabled=t,m._batchLocation=a,m.wrapMode=10497,i.texArray.elements[i.texArray.count++]=m,a++)),i.size+=p.size,f+=p.size,c=m._batchLocation,this.addColors(n,d.color,d.alpha,p.attribSize),this.addTextureIds(r,c,p.attribSize)}o.BaseTexture._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,n=this.colors,r=this.textureIds,i=new ArrayBuffer(3*t.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,u=0;u>16)+(65280&e)+((255&e)<<16),o=(0,s.premultiplyTint)(i,n);r-- >0;)t.push(o)},e.prototype.addTextureIds=function(t,e,n){for(;n-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,n,r,i,o){void 0===o&&(o=null);for(var a=0,s=e.length,u=n.frame;a0&&t.alpha>0;return p?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:p},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new a.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new a.Polygon,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,r=n[n.length-2],i=n[n.length-1];return r===t&&i===e||n.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,n,r){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),O.curveTo(t,e,n,r,i),this},e.prototype.bezierCurveTo=function(t,e,n,r,i,o){return this._initCurve(),P.curveTo(t,e,n,r,i,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,n,r,i){this._initCurve(t,e);var o=this.currentPath.points,a=M.curveTo(t,e,n,r,i,o);if(a){var s=a.cx,u=a.cy,c=a.radius,l=a.startAngle,h=a.endAngle,f=a.anticlockwise;this.arc(s,u,c,l,h,f)}return this},e.prototype.arc=function(t,e,n,r,i,o){if(void 0===o&&(o=!1),r===i)return this;if(!o&&i<=r?i+=a.PI_2:o&&r<=i&&(r+=a.PI_2),0==i-r)return this;var s=t+Math.cos(r)*n,u=e+Math.sin(r)*n,c=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var h=Math.abs(l[l.length-2]-s),f=Math.abs(l[l.length-1]-u);h0;return u?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:u},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,n,r){return this.drawShape(new a.Rectangle(t,e,n,r))},e.prototype.drawRoundedRect=function(t,e,n,r,i){return this.drawShape(new a.RoundedRectangle(t,e,n,r,i))},e.prototype.drawCircle=function(t,e,n){return this.drawShape(new a.Circle(t,e,n))},e.prototype.drawEllipse=function(t,e,n,r){return this.drawShape(new a.Ellipse(t,e,n,r))},e.prototype.drawPolygon=function(){for(var t,e=arguments,n=[],r=0;r>16&255)/255*i,o.tint[1]=(r>>8&255)/255*i,o.tint[2]=(255&r)/255*i,o.tint[3]=i,t.shader.bind(e),t.geometry.bind(n,e),t.state.set(this.state);for(var s=0,u=a.length;s>16)+(65280&i)+((255&i)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,n=e.a,r=e.b,i=e.c,o=e.d,a=e.tx,s=e.ty,u=this._geometry.points,c=this.vertexData,l=0,h=0;h=r&&l.x=i&&l.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||i.Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(o.Container);n.Sprite=f},{"@pixi/constants":"u0xz","@pixi/core":"CJJk","@pixi/display":"sIot","@pixi/math":"bSXT","@pixi/settings":"HWBD","@pixi/utils":"xS69"}],hHxK:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.TextStyle=n.TextMetrics=n.Text=n.TEXT_GRADIENT=void 0;var r,i=t("@pixi/sprite"),o=t("@pixi/core"),a=t("@pixi/settings"),s=t("@pixi/math"),u=t("@pixi/utils"),c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};n.TEXT_GRADIENT=r,function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(r||(n.TEXT_GRADIENT=r={}));var l={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:r.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},h=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],f=function(){function t(t){this.styleID=0,this.reset(),m(this,t,t)}return t.prototype.clone=function(){var e={};return m(e,this,l),new t(e)},t.prototype.reset=function(){m(this,l,l)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=d(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=d(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n=0;n--){var r=e[n].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&h.indexOf(r)<0&&(r='"'+r+'"'),e[n]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function p(t){return"number"==typeof t?(0,u.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function d(t){if(Array.isArray(t)){for(var e=0;ed)if(""!==a&&(s+=t.addLine(a),a="",o=0),t.canBreakWords(v,n.breakWords))for(var _=t.wordWrapSplit(v),w=0;w<_.length;w++){for(var E=_[w],S=1;_[w+S];){var T=_[w+S],M=E[E.length-1];if(t.canBreakChars(M,T,v,w,n.breakWords))break;E+=T,S++}w+=E.length-1;var P=t.getFromCache(E,c,u,i);P+o>d&&(s+=t.addLine(a),p=!1,a="",o=0),a+=E,o+=P}else{a.length>0&&(s+=t.addLine(a),a="",o=0);var O=y===m.length-1;s+=t.addLine(v,!O),p=!1,a="",o=0}else x+o>d&&(p=!1,s+=t.addLine(a),a="",o=0),(a.length>0||!t.isBreakingSpace(v)||p)&&(a+=v,o+=x)}return s+t.addLine(a,!1)},t.addLine=function(e,n){return void 0===n&&(n=!0),e=t.trimRight(e),n?e+"\n":e},t.getFromCache=function(t,e,n,r){var i=n[t];if(void 0===i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var n=e.length-1;n>=0;n--){var r=e[n];if(!t.isBreakingSpace(r))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var n=[],r="";if("string"!=typeof e)return n;for(var i=0;is;--f){for(m=0;m0},t}();function h(t,e){var n=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&a.Ticker.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function b(t,e){return e instanceof i.BaseTexture&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function x(t,e){if(!(e instanceof o.Graphics))return!1;var n=e.geometry;e.finishPoly(),n.updateBatches();for(var r=n.batches,i=0;i=r&&l.x=i&&l.y>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;(0,u.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(r.Shader);n.MeshMaterial=m;var y=function(t){function e(e,n,i){var a=t.call(this)||this,s=new r.Buffer(e),u=new r.Buffer(n,!0),c=new r.Buffer(i,!0,!0);return a.addAttribute("aVertexPosition",s,2,!1,o.TYPES.FLOAT).addAttribute("aTextureCoord",u,2,!1,o.TYPES.FLOAT).addIndex(c),a._updateId=-1,a}return l(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(r.Geometry);n.MeshGeometry=y},{"@pixi/core":"CJJk","@pixi/math":"bSXT","@pixi/constants":"u0xz","@pixi/display":"sIot","@pixi/settings":"HWBD","@pixi/utils":"xS69"}],Qh3P:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.BitmapText=n.BitmapFontLoader=n.BitmapFontData=n.BitmapFont=void 0;var r=t("@pixi/math"),i=t("@pixi/settings"),o=t("@pixi/mesh"),a=t("@pixi/utils"),s=t("@pixi/core"),u=t("@pixi/text"),c=t("@pixi/display"),l=t("@pixi/loaders"),h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var f=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]};n.BitmapFontData=f;var p=[function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[]};for(var r in e){var i=e[r].match(/^[a-z]+/gm)[0],o=e[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var u=o[s].split("="),c=u[0],l=u[1].replace(/"/gm,""),h=parseFloat(l),p=isNaN(h)?l:h;a[c]=p}n[i].push(a)}var d=new f;return n.info.forEach((function(t){return d.info.push({face:t.face,size:parseInt(t.size,10)})})),n.common.forEach((function(t){return d.common.push({lineHeight:parseInt(t.lineHeight,10)})})),n.page.forEach((function(t){return d.page.push({id:parseInt(t.id,10),file:t.file})})),n.char.forEach((function(t){return d.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),n.kerning.forEach((function(t){return d.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),d},t}(),function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new f,n=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),i=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),s=0;s=h-O*c){if(0===w)throw new Error("[BitmapFont] textureHeight "+h+"px is too small for "+d.fontSize+"px fonts");--T,g=null,b=null,x=null,w=0,_=0,E=0}else if(E=Math.max(O+M.fontProperties.descent,E),A*c+_>=m)--T,w+=E*c,w=Math.ceil(w),_=0,E=0;else{y(g,b,M,_,w,c,d);var C=M.text.charCodeAt(0);v.char.push({id:C,page:S.length-1,x:_/c,y:w/c,width:A,height:O,xoffset:0,yoffset:0,xadvance:Math.ceil(P-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),_+=(A+2*a)*c,_=Math.ceil(_)}}var R=new t(v,S);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=R,R},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}();n.BitmapFont=v;var g=[],b=[],x=function(t){function e(n,o){void 0===o&&(o={});var s=t.call(this)||this;s._tint=16777215,o.font&&((0,a.deprecation)("5.3.0","PIXI.BitmapText constructor style.font property is deprecated."),s._upgradeStyle(o));var u=Object.assign({},e.styleDefaults,o),c=u.align,l=u.tint,h=u.maxWidth,f=u.letterSpacing,p=u.fontName,d=u.fontSize;if(!v.available[p])throw new Error('Missing BitmapFont "'+p+'"');return s._activePagesMeshData=[],s._textWidth=0,s._textHeight=0,s._align=c,s._tint=l,s._fontName=p,s._fontSize=d||v.available[p].size,s._text=n,s._maxWidth=h,s._maxLineHeight=0,s._letterSpacing=f,s._anchor=new r.ObservablePoint((function(){s.dirty=!0}),s,0,0),s.roundPixels=i.settings.ROUND_PIXELS,s.dirty=!0,s}return function(t,e){function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.updateText=function(){for(var t,e=v.available[this._fontName],n=this._fontSize/e.size,i=new r.Point,u=[],c=[],l=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",h=l.length,f=this._maxWidth*e.size/this._fontSize,p=null,d=0,m=0,y=0,x=-1,_=0,w=0,E=0,S=0;S0&&i.x>f&&(++w,(0,a.removeItems)(u,1+x-w,1+S-x),S=x,x=-1,c.push(_),m=Math.max(m,_),y++,i.x=0,i.y+=e.lineHeight,p=null)}}else c.push(d),m=Math.max(m,d),++y,++w,i.x=0,i.y+=e.lineHeight,p=null}var A=l.charAt(l.length-1);"\r"!==A&&"\n"!==A&&(/(?:\s)/.test(A)&&(d=_),c.push(d),m=Math.max(m,d));var C=[];for(S=0;S<=y;S++){var R=0;"right"===this._align?R=m-c[S]:"center"===this._align&&(R=(m-c[S])/2),C.push(R)}var I=u.length,k={},L=[],j=this._activePagesMeshData;for(S=0;S6*F&&!(Y.vertices.length<2*o.Mesh.BATCHABLE_SIZE)||(Y.vertices=new Float32Array(8*F),Y.uvs=new Float32Array(8*F),Y.indices=new Uint16Array(6*F)),Y.mesh.size=6*F}for(S=0;S=2&&(t.fontSize=parseInt(e[0],10))}else t.fontName=t.font.name,t.fontSize="number"==typeof t.font.size?t.font.size:parseInt(t.font.size,10)},e.registerFont=function(t,e){return(0,a.deprecation)("5.3.0","PIXI.BitmapText.registerFont is deprecated, use PIXI.BitmapFont.install"),v.install(t,e)},Object.defineProperty(e,"fonts",{get:function(){return(0,a.deprecation)("5.3.0","PIXI.BitmapText.fonts is deprecated, use PIXI.BitmapFont.available"),v.available},enumerable:!1,configurable:!0}),e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(c.Container);n.BitmapText=x;var _=function(){function t(){}return t.add=function(){l.LoaderResource.setExtensionXhrType("fnt",l.LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT)},t.use=function(e,n){var r=d(e.data);if(r)for(var i=t.getBaseUrl(this,e),o=r.parse(e.data),a={},s=function(t){a[t.metadata.pageFile]=t.texture,Object.keys(a).length===o.page.length&&(e.bitmapFont=v.install(o,a),n())},u=0;u=r&&(e=t-a-1),o+=s=s.replace("%value%",n[e].toString()),o+="\n"}return(i=i.replace("%blur%",o)).replace("%size%",t.toString())}(a);return(u=t.call(this,c,l)||this).horizontal=e,u.resolution=o,u._quality=0,u.quality=r,u.blur=n,u}return a(e,t),e.prototype.apply=function(t,e,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/e.width):this.uniforms.strength=1/n.height*(n.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,n,r);else{var i=t.getFilterTexture(),o=t.renderer,a=e,s=i;this.state.blend=!1,t.applyFilter(this,a,s,x.CLEAR);for(var u=1;u 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",n)||this).alpha=1,e}return function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var n=t;e&&(this._multiply(n,this.uniforms.m,t),n=this._colorMatrix(n)),this.uniforms.m=n},e.prototype._multiply=function(t,e,n){return t[0]=e[0]*n[0]+e[1]*n[5]+e[2]*n[10]+e[3]*n[15],t[1]=e[0]*n[1]+e[1]*n[6]+e[2]*n[11]+e[3]*n[16],t[2]=e[0]*n[2]+e[1]*n[7]+e[2]*n[12]+e[3]*n[17],t[3]=e[0]*n[3]+e[1]*n[8]+e[2]*n[13]+e[3]*n[18],t[4]=e[0]*n[4]+e[1]*n[9]+e[2]*n[14]+e[3]*n[19]+e[4],t[5]=e[5]*n[0]+e[6]*n[5]+e[7]*n[10]+e[8]*n[15],t[6]=e[5]*n[1]+e[6]*n[6]+e[7]*n[11]+e[8]*n[16],t[7]=e[5]*n[2]+e[6]*n[7]+e[7]*n[12]+e[8]*n[17],t[8]=e[5]*n[3]+e[6]*n[8]+e[7]*n[13]+e[8]*n[18],t[9]=e[5]*n[4]+e[6]*n[9]+e[7]*n[14]+e[8]*n[19]+e[9],t[10]=e[10]*n[0]+e[11]*n[5]+e[12]*n[10]+e[13]*n[15],t[11]=e[10]*n[1]+e[11]*n[6]+e[12]*n[11]+e[13]*n[16],t[12]=e[10]*n[2]+e[11]*n[7]+e[12]*n[12]+e[13]*n[17],t[13]=e[10]*n[3]+e[11]*n[8]+e[12]*n[13]+e[13]*n[18],t[14]=e[10]*n[4]+e[11]*n[9]+e[12]*n[14]+e[13]*n[19]+e[14],t[15]=e[15]*n[0]+e[16]*n[5]+e[17]*n[10]+e[18]*n[15],t[16]=e[15]*n[1]+e[16]*n[6]+e[17]*n[11]+e[18]*n[16],t[17]=e[15]*n[2]+e[16]*n[7]+e[17]*n[12]+e[18]*n[17],t[18]=e[15]*n[3]+e[16]*n[8]+e[17]*n[13]+e[18]*n[18],t[19]=e[15]*n[4]+e[16]*n[9]+e[17]*n[14]+e[18]*n[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var n=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.greyscale=function(t,e){var n=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var n=Math.cos(t),r=Math.sin(t),i=1/3,o=(0,Math.sqrt)(i),a=[n+(1-n)*i,i*(1-n)-o*r,i*(1-n)+o*r,0,0,i*(1-n)+o*r,n+i*(1-n),i*(1-n)-o*r,0,0,i*(1-n)-o*r,i*(1-n)+o*r,n+i*(1-n),0,0,0,0,0,1,0];this._loadMatrix(a,e)},e.prototype.contrast=function(t,e){var n=(t||0)+1,r=-.5*(n-1),i=[n,0,0,0,r,0,n,0,0,r,0,0,n,0,r,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var n=2*t/3+1,r=-.5*(n-1),i=[n,r,r,0,0,r,n,r,0,0,r,r,n,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,n,r,i){var o=((n=n||16770432)>>16&255)/255,a=(n>>8&255)/255,s=(255&n)/255,u=((r=r||3375104)>>16&255)/255,c=(r>>8&255)/255,l=(255&r)/255,h=[.3,.59,.11,0,0,o,a,s,t=t||.2,0,u,c,l,e=e||.15,0,o-u,a-c,s-l,0,0];this._loadMatrix(h,i)},e.prototype.night=function(t,e){var n=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.predator=function(t,e){var n=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(r.Filter);n.ColorMatrixFilter=o,o.prototype.grayscale=o.prototype.greyscale},{"@pixi/core":"CJJk"}],VFce:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.DisplacementFilter=void 0;var r=t("@pixi/core"),i=t("@pixi/math"),o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var a=function(t){function e(e,n){var r=this,o=new i.Matrix;return e.renderable=!1,(r=t.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:o,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,r.maskMatrix=o,null==n&&(n=20),r.scale=new i.Point(n,n),r}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.apply=function(t,e,n,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),t.applyFilter(this,e,n,r)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(r.Filter);n.DisplacementFilter=a},{"@pixi/core":"CJJk","@pixi/math":"bSXT"}],slt5:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.FXAAFilter=void 0;var r=t("@pixi/core"),i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var o=function(t){function e(){return t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e}(r.Filter);n.FXAAFilter=o},{"@pixi/core":"CJJk"}],KwVI:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.NoiseFilter=void 0;var r=t("@pixi/core"),i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var o=function(t){function e(e,n){void 0===e&&(e=.5),void 0===n&&(n=Math.random());var i=t.call(this,r.defaultFilterVertex,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return i.noise=e,i.seed=n,i}return function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(r.Filter);n.NoiseFilter=o},{"@pixi/core":"CJJk"}],EByM:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.CacheData=void 0;var r=t("@pixi/core"),i=t("@pixi/sprite"),o=t("@pixi/display"),a=t("@pixi/math"),s=t("@pixi/utils"),u=t("@pixi/settings"),c=new a.Matrix;o.DisplayObject.prototype._cacheAsBitmap=!1,o.DisplayObject.prototype._cacheData=null;var l=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};n.CacheData=l,Object.defineProperties(o.DisplayObject.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new l),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),o.DisplayObject.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},o.DisplayObject.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters){var o=this.filters[0].padding;n.pad(o)}n.ceil(u.settings.RESOLUTION);var a=t.renderTexture.current,l=t.renderTexture.sourceFrame.clone(),h=t.projection.transform,f=r.RenderTexture.create({width:n.width,height:n.height}),p="cacheAsBitmap_"+(0,s.uid)();this._cacheData.textureCacheId=p,r.BaseTexture.addToCache(f.baseTexture,p),r.Texture.addToCache(f,p);var d=this.transform.localTransform.copyTo(c).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,t.render(this,f,!0,d,!1),t.projection.transform=h,t.renderTexture.bind(a,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var m=new i.Sprite(f);m.transform.worldTransform=this.transform.worldTransform,m.anchor.x=-n.x/n.width,m.anchor.y=-n.y/n.height,m.alpha=e,m._bounds=this._bounds,this._cacheData.sprite=m,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=m.containsPoint.bind(m)}},o.DisplayObject.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},o.DisplayObject.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var o=t.context,a=t._projTransform;e.ceil(u.settings.RESOLUTION);var l=r.RenderTexture.create({width:e.width,height:e.height}),h="cacheAsBitmap_"+(0,s.uid)();this._cacheData.textureCacheId=h,r.BaseTexture.addToCache(l.baseTexture,h),r.Texture.addToCache(l,h);var f=c;this.transform.localTransform.copyTo(f),f.invert(),f.tx-=e.x,f.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,l,!0,f,!1),t.context=o,t._projTransform=a,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var p=new i.Sprite(l);p.transform.worldTransform=this.transform.worldTransform,p.anchor.x=-e.x/e.width,p.anchor.y=-e.y/e.height,p.alpha=n,p._bounds=this._bounds,this._cacheData.sprite=p,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=p.containsPoint.bind(p)}},o.DisplayObject.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},o.DisplayObject.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},o.DisplayObject.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,r.BaseTexture.removeFromCache(this._cacheData.textureCacheId),r.Texture.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},o.DisplayObject.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)}},{"@pixi/core":"CJJk","@pixi/sprite":"TYml","@pixi/display":"sIot","@pixi/math":"bSXT","@pixi/utils":"xS69","@pixi/settings":"HWBD"}],xkkY:[function(t,e,n){var r=t("@pixi/display");r.DisplayObject.prototype.name=null,r.Container.prototype.getChildByName=function(t,e){for(var n=0,r=this.children.length;n0){var f=s.x-t[l].x,p=s.y-t[l].y,d=Math.sqrt(f*f+p*p);s=t[l],a+=d/u}else a=l/(c-1);i[h]=a,i[h+1]=0,i[h+2]=a,i[h+3]=1}var m=0;for(l=0;l0?this.textureScale*this._width/2:this._width/2;r/=l,i/=l,r*=h,i*=h,o[c]=u.x+r,o[c+1]=u.y+i,o[c+2]=u.x-r,o[c+3]=u.y-i,n=u}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(r.MeshGeometry);n.RopeGeometry=c;var l=function(t){function e(e,n,o){void 0===o&&(o=0);var a=this,s=new c(e.height,n,o),u=new r.MeshMaterial(e);return o>0&&(e.baseTexture.wrapMode=i.WRAP_MODES.REPEAT),(a=t.call(this,s,u)||this).autoUpdate=!0,a}return s(e,t),e.prototype._render=function(e){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),t.prototype._render.call(this,e)},e}(r.Mesh);n.SimpleRope=l;var h=function(t){function e(e,n,i){var a=this,s=new u(e.width,e.height,n,i),c=new r.MeshMaterial(o.Texture.WHITE);return(a=t.call(this,s,c)||this).texture=e,a}return s(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry;t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build()},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e}(r.Mesh);n.SimplePlane=h;var f=function(t){function e(e,n,i,a,s){void 0===e&&(e=o.Texture.EMPTY);var u=this,c=new r.MeshGeometry(n,i,a);c.getBuffer("aVertexPosition").static=!1;var l=new r.MeshMaterial(e);return(u=t.call(this,c,l,null,s)||this).autoUpdate=!0,u}return s(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(r.Mesh);n.SimpleMesh=f;var p=function(t){function e(e,n,r,i,a){void 0===n&&(n=10),void 0===r&&(r=10),void 0===i&&(i=10),void 0===a&&(a=10);var s=t.call(this,o.Texture.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=n,s._rightWidth=i,s._topHeight=r,s._bottomHeight=a,s.texture=e,s}return s(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,n=this._topHeight+this._bottomHeight,r=this._height>n?1:this._height/n;return Math.min(e,r)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var n=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=n*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-n*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(h);n.NineSlicePlane=p},{"@pixi/mesh":"XyDc","@pixi/constants":"u0xz","@pixi/core":"CJJk"}],D9aw:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.AnimatedSprite=void 0;var r=t("@pixi/core"),i=t("@pixi/sprite"),o=t("@pixi/ticker"),a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var s=function(t){function e(e,n){void 0===n&&(n=!0);var i=t.call(this,e[0]instanceof r.Texture?e[0]:e[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=n,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=e,i}return function(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(o.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(o.Ticker.shared.add(this.update,this,o.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,n=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramen)&&this.onLoop(),this.updateTexture())},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var n=[],i=0;i0?this.responses[0].data:null}},{key:"isProcessed",value:function(){return 0!==this.responses.length}},{key:"isSuccess",value:function(){return!this.isError()}},{key:"isError",value:function(){return!!this.responses.filter((function(t){return null!=t.error})).length}}]),t}();n.MessageResponses=a;var s=function(){function t(e,n,i,o){r(this,t),this._action=null,this._component=null,this._gameObject=null,this.data=null,this.expired=!1,this._action=e,this._component=n,this._gameObject=i,this.data=o,this.responses=new a}return o(t,[{key:"action",get:function(){return this._action}},{key:"component",get:function(){return this._component}},{key:"gameObject",get:function(){return this._gameObject}}]),t}();n.default=s},{}],n89G:[function(t,e,n){var r;Object.defineProperty(n,"__esModule",{value:!0}),n.Messages=void 0,n.Messages=r,function(t){t.ANY="ANY",t.OBJECT_ADDED="OBJECT_ADDED",t.OBJECT_REMOVED="OBJECT_REMOVED",t.COMPONENT_ADDED="COMPONENT_ADDED",t.COMPONENT_DETACHED="COMPONENT_DETACHED",t.COMPONENT_REMOVED="COMPONENT_REMOVED",t.ATTRIBUTE_ADDED="ATTRIBUTE_ADDED",t.ATTRIBUTE_CHANGED="ATTRIBUTE_CHANGED",t.ATTRIBUTE_REMOVED="ATTRIBUTE_REMOVED",t.STATE_CHANGED="STATE_CHANGED",t.FLAG_CHANGED="FLAG_CHANGED",t.TAG_ADDED="TAG_ADDED",t.TAG_REMOVED="TAG_REMOVED",t.SCENE_CLEAR="SCENE_CLEAR"}(r||(n.Messages=r={}))},{}],jR7U:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ComponentState=void 0;var r,i=function(t){return t&&t.__esModule?t:{default:t}}(t("./message"));function o(t,e){for(var n=0;n128)throw new Error("Only flag values between 1-128 are supported");var e=this.getFlagIndex(t),n=1<128)throw new Error("Flag at unsupported index");var n=this.getFlagIndex(e),r=1<=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]&&arguments[1]){if(!this.isOnScene)throw new Error("This object hasn't been added to the scene yet");if(this._internalState===r.DETACHED)throw new Error("Can't run a component upon a detached object!");this.initNewComponent(t),this.waitingForUpdate||t.onUpdate(this.scene.currentDelta,this.scene.currentAbsolute)}else this.componentsToAdd.push(t)}},{key:"removeComponent",value:function(t){t._cmpState===i.ComponentState.RUNNING&&(t.onFinish(),t._cmpState=i.ComponentState.FINISHED),t.onDetach(),t._cmpState=i.ComponentState.DETACHED,t.onRemove(),t._cmpState=i.ComponentState.REMOVED,t._lastFixedUpdate=0,t.owner=null,this.components.delete(t.id),this.isOnScene&&this.scene._onComponentRemoved(t,this)}},{key:"removeAllComponents",value:function(){var e,n=u(this.components);try{for(n.s();!(e=n.n()).done;){var r=s(e.value,2)[1];this.removeComponent(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"findComponentByName",value:function(t){var e,n=u(this.components);try{for(n.s();!(e=n.n()).done;){var r=s(e.value,2)[1];if(r.name===t)return r}}catch(a){n.e(a)}finally{n.f()}return null}},{key:"assignAttribute",value:function(t,e){if(this.attributes.has(t)){var n=this.attributes.get(t);this.attributes.set(t,e),this.isOnScene&&this.scene._onAttributeChanged(t,n,e,this)}else this.attributes.set(t,e),this.isOnScene&&this.scene._onAttributeAdded(t,e,this)}},{key:"getAttribute",value:function(t){return this.attributes.get(t)}},{key:"removeAttribute",value:function(t){if(this.attributes.has(t)){var e=this.attributes.get(t);return this.attributes.delete(t),this.isOnScene&&this.scene._onAttributeRemoved(t,e,this),!0}return!1}},{key:"addTag",value:function(t){this._tags.add(t),this.isOnScene&&this.scene._onTagAdded(t,this)}},{key:"removeTag",value:function(t){this._tags.has(t)&&(this._tags.delete(t),this.isOnScene&&this.scene._onTagRemoved(t,this))}},{key:"hasTag",value:function(t){return this._tags.has(t)}},{key:"setFlag",value:function(t){this.flags.setFlag(t),this.isOnScene&&this.scene._onFlagChanged(t,!0,this)}},{key:"resetFlag",value:function(t){this.flags.resetFlag(t),this.isOnScene&&this.scene._onFlagChanged(t,!1,this)}},{key:"hasFlag",value:function(t){return this.flags.hasFlag(t)}},{key:"invertFlag",value:function(t){this.flags.invertFlag(t),this.isOnScene&&this.scene._onFlagChanged(t,this.flags.hasFlag(t),this)}},{key:"onChildAdded",value:function(t){if(t.internalState===r.ATTACHED)throw new Error("This object has already been added to the scene: ".concat(t.pixiObj.name));t.scene=this.scene,t.attach()}},{key:"onChildDetached",value:function(t){t.detach()}},{key:"onChildDestroyed",value:function(t){t.destroy()}},{key:"update",value:function(t,e){this.initNewComponents();var n,r=u(this.components);try{for(r.s();!(n=r.n()).done;){var o=s(n.value,2)[1];if(o._cmpState===i.ComponentState.RUNNING&&(o.onUpdate(t,e),o.fixedFrequency&&e-o._lastFixedUpdate>=1e3/o.fixedFrequency)){var a=0===o._lastFixedUpdate?1e3/o.fixedFrequency:e-o._lastFixedUpdate;o.onFixedUpdate(a,e),o._lastFixedUpdate=e}}}catch(f){r.e(f)}finally{r.f()}var c,l=u(this.pixiObj.children);try{for(l.s();!(c=l.n()).done;){var h=c.value;h&&h._proxy&&h._proxy.update(t,e)}}catch(f){l.e(f)}finally{l.f()}this.lastAbsolute=e}},{key:"initNewComponent",value:function(t){if(!this.isOnScene)throw new Error("The object must be on the scene before its components are initialized");if(null!==t.owner)throw new Error("The component ".concat(t.name,":").concat(t.id," seems to already have a game object assigned!"));t.owner=this.pixiObj,this.components.set(t.id,t),this.scene._onComponentAdded(t,this),t.onInit(),t._cmpState=i.ComponentState.INITIALIZED,t.onAttach(),t._cmpState=i.ComponentState.RUNNING}},{key:"initNewComponents",value:function(){var t=this;if(0!==this.componentsToAdd.length){var e=a(this.componentsToAdd);this.componentsToAdd=[],e.forEach((function(e){t.components.set(e.id,e),t.initNewComponent(e)}))}}},{key:"attach",value:function(){var t=this;this._internalState=r.ATTACHED,this.scene._onObjectAdded(this),this.initNewComponents(),this.components.forEach((function(e){e.cmpState===i.ComponentState.DETACHED&&(t.scene._onComponentAdded(e,t),e.onAttach(),e._cmpState=i.ComponentState.RUNNING)}));var e,n=u(this.pixiObj.children);try{for(n.s();!(e=n.n()).done;){var o=e.value;o&&o._proxy&&o._proxy.attach()}}catch(a){n.e(a)}finally{n.f()}}},{key:"detach",value:function(){var t=this;this._internalState=r.DETACHED,this.components.forEach((function(e){e._cmpState!==i.ComponentState.DETACHED&&(t.scene._onComponentDetached(e),e.onDetach(),e._cmpState=i.ComponentState.DETACHED)})),this.scene._onObjectRemoved(this);var e,n=u(this.pixiObj.children);try{for(n.s();!(e=n.n()).done;){var o=e.value;o&&o._proxy&&o._proxy.detach()}}catch(a){n.e(a)}finally{n.f()}}},{key:"destroy",value:function(){this._internalState=r.DESTROYED,this.removeAllComponents(),this.scene._onObjectRemoved(this);var t,e=u(this.pixiObj.children);try{for(e.s();!(t=e.n()).done;){var n=t.value;n&&n._proxy&&n._proxy.destroy()}}catch(a){e.e(a)}finally{e.f()}}},{key:"id",get:function(){return this._id}},{key:"pixiObj",get:function(){return this._pixiObj}},{key:"scene",get:function(){return this._scene},set:function(t){this._scene=t}},{key:"rawAttributes",get:function(){return this.attributes}},{key:"rawComponents",get:function(){return this.components}},{key:"tags",get:function(){return new Set(this._tags)}},{key:"isOnScene",get:function(){return null!==this.scene}},{key:"internalState",get:function(){return this._internalState}},{key:"waitingForUpdate",get:function(){return this.lastAbsolutet.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"";return l(this,n),(t=e.call(this))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}(this.itemKeys.get(t.id));try{for(n.s();!(e=n.n()).done;){var r=e.value;this.remove(r,t)}}catch(i){n.e(i)}finally{n.f()}this.itemKeys.delete(t.id)}}},{key:"findFirst",value:function(t){return this.items.has(t)?this.items.get(t).values().next().value:null}},{key:"findAll",value:function(t){return this.items.has(t)?r(this.items.get(t).values()):[]}},{key:"clear",value:function(){this.items.clear(),this.itemKeys.clear()}}]),t}();n.LookupMap=s},{}],DRet:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.KeyInputComponent=n.Keys=void 0;var r,i=function(t){return t&&t.__esModule?t:{default:t}}(t("../engine/component"));function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return this.keys.has(t)||e&&this.handledKeys.has(t)}},{key:"handleKey",value:function(t){this.keys.delete(t),this.handledKeys.add(t)}},{key:"pressKey",value:function(t){this.handledKeys.has(t)||this.keys.add(t)}},{key:"releaseKey",value:function(t){this.handledKeys.delete(t),this.keys.delete(t)}}]),n}();n.KeyInputComponent=h},{"../engine/component":"jR7U"}],QNqz:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("../engine/component")),i=t("../engine/constants"),o=t("./key-input-component");function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=r.delay&&(this.pendingInvocations.splice(n,1),r.action(),this.sceneCleared))break}}},{key:"_subscribeComponent",value:function(t,e){this.subscribers.insert(t,e)}},{key:"_unsubscribeComponent",value:function(t,e){this.subscribers.remove(t,e)}},{key:"_onObjectAdded",value:function(t){var e=this,n=t.pixiObj;this.config.namesSearchEnabled&&this.gameObjectNames.insert(n.name,n),this.config.flagsSearchEnabled&&t.getAllFlags().forEach((function(t){return e.gameObjectFlags.insert(t,n)})),this.config.tagsSearchEnabled&&t.tags.forEach((function(t){return e.gameObjectTags.insert(t,n)})),this.config.statesSearchEnabled&&this.gameObjectStates.insert(n.stateId,n),this.gameObjects.set(t.id,t.pixiObj),this.sendMessage(new r.default(i.Messages.OBJECT_ADDED,null,t.pixiObj))}},{key:"_onObjectRemoved",value:function(t){var e=t.pixiObj;this.config.namesSearchEnabled&&this.gameObjectNames.remove(e.name,e),this.config.flagsSearchEnabled&&this.gameObjectFlags.removeItem(e),this.config.statesSearchEnabled&&this.gameObjectStates.removeItem(e),this.config.tagsSearchEnabled&&this.gameObjectTags.removeItem(e),this.gameObjects.delete(t.id),this.sendMessage(new r.default(i.Messages.OBJECT_REMOVED,null,e))}},{key:"_onComponentAdded",value:function(t,e){t.scene=this,this.sendMessage(new r.default(i.Messages.COMPONENT_ADDED,t,e.pixiObj))}},{key:"_onComponentDetached",value:function(t){this.subscribers.removeItem(t),this.sendMessage(new r.default(i.Messages.COMPONENT_DETACHED,t,t.owner))}},{key:"_onComponentRemoved",value:function(t,e){this.subscribers.removeItem(t),this.sendMessage(new r.default(i.Messages.COMPONENT_REMOVED,t,e.pixiObj))}},{key:"_onStateChanged",value:function(t,e,n){if(this.config.statesSearchEnabled&&(this.gameObjectStates.remove(t,n.pixiObj),this.gameObjectStates.insert(e,n.pixiObj)),this.config.notifyStateChanges){var o={previous:t,current:e};this.sendMessage(new r.default(i.Messages.STATE_CHANGED,null,n.pixiObj,o))}}},{key:"_onAttributeAdded",value:function(t,e,n){if(this.config.notifyAttributeChanges){var o={key:t,type:i.Messages.ATTRIBUTE_ADDED,previousValue:null,currentValue:e};this.sendMessage(new r.default(i.Messages.ATTRIBUTE_ADDED,null,n.pixiObj,o))}}},{key:"_onAttributeChanged",value:function(t,e,n,o){if(this.config.notifyAttributeChanges){var a={key:t,type:i.Messages.ATTRIBUTE_CHANGED,previousValue:e,currentValue:n};this.sendMessage(new r.default(i.Messages.ATTRIBUTE_CHANGED,null,o.pixiObj,a))}}},{key:"_onAttributeRemoved",value:function(t,e,n){if(this.config.notifyAttributeChanges){var o={key:t,type:i.Messages.ATTRIBUTE_REMOVED,previousValue:e,currentValue:null};this.sendMessage(new r.default(i.Messages.ATTRIBUTE_REMOVED,null,n.pixiObj,o))}}},{key:"_onFlagChanged",value:function(t,e,n){if(this.config.flagsSearchEnabled&&(e?this.gameObjectFlags.insert(t,n.pixiObj):this.gameObjectFlags.remove(t,n.pixiObj)),this.config.notifyFlagChanges){var o={flag:t,isSet:e};this.sendMessage(new r.default(i.Messages.FLAG_CHANGED,null,n.pixiObj,o))}}},{key:"_onTagAdded",value:function(t,e){if(this.config.tagsSearchEnabled&&this.gameObjectTags.insert(t,e.pixiObj),this.config.notifyTagChanges){var n={tag:t,type:i.Messages.TAG_ADDED};this.sendMessage(new r.default(i.Messages.TAG_ADDED,null,e.pixiObj,n))}}},{key:"_onTagRemoved",value:function(t,e){if(this.config.tagsSearchEnabled&&this.gameObjectTags.remove(t,e.pixiObj),this.config.notifyTagChanges){var n={tag:t,type:i.Messages.TAG_REMOVED};this.sendMessage(new r.default(i.Messages.TAG_REMOVED,null,e.pixiObj,n))}}},{key:"initConfig",value:function(t){this._config=Object.assign(Object.assign({},y),t)}},{key:"config",get:function(){return this._config}},{key:"currentDelta",get:function(){return this._currentDelta}},{key:"currentAbsolute",get:function(){return this._currentAbsolute}}]),t}();n.default=v},{"./message":"JZGm","./constants":"n89G","./game-objects/container":"OTmP","../utils/lookup-map":"aRmU","../components/debug-component":"QNqz","../utils/query-condition":"IzCQ"}],nbel:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.resizeContainer=n.isMobileDevice=void 0;var r=function(){return/(iphone|ipod|ipad|android)/gi.test(navigator.userAgent)};n.isMobileDevice=r;n.resizeContainer=function(t,e,n){var i,o=!1;window.innerWidth/window.innerHeight>e/n?i=window.innerHeight/n:(i=window.innerWidth/e,o=!0);var a=function(){return setTimeout((function(){window.scrollTo(0,1)}),10)};r()&&(document.documentElement.style.setProperty("--vh",.01*window.innerHeight+"px"),window.addEventListener("load",a,!1),window.addEventListener("orientationchange",a,!1));var s="scale(".concat(i,")"),u=o?window.innerHeight/2-n/2:(i-1)*n/2;t.style.setProperty("position","absolute"),t.style.setProperty("MozTransform",s),t.style.setProperty("transform",s),t.style.setProperty("WebkitTransform",s),t.style.setProperty("top",u+"px"),t.style.setProperty("left",(i-1)*e/2+(window.innerWidth-e*i)/2+"px")}},{}],Nf9Y:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.GameLoopType=void 0;var r,i=u(t("pixi.js")),o=u(t("./scene")),a=t("../utils/helpers");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function c(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16777215;return l(this,n),(t=e.call(this,o,{fontName:a,fontSize:s,tint:u}))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){return this}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"";return l(this,n),(t=e.call(this))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){return this}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0;return l(this,n),(t=e.call(this,o,a,s,u))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){return this}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0;return l(this,n),(t=e.call(this,o,a,s,u,c))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){return this}},{key:"asNineSlicePlane",value:function(){return this}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){return this}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"";return l(this,n),(t=e.call(this))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){return this}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;return l(this,n),(t=e.call(this,o))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){return this}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return l(this,n),(t=e.call(this,o))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){return this}},{key:"asText",value:function(){return this}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;return l(this,n),(t=e.call(this,o,a,s))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){return this}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){return this}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;return l(this,n),(t=e.call(this,o,a))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){return this}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){return this}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0;return l(this,n),(t=e.call(this,o,a,s,u,c))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){return this}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){return this}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;return l(this,n),(t=e.call(this,o,a,s))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){return this}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){return this}},{key:"asSimpleRope",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;return l(this,n),(t=e.call(this,o,a,s))._proxy=new r.default(i,y(t)),t}return function(t,e,n){e&&h(t.prototype,e),n&&h(t,n)}(n,[{key:"asAnimatedSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asBitmapText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asContainer",value:function(){return this}},{key:"asGraphics",value:function(){throw new Error("Can't cast to this object!")}},{key:"asMesh",value:function(){return this}},{key:"asNineSlicePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asParticleContainer",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleMesh",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimplePlane",value:function(){throw new Error("Can't cast to this object!")}},{key:"asSimpleRope",value:function(){return this}},{key:"asSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"asText",value:function(){throw new Error("Can't cast to this object!")}},{key:"asTilingSprite",value:function(){throw new Error("Can't cast to this object!")}},{key:"addChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a&&a._proxy&&this._proxy.onChildDetached(a._proxy)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"destroyChild",value:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function E(t,e){if(t){if("string"==typeof t)return S(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return this.objectProps={text:t,fontName:e,fontSize:n,fontColor:i,type:r.BitmapText},this}},{key:"asGraphics",value:function(){return this.objectProps={type:r.Graphics},this}},{key:"asMesh",value:function(t,e){return this.objectProps={geometry:t,shader:e,type:r.Mesh},this}},{key:"asNineSlicePlane",value:function(t,e,n,i,o){return this.objectProps={type:r.NineSlicePlane,texture:t,leftWidth:e,topHeight:n,rightWidth:i,bottomHeight:o},this}},{key:"asParticleContainer",value:function(){return this.objectProps={type:r.ParticleContainer},this}},{key:"asSimpleMesh",value:function(t,e){return this.objectProps={type:r.SimpleMesh,texture:t,vertices:e},this}},{key:"asSimplePlane",value:function(t,e,n){return this.objectProps={type:r.SimplePlane,texture:t,verticesX:e,verticesY:n},this}},{key:"asSimpleRope",value:function(t,e){return this.objectProps={type:r.SimpleRope,texture:t,points:e},this}},{key:"asSprite",value:function(t){return this.objectProps={texture:t,type:r.Sprite},this}},{key:"asTilingSprite",value:function(t,e,n){return this.objectProps={texture:t,width:e,height:n,type:r.TilingSprite},this}},{key:"asText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return this.objectProps={text:t,fontStyle:e,type:r.Text},this}},{key:"buildInto",value:function(t){return this.objectToBuild=t,this.process(!0)}},{key:"buildIntoAndKeepData",value:function(t){return this.objectToBuild=t,this.process(!1)}},{key:"build",value:function(){return this.process(!0)}},{key:"buildAndKeepData",value:function(){return this.process(!1)}},{key:"process",value:function(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(null!==this.objectToBuild)t=this.objectToBuild;else switch(this.objectProps.type){case r.Container:t=new a.default(this.props.name);break;case r.AnimatedSprite:t=new i.default(this.props.name,this.objectProps.textures);break;case r.BitmapText:t=new o.default(this.props.name,this.objectProps.text,this.objectProps.fontName,this.objectProps.fontSize,this.objectProps.fontColor);break;case r.Graphics:t=new s.default(this.props.name);break;case r.Mesh:t=new u.default(this.props.name,this.objectProps.geometry,this.objectProps.shader);break;case r.NineSlicePlane:t=new c.default(this.props.name,this.objectProps.texture,this.objectProps.leftWidth,this.objectProps.topHeight,this.objectProps.rightWidth,this.objectProps.bottomHeight);break;case r.ParticleContainer:t=new l.default(this.props.name);break;case r.SimpleMesh:t=new h.default(this.props.name,this.objectProps.texture,this.objectProps.vertices);break;case r.SimplePlane:t=new f.default(this.props.name,this.objectProps.texture,this.objectProps.verticesX,this.objectProps.verticesY);break;case r.SimpleRope:t=new p.default(this.props.name,this.objectProps.texture,this.objectProps.points);break;case r.Sprite:t=new d.default(this.props.name,this.objectProps.texture.clone());break;case r.Text:(t=new m.default(this.props.name,this.objectProps.text)).style=this.objectProps.fontStyle;break;case r.TilingSprite:t=new y.default(this.props.name,this.objectProps.texture.clone(),this.objectProps.width,this.objectProps.height)}var n,v=w(this.props.components);try{for(v.s();!(n=v.n()).done;){var b=n.value;t.addComponent(b)}}catch(z){v.e(z)}finally{v.f()}this.props.components=[];var x,E=w(this.props.componentBuilders);try{for(E.s();!(x=E.n()).done;){var S=x.value;t.addComponent(S())}}catch(z){E.e(z)}finally{E.f()}var T,M=w(this.props.attributes);try{for(M.s();!(T=M.n()).done;){var P=_(T.value,2),O=P[0],A=P[1];t.assignAttribute(O,A)}}catch(z){M.e(z)}finally{M.f()}var C,R=w(this.props.flags);try{for(R.s();!(C=R.n()).done;){var I=C.value;t.setFlag(I)}}catch(z){R.e(z)}finally{R.f()}null!=this.props.state&&(t.stateId=this.props.state),0!==this.props.tags.size&&this.props.tags.forEach((function(e){return t.addTag(e)}));var k=t.pixiObj;if(null!=this.props.scaleX&&(k.scale.x=this.props.scaleX),null!=this.props.scaleY&&(k.scale.y=this.props.scaleY),null!=this.props.relPosX){var L=new g.Point;L.x=this.props.relPosX*this.scene.width/this.scene.stage.scale.x,k.position.x=k.toLocal(L).x,null!=this.props.scaleX&&(k.position.x*=this.props.scaleX)}if(null!=this.props.relPosY){var j=new g.Point;j.y=this.props.relPosY*this.scene.height/this.scene.stage.scale.y,k.position.y=k.toLocal(j).y,null!=this.props.scaleY&&(k.position.y*=this.props.scaleY)}if(null!=this.props.locPosX&&(null!=this.props.relPosX?k.position.x+=this.props.locPosX:k.position.x=this.props.locPosX),null!=this.props.locPosY&&(null!=this.props.relPosY?k.position.y+=this.props.locPosY:k.position.y=this.props.locPosY),null!=this.props.absPosX){var D=new g.Point;D.x=this.props.absPosX,k.position.x=k.toLocal(D,this.scene.stage.pixiObj).x,null!=this.props.scaleX&&(k.position.x*=this.props.scaleX)}if(null!=this.props.absPosY){var N=new g.Point;N.y=this.props.absPosY,k.position.y=k.toLocal(N,this.scene.stage.pixiObj).y,null!=this.props.scaleY&&(k.position.y*=this.props.scaleY)}if(null!=this.props.anchorX&&(k instanceof d.default||k instanceof m.default?k.anchor.x=this.props.anchorX:k.pivot.x=this.props.anchorX*k.width),null!=this.props.anchorY&&(k instanceof d.default||k instanceof m.default?k.anchor.y=this.props.anchorY:k.pivot.y=this.props.anchorY*k.height),null!=this.props.virtAnchorX){var B=this.props.virtAnchorX-(null==this.props.anchorX?0:this.props.anchorX);k.position.x-=B*k.width}if(null!=this.props.virtAnchorY){var F=this.props.virtAnchorY-(null==this.props.anchorY?0:this.props.anchorY);k.position.y-=F*k.height}null!=this.props.parent&&this.props.parent.pixiObj.addChild(t.pixiObj);var U,G=w(this.children);try{for(G.s();!(U=G.n()).done;){var H=U.value.withParent(t).process(e);t.pixiObj.addChild(H.pixiObj)}}catch(z){G.e(z)}finally{G.f()}return e&&this.clear(),t}},{key:"clear",value:function(){return this.props={name:"",components:[],componentBuilders:[],attributes:new Map,flags:[],tags:new Set},this.objectProps={type:r.Container},this.objectToBuild=null,this.children=[],this}}]),t}();n.default=M},{"./game-objects/animated-sprite":"l0w2","./game-objects/bitmap-text":"HPPo","./game-objects/container":"OTmP","./game-objects/graphics":"VUdJ","./game-objects/mesh":"IiXL","./game-objects/nine-slice-plane":"gSRg","./game-objects/particle-container":"Tb9J","./game-objects/simple-mesh":"cxZT","./game-objects/simple-plane":"ZMkM","./game-objects/simple-rope":"yDtZ","./game-objects/sprite":"nlgN","./game-objects/text":"Wa9Q","./game-objects/tiling-sprite":"wS5x","./component":"jR7U","pixi.js":"FmRY"}],EvPM:[function(t,e,n){function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,t),this.key=0,this.param1=null,this.param2=null,this.param1C=null,this.param2C=null,this.cached=!1,this.next=null,this.previous=null,this.key=e,this.param1=n,this.param2=i,this.param1C=null,this.param2C=null}return o(t,[{key:"cacheParams",value:function(){this.cached||(null!=this.param1&&(this.param1C="function"==typeof this.param1?this.param1():this.param1),null!=this.param2&&(this.param2C="function"==typeof this.param2?this.param2():this.param2),this.cached=!0)}},{key:"getParam1",value:function(){return this.cached||this.cacheParams(),this.param1C}},{key:"setParam1",value:function(t){this.param1=t,this.param1C=t}},{key:"getParam2",value:function(){return this.cached||this.cacheParams(),this.param2C}},{key:"setParam2",value:function(t){this.param2=t,this.param2C=t}},{key:"resetCache",value:function(){this.param1C=this.param2C=null,this.cached=!1}}]),t}();n.default=a},{}],RXbb:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=u();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../engine/component")),i=t("../utils/query-condition"),o=s(t("../utils/stack")),a=s(t("../utils/cmd-node"));function s(t){return t&&t.__esModule?t:{default:t}}function u(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return u=function(){return t},t}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:"Chain";return f(this,n),(t=e.call(this)).scopeStack=new o.default,t.current=null,t.head=null,t.tail=null,t.tmpParam=null,t.tmpParam2=null,t.abortIfChecks=[],t._name=r,t}return function(t,e,n){e&&p(t.prototype,e),n&&p(t,n)}(n,[{key:"mergeAtBeginning",value:function(t){if(t.cmpState===r.ComponentState.RUNNING)throw new Error("Can't merge running component!");return this.head?(t.tail.next=this.head,this.head=t.head):(this.head=t.head,this.tail=t.tail),this.current=this.head,t.head=t.tail=null,this}},{key:"mergeWith",value:function(t){if(t.cmpState===r.ComponentState.RUNNING)throw new Error("Can't merge running component!");return this.tail?(this.tail.next=t.head,this.tail=t.tail):(this.tail=t.tail,this.head=t.head),t.head=t.tail=null,this}},{key:"beginRepeat",value:function(t){return this.enqueue(1,t,0===t),this}},{key:"endRepeat",value:function(){return this.enqueue(2),this}},{key:"call",value:function(t){return this.enqueue(3,t),this}},{key:"executeUpon",value:function(t){return t.addComponentAndRun(this),this}},{key:"beginWhile",value:function(t){return this.enqueue(4,t),this}},{key:"endWhile",value:function(){return this.enqueue(5),this}},{key:"beginInterval",value:function(t){return this.enqueue(6,t),this}},{key:"endInterval",value:function(){return this.enqueue(7),this}},{key:"beginIf",value:function(t){return this.enqueue(8,t),this}},{key:"else",value:function(){return this.enqueue(9),this}},{key:"endIf",value:function(){return this.enqueue(g),this}},{key:"addComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.enqueue(12,t,e),this}},{key:"waitFor",value:function(t){return this.enqueue(14,t),this}},{key:"waitForFirst",value:function(t){return this.enqueue(15,t),this}},{key:"waitUntil",value:function(t){return this.enqueue(16,t),this}},{key:"waitFrames",value:function(t){return this.enqueue(17,t),this}},{key:"waitTime",value:function(t){return this.enqueue(11,t),this}},{key:"waitForMessage",value:function(t){return this.enqueue(18,t),this}},{key:"waitForMessageConditional",value:function(t,e){return this.enqueue(19,t,e),this}},{key:"removeComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.enqueue(20,t,e),this}},{key:"detachGameObjectsByQuery",value:function(t){return this.enqueue(21,t),this}},{key:"destroyGameObjectsByQuery",value:function(t){return this.enqueue(22,t),this}},{key:"detachGameObject",value:function(t){return this.enqueue(23,t),this}},{key:"destroyGameObject",value:function(t){return this.enqueue(23,t),this}},{key:"addAbortCondition",value:function(t){return this.abortIfChecks.push(t),this}},{key:"onMessage",value:function(t){this.current&&(18===this.current.key&&this.current.param1===t.action||19===this.current.key&&this.current.param1===t.action&&(0,i.queryConditionCheck)(t.gameObject,this.current.param2))&&(this.tmpParam2=!0)}},{key:"onUpdate",value:function(t,e){var n=this;if(null!==this.owner){if(0!==this.abortIfChecks.length){var i,o=l(this.abortIfChecks);try{for(o.s();!(i=o.n()).done;)if((0,i.value)())return void this.finish()}catch(b){o.e(b)}finally{o.f()}}if(null==this.current&&(this.current=this.dequeue()),null!=this.current)switch(this.current.key){case 1:this.current.cacheParams(),this.scopeStack.push(this.current),this.gotoNextImmediately(t,e);break;case 2:var a=this.scopeStack.pop();a.setParam1(a.getParam1()-1),!0===a.getParam2()||a.getParam1()>0?(this.current=a,this.onUpdate(t,e)):(a.resetCache(),this.gotoNextImmediately(t,e));break;case 3:this.current.param1(this),this.gotoNextImmediately(t,e);break;case 4:this.scopeStack.push(this.current),this.gotoNextImmediately(t,e);break;case 5:var s=this.scopeStack.pop();s.param1()?(this.current=s,this.onUpdate(t,e)):this.gotoNextImmediately(t,e);break;case 6:this.current.cached||this.current.cacheParams(),null==this.tmpParam?this.tmpParam=e:e-this.tmpParam>=this.current.getParam1()&&(this.tmpParam=null,this.current.resetCache(),this.scopeStack.push(this.current),this.gotoNextImmediately(t,e));break;case 7:this.current=this.scopeStack.pop(),this.onUpdate(t,e);break;case 8:if(this.current.param1()){this.gotoNextImmediately(t,e);break}for(var u=1;;)if(this.current=this.dequeue(),8===this.current.key&&u++,this.current.key===g&&u--,1===u&&9===this.current.key||0===u&&this.current.key===g){this.gotoNext();break}this.onUpdate(t,e);break;case 9:for(var c=1;;)if(this.current=this.dequeue(),8===this.current.key&&c++,this.current.key===g&&c--,0===c&&this.current.key===g){this.gotoNext();break}this.onUpdate(t,e);break;case g:this.gotoNextImmediately(t,e);break;case 11:this.current.cacheParams(),null==this.tmpParam&&(this.tmpParam=e),e-this.tmpParam>this.current.getParam1()&&(this.tmpParam=null,this.current.resetCache(),this.gotoNextImmediately(t,e));break;case 12:(null!=this.current.getParam2()?this.current.getParam2():this.owner).addComponent(this.current.getParam1()),this.gotoNextImmediately(t,e);break;case 14:var h=!this.current.cached;this.current.cached||this.current.cacheParams();var f=this.current.getParam1(),p=Array.isArray(f);h&&(p||f.cmpState!==r.ComponentState.NEW?p&&f.filter((function(t){return t.cmpState===r.ComponentState.NEW})).forEach((function(t){return n.owner.addComponentAndRun(t)})):this.owner.addComponentAndRun(f)),(!p&&f.isCompleted||p&&0===f.filter((function(t){return t._cmpState===r.ComponentState.RUNNING})).length)&&(this.current.resetCache(),this.gotoNextImmediately(t,e));break;case 15:var d=!this.current.cached;this.current.cached||this.current.cacheParams();var m=this.current.getParam1();d&&m.filter((function(t){return t._cmpState===r.ComponentState.NEW})).forEach((function(t){return n.owner.addComponentAndRun(t)})),0!==m.filter((function(t){return t.isCompleted})).length&&(this.current.resetCache(),m.forEach((function(t){return t.finish()})),this.gotoNextImmediately(t,e));break;case 16:this.current.param1()||this.gotoNextImmediately(t,e);break;case 17:null==this.tmpParam&&(this.tmpParam=0),++this.tmpParam>this.current.param1&&(this.tmpParam=null,this.gotoNextImmediately(t,e));break;case 18:case 19:!0===this.tmpParam?!0===this.tmpParam2&&(this.unsubscribe(this.current.param1),this.tmpParam=this.tmpParam2=null,this.gotoNextImmediately(t,e)):(this.tmpParam=!0,this.tmpParam2=!1,this.subscribe(this.current.param1));break;case 20:var y=null!=this.current.param2?this.current.param2:this.owner;y.removeComponent(y.findComponentByName(this.current.param1)),this.gotoNextImmediately(t,e);break;case 21:var v,x=l(this.scene.findObjectsByQuery(this.current.param1));try{for(x.s();!(v=x.n()).done;)v.value.detach()}catch(b){x.e(b)}finally{x.f()}this.gotoNextImmediately(t,e);break;case 22:var _,w=l(this.scene.findObjectsByQuery(this.current.param1));try{for(w.s();!(_=w.n()).done;)_.value.detach()}catch(b){w.e(b)}finally{w.f()}this.gotoNextImmediately(t,e);break;case 23:this.current.param1.detach(),this.gotoNextImmediately(t,e);break;case 23:this.current.param1.destroy(),this.gotoNextImmediately(t,e)}else this.finish()}}},{key:"enqueue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=new a.default(t,e,n);null==this.head?this.head=this.tail=r:(this.tail.next=r,r.previous=this.tail,this.tail=r),null==this.current&&(this.current=this.head)}},{key:"dequeue",value:function(){return null==this.current||null==this.current.next?null:(this.current=this.current.next,this.current)}},{key:"gotoNext",value:function(){this.current=this.current.next}},{key:"gotoNextImmediately",value:function(t,e){this.current=this.current.next,this.onUpdate(t,e)}}]),n}();n.default=b},{"../engine/component":"jR7U","../utils/query-condition":"IzCQ","../utils/stack":"EvPM","../utils/cmd-node":"iN1m"}],JXEQ:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.FuncComponent=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(t("../engine/component")),i=t("../utils/query-condition");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}}(t,e)||u(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=u(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=this.duration?this.finish():null!=this.onUpdateFunc&&this.onUpdateFunc(this,t,e)}},{key:"onDetach",value:function(){null!=this.onDetachFunc&&this.onDetachFunc(this)}},{key:"onRemove",value:function(){null!=this.onRemoveFunc&&this.onRemoveFunc(this)}},{key:"onFinish",value:function(){this.firstRun=0,null!=this.onFinishFunc&&this.onFinishFunc(this)}},{key:"name",get:function(){return this._name}}]),n}();n.FuncComponent=m},{"../engine/component":"jR7U","../utils/query-condition":"IzCQ"}],EYRE:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.VirtualGamepadComponent=n.GamepadButtons=void 0;var r,i=t("./key-input-component"),o=function(t){return t&&t.__esModule?t:{default:t}}(t("../engine/game-objects/graphics"));function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:null;return this.messagesToSend.push(new o.default(t,this,this.owner,e)),null}},{key:"getMousePos",value:function(t,e,n){var r=t.getBoundingClientRect(),i=this.scene.app.renderer.resolution,o=n?e.changedTouches[0].clientX:e.clientX,a=n?e.changedTouches[0].clientY:e.clientY;return{posX:Math.round((o-r.left)/(r.right-r.left)*this.scene.app.view.width/i),posY:Math.round((a-r.top)/(r.bottom-r.top)*this.scene.app.view.height/i)}}}]),n}();n.PointerInputComponent=y},{"../engine/component":"jR7U","../engine/message":"JZGm"}],W4cB:[function(t,e,n){function r(t,e){for(var n=0;n0?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n>8&255]+k[t>>16&255]+k[t>>24&255]+"-"+k[255&e]+k[e>>8&255]+"-"+k[e>>16&15|64]+k[e>>24&255]+"-"+k[63&n|128]+k[n>>8&255]+"-"+k[n>>16&255]+k[n>>24&255]+k[255&r]+k[r>>8&255]+k[r>>16&255]+k[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(j=t%2147483647),((j=16807*j%2147483647)-1)/2147483646},degToRad:function(t){return t*D.DEG2RAD},radToDeg:function(t){return t*D.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),u=a(n/2),c=o((e+r)/2),l=a((e+r)/2),h=o((e-r)/2),f=a((e-r)/2),p=o((r-e)/2),d=a((r-e)/2);switch(i){case"XYX":t.set(s*l,u*h,u*f,s*c);break;case"YZY":t.set(u*f,s*l,u*h,s*c);break;case"ZXZ":t.set(u*h,u*f,s*l,s*c);break;case"XZX":t.set(s*l,u*d,u*p,s*c);break;case"YXY":t.set(u*p,s*l,u*d,s*c);break;case"ZYZ":t.set(u*d,u*p,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};n.MathUtils=n.Math=D;var N=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.setScalar=function(t){return this.x=t,this.y=t,this},e.setX=function(t){return this.x=t,this},e.setY=function(t){return this.y=t,this},e.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},e.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},e.clone=function(){return new this.constructor(this.x,this.y)},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},e.addScalar=function(t){return this.x+=t,this.y+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},e.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},e.subScalar=function(t){return this.x-=t,this.y-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this},e.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.applyMatrix3=function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.cross=function(t){return this.x*t.y-this.y*t.x},e.lengthSq=function(){return this.x*this.x+this.y*this.y},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.angle=function(){return Math.atan2(-this.y,-this.x)+Math.PI},e.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},e.distanceToSquared=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},e.manhattanDistanceTo=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this},e.equals=function(t){return t.x===this.x&&t.y===this.y},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},e.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},e.rotateAround=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this},Object(o.a)(t,[{key:"width",get:function(){return this.x},set:function(t){this.x=t}},{key:"height",get:function(){return this.y},set:function(t){this.y=t}}]),t}();n.Vector2=N;var B,F=function(){function t(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}var e=t.prototype;return e.set=function(t,e,n,r,i,o,a,s,u){var c=this.elements;return c[0]=t,c[1]=r,c[2]=a,c[3]=e,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=u,this},e.identity=function(){return this.set(1,0,0,0,1,0,0,0,1),this},e.clone=function(){return(new this.constructor).fromArray(this.elements)},e.copy=function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},e.extractBasis=function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},e.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},e.multiply=function(t){return this.multiplyMatrices(this,t)},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[3],s=n[6],u=n[1],c=n[4],l=n[7],h=n[2],f=n[5],p=n[8],d=r[0],m=r[3],y=r[6],v=r[1],g=r[4],b=r[7],x=r[2],_=r[5],w=r[8];return i[0]=o*d+a*v+s*x,i[3]=o*m+a*g+s*_,i[6]=o*y+a*b+s*w,i[1]=u*d+c*v+l*x,i[4]=u*m+c*g+l*_,i[7]=u*y+c*b+l*w,i[2]=h*d+f*v+p*x,i[5]=h*m+f*g+p*_,i[8]=h*y+f*b+p*w,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*o*c-e*a*u-n*i*c+n*a*s+r*i*u-r*o*s},e.getInverse=function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=t.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=n[8],p=f*u-c*h,d=c*l-f*s,m=h*s-u*l,y=i*p+o*d+a*m;if(0===y)return this.set(0,0,0,0,0,0,0,0,0);var v=1/y;return r[0]=p*v,r[1]=(a*h-f*o)*v,r[2]=(c*o-a*u)*v,r[3]=d*v,r[4]=(f*i-a*l)*v,r[5]=(a*s-c*i)*v,r[6]=m*v,r[7]=(o*l-h*i)*v,r[8]=(u*i-o*s)*v,this},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.getNormalMatrix=function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},e.transposeIntoArray=function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},e.setUvTransform=function(t,e,n,r,i,o,a){var s=Math.cos(i),u=Math.sin(i);this.set(n*s,n*u,-n*(s*o+u*a)+o+t,-r*u,r*s,-r*(-u*o+s*a)+a+e,0,0,1)},e.scale=function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},e.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],u=r[4],c=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*u,r[6]=e*a+n*c,r[1]=-n*i+e*s,r[4]=-n*o+e*u,r[7]=-n*a+e*c,this},e.translate=function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},e.equals=function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},e.fromArray=function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},e.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t},t}();n.Matrix3=F;var U={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===B&&(B=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),B.width=t.width,B.height=t.height;var n=B.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=B}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};n.ImageUtils=U;var G=0;function H(t,e,n,r,i,o,a,s,u,l){Object.defineProperty(this,"id",{value:G++}),this.uuid=D.generateUUID(),this.name="",this.image=void 0!==t?t:H.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:H.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:c,this.wrapT=void 0!==r?r:c,this.magFilter=void 0!==i?i:f,this.minFilter=void 0!==o?o:p,this.anisotropy=void 0!==u?u:1,this.format=void 0!==a?a:_,this.internalFormat=null,this.type=void 0!==s?s:d,this.offset=new N(0,0),this.repeat=new N(1,1),this.center=new N(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new F,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:P,this.version=0,this.onUpdate=null}H.DEFAULT_IMAGE=void 0,H.DEFAULT_MAPPING=300,H.prototype=Object.assign(Object.create(I.prototype),{constructor:H,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=D.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)switch(this.wrapS){case u:t.x=t.x-Math.floor(t.x);break;case c:t.x=t.x<0?0:1;break;case l:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case u:t.y=t.y-Math.floor(t.y);break;case c:t.y=t.y<0?0:1;break;case l:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(H.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var z=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=n,this.w=r}var e=t.prototype;return e.set=function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},e.setScalar=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},e.setX=function(t){return this.x=t,this},e.setY=function(t){return this.y=t,this},e.setZ=function(t){return this.z=t,this},e.setW=function(t){return this.w=t,this},e.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},e.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},e.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},e.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},e.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.applyMatrix4=function(t){var e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.setAxisAngleFromQuaternion=function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},e.setAxisAngleFromRotationMatrix=function(t){var e,n,r,i,o=t.elements,a=o[0],s=o[4],u=o[8],c=o[1],l=o[5],h=o[9],f=o[2],p=o[6],d=o[10];if(Math.abs(s-c)<.01&&Math.abs(u-f)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+c)<.1&&Math.abs(u+f)<.1&&Math.abs(h+p)<.1&&Math.abs(a+l+d-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,y=(l+1)/2,v=(d+1)/2,g=(s+c)/4,b=(u+f)/4,x=(h+p)/4;return m>y&&m>v?m<.01?(n=0,r=.707106781,i=.707106781):(r=g/(n=Math.sqrt(m)),i=b/n):y>v?y<.01?(n=.707106781,r=0,i=.707106781):(n=g/(r=Math.sqrt(y)),i=x/r):v<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(v)),r=x/i),this.set(n,r,i,e),this}var _=Math.sqrt((p-h)*(p-h)+(u-f)*(u-f)+(c-s)*(c-s));return Math.abs(_)<.001&&(_=1),this.x=(p-h)/_,this.y=(u-f)/_,this.z=(c-s)/_,this.w=Math.acos((a+l+d-1)/2),this},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},e.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},Object(o.a)(t,[{key:"width",get:function(){return this.z},set:function(t){this.z=t}},{key:"height",get:function(){return this.w},set:function(t){this.w=t}}]),t}();function V(t,e,n){this.width=t,this.height=e,this.scissor=new z(0,0,t,e),this.scissorTest=!1,this.viewport=new z(0,0,t,e),n=n||{},this.texture=new H(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:f,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function W(t,e,n){V.call(this,t,e,n),this.samples=4}n.Vector4=z,V.prototype=Object.assign(Object.create(I.prototype),{constructor:V,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),W.prototype=Object.assign(Object.create(V.prototype),{constructor:W,isWebGLMultisampleRenderTarget:!0,copy:function(t){return V.prototype.copy.call(this,t),this.samples=t.samples,this}});var X=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=n,this._w=r}t.slerp=function(t,e,n,r){return n.copy(t).slerp(e,r)},t.slerpFlat=function(t,e,n,r,i,o,a){var s=n[r+0],u=n[r+1],c=n[r+2],l=n[r+3],h=i[o+0],f=i[o+1],p=i[o+2],d=i[o+3];if(l!==d||s!==h||u!==f||c!==p){var m=1-a,y=s*h+u*f+c*p+l*d,v=y>=0?1:-1,g=1-y*y;if(g>Number.EPSILON){var b=Math.sqrt(g),x=Math.atan2(b,y*v);m=Math.sin(m*x)/b,a=Math.sin(a*x)/b}var _=a*v;if(s=s*m+h*_,u=u*m+f*_,c=c*m+p*_,l=l*m+d*_,m===1-a){var w=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=w,u*=w,c*=w,l*=w}}t[e]=s,t[e+1]=u,t[e+2]=c,t[e+3]=l},t.multiplyQuaternionsFlat=function(t,e,n,r,i,o){var a=n[r],s=n[r+1],u=n[r+2],c=n[r+3],l=i[o],h=i[o+1],f=i[o+2],p=i[o+3];return t[e]=a*p+c*l+s*f-u*h,t[e+1]=s*p+c*h+u*l-a*f,t[e+2]=u*p+c*f+a*h-s*l,t[e+3]=c*p-a*l-s*h-u*f,t};var e=t.prototype;return e.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},e.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},e.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},e.setFromEuler=function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,o=t._order,a=Math.cos,s=Math.sin,u=a(n/2),c=a(r/2),l=a(i/2),h=s(n/2),f=s(r/2),p=s(i/2);switch(o){case"XYZ":this._x=h*c*l+u*f*p,this._y=u*f*l-h*c*p,this._z=u*c*p+h*f*l,this._w=u*c*l-h*f*p;break;case"YXZ":this._x=h*c*l+u*f*p,this._y=u*f*l-h*c*p,this._z=u*c*p-h*f*l,this._w=u*c*l+h*f*p;break;case"ZXY":this._x=h*c*l-u*f*p,this._y=u*f*l+h*c*p,this._z=u*c*p+h*f*l,this._w=u*c*l-h*f*p;break;case"ZYX":this._x=h*c*l-u*f*p,this._y=u*f*l+h*c*p,this._z=u*c*p-h*f*l,this._w=u*c*l+h*f*p;break;case"YZX":this._x=h*c*l+u*f*p,this._y=u*f*l+h*c*p,this._z=u*c*p-h*f*l,this._w=u*c*l-h*f*p;break;case"XZY":this._x=h*c*l-u*f*p,this._y=u*f*l-h*c*p,this._z=u*c*p+h*f*l,this._w=u*c*l+h*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this},e.setFromAxisAngle=function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},e.setFromRotationMatrix=function(t){var e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],a=e[5],s=e[9],u=e[2],c=e[6],l=e[10],h=n+a+l;if(h>0){var f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(c-s)*f,this._y=(i-u)*f,this._z=(o-r)*f}else if(n>a&&n>l){var p=2*Math.sqrt(1+n-a-l);this._w=(c-s)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(i+u)/p}else if(a>l){var d=2*Math.sqrt(1+a-n-l);this._w=(i-u)/d,this._x=(r+o)/d,this._y=.25*d,this._z=(s+c)/d}else{var m=2*Math.sqrt(1+l-n-a);this._w=(o-r)/m,this._x=(i+u)/m,this._y=(s+c)/m,this._z=.25*m}return this._onChangeCallback(),this},e.setFromUnitVectors=function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},e.angleTo=function(t){return 2*Math.acos(Math.abs(D.clamp(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},e.identity=function(){return this.set(0,0,0,1)},e.inverse=function(){return this.conjugate()},e.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},e.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},e.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},e.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},e.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},e.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},e.premultiply=function(t){return this.multiplyQuaternions(t,this)},e.multiplyQuaternions=function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,u=e._z,c=e._w;return this._x=n*c+o*a+r*u-i*s,this._y=r*c+o*s+i*a-n*u,this._z=i*c+o*u+n*s-r*a,this._w=o*c-n*a-r*s-i*u,this._onChangeCallback(),this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*r+e*this._y,this._z=u*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,a),h=Math.sin((1-e)*l)/c,f=Math.sin(e*l)/c;return this._w=o*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,this._onChangeCallback(),this},e.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},e.fromArray=function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},e.fromBufferAttribute=function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},e._onChange=function(t){return this._onChangeCallback=t,this},e._onChangeCallback=function(){},Object(o.a)(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}]),t}();n.Quaternion=X;var Y=function(){function t(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=n}var e=t.prototype;return e.set=function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this},e.setScalar=function(t){return this.x=t,this.y=t,this.z=t,this},e.setX=function(t){return this.x=t,this},e.setY=function(t){return this.y=t,this},e.setZ=function(t){return this.z=t,this},e.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},e.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},e.clone=function(){return new this.constructor(this.x,this.y,this.z)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.applyEuler=function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(K.setFromEuler(t))},e.applyAxisAngle=function(t,e){return this.applyQuaternion(K.setFromAxisAngle(t,e))},e.applyMatrix3=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},e.applyNormalMatrix=function(t){return this.applyMatrix3(t).normalize()},e.applyMatrix4=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},e.applyQuaternion=function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,u=s*e+o*r-a*n,c=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=u*s+h*-i+c*-a-l*-o,this.y=c*s+h*-o+l*-i-u*-a,this.z=l*s+h*-a+u*-o-c*-i,this},e.project=function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},e.unproject=function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},e.transformDirection=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},e.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},e.cross=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},e.crossVectors=function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},e.projectOnVector=function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},e.projectOnPlane=function(t){return q.copy(this).projectOnVector(t),this.sub(q)},e.reflect=function(t){return this.sub(q.copy(t).multiplyScalar(2*this.dot(t)))},e.angleTo=function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(D.clamp(n,-1,1))},e.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},e.distanceToSquared=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},e.manhattanDistanceTo=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},e.setFromSpherical=function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},e.setFromSphericalCoords=function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},e.setFromCylindrical=function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},e.setFromCylindricalCoords=function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},e.setFromMatrixPosition=function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},e.setFromMatrixScale=function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},e.setFromMatrixColumn=function(t,e){return this.fromArray(t.elements,4*e)},e.setFromMatrix3Column=function(t,e){return this.fromArray(t.elements,3*e)},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},e.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();n.Vector3=Y;var q=new Y,K=new X,J=function(){function t(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new Y(1/0,1/0,1/0),this.max=void 0!==e?e:new Y(-1/0,-1/0,-1/0)}var e=t.prototype;return e.set=function(t,e){return this.min.copy(t),this.max.copy(e),this},e.setFromArray=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.length;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},e.setFromBufferAttribute=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.count;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},e.setFromPoints=function(t){this.makeEmpty();for(var e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},e.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},e.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Y),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},e.intersectsBox=function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},e.intersectsSphere=function(t){return this.clampPoint(t.center,$),$.distanceToSquared(t.center)<=t.radius*t.radius},e.intersectsPlane=function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},e.intersectsTriangle=function(t){if(this.isEmpty())return!1;this.getCenter(st),ut.subVectors(this.max,st),et.subVectors(t.a,st),nt.subVectors(t.b,st),rt.subVectors(t.c,st),it.subVectors(nt,et),ot.subVectors(rt,nt),at.subVectors(et,rt);var e=[0,-it.z,it.y,0,-ot.z,ot.y,0,-at.z,at.y,it.z,0,-it.x,ot.z,0,-ot.x,at.z,0,-at.x,-it.y,it.x,0,-ot.y,ot.x,0,-at.y,at.x,0];return!!Q(e,et,nt,rt,ut)&&!!Q(e=[1,0,0,0,1,0,0,0,1],et,nt,rt,ut)&&(ct.crossVectors(it,ot),Q(e=[ct.x,ct.y,ct.z],et,nt,rt,ut))},e.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Y),e.copy(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return $.copy(t).clamp(this.min,this.max).sub(t).length()},e.getBoundingSphere=function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize($).length(),t},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.applyMatrix4=function(t){return this.isEmpty()||(Z[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Z[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Z[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Z[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Z[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Z[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Z[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Z[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Z)),this},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}();function Q(t,e,n,r,i){for(var o=0,a=t.length-3;o<=a;o+=3){lt.fromArray(t,o);var s=i.x*Math.abs(lt.x)+i.y*Math.abs(lt.y)+i.z*Math.abs(lt.z),u=e.dot(lt),c=n.dot(lt),l=r.dot(lt);if(Math.max(-Math.max(u,c,l),Math.min(u,c,l))>s)return!1}return!0}n.Box3=J;var Z=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y],$=new Y,tt=new J,et=new Y,nt=new Y,rt=new Y,it=new Y,ot=new Y,at=new Y,st=new Y,ut=new Y,ct=new Y,lt=new Y,ht=new J,ft=function(){function t(t,e){this.center=void 0!==t?t:new Y,this.radius=void 0!==e?e:-1}var e=t.prototype;return e.set=function(t,e){return this.center.copy(t),this.radius=e,this},e.setFromPoints=function(t,e){var n=this.center;void 0!==e?n.copy(e):ht.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;ithis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},e.getBoundingBox=function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new J),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},e.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},e.translate=function(t){return this.center.add(t),this},e.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius},t}();n.Sphere=ft;var pt=new Y,dt=new Y,mt=new Y,yt=new Y,vt=new Y,gt=new Y,bt=new Y,xt=function(){function t(t,e){this.origin=void 0!==t?t:new Y,this.direction=void 0!==e?e:new Y(0,0,-1)}var e=t.prototype;return e.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},e.at=function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Y),e.copy(this.direction).multiplyScalar(t).add(this.origin)},e.lookAt=function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},e.recast=function(t){return this.origin.copy(this.at(t,pt)),this},e.closestPointToPoint=function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Y),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},e.distanceToPoint=function(t){return Math.sqrt(this.distanceSqToPoint(t))},e.distanceSqToPoint=function(t){var e=pt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(pt.copy(this.direction).multiplyScalar(e).add(this.origin),pt.distanceToSquared(t))},e.distanceSqToSegment=function(t,e,n,r){dt.copy(t).add(e).multiplyScalar(.5),mt.copy(e).sub(t).normalize(),yt.copy(this.origin).sub(dt);var i,o,a,s,u=.5*t.distanceTo(e),c=-this.direction.dot(mt),l=yt.dot(this.direction),h=-yt.dot(mt),f=yt.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(o=c*l-h,s=u*p,(i=c*h-l)>=0)if(o>=-s)if(o<=s){var d=1/p;a=(i*=d)*(i+c*(o*=d)+2*l)+o*(c*i+o+2*h)+f}else o=u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+f;else o=-u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+f;else o<=-s?a=-(i=Math.max(0,-(-c*u+l)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+f:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+f):a=-(i=Math.max(0,-(c*u+l)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+f;else o=c>0?-u:u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+f;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(mt).multiplyScalar(o).add(dt),a},e.intersectSphere=function(t,e){pt.subVectors(t.center,this.origin);var n=pt.dot(this.direction),r=pt.dot(pt)-n*n,i=t.radius*t.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)},e.intersectsSphere=function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},e.distanceToPlane=function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},e.intersectPlane=function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},e.intersectsPlane=function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},e.intersectBox=function(t,e){var n,r,i,o,a,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,h=this.origin;return u>=0?(n=(t.min.x-h.x)*u,r=(t.max.x-h.x)*u):(n=(t.max.x-h.x)*u,r=(t.min.x-h.x)*u),c>=0?(i=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(i=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,e)))},e.intersectsBox=function(t){return null!==this.intersectBox(t,pt)},e.intersectTriangle=function(t,e,n,r,i){vt.subVectors(e,t),gt.subVectors(n,t),bt.crossVectors(vt,gt);var o,a=this.direction.dot(bt);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}yt.subVectors(this.origin,t);var s=o*this.direction.dot(gt.crossVectors(yt,gt));if(s<0)return null;var u=o*this.direction.dot(vt.cross(yt));if(u<0)return null;if(s+u>a)return null;var c=-o*yt.dot(bt);return c<0?null:this.at(c/a,i)},e.applyMatrix4=function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},e.equals=function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)},t}();n.Ray=xt;var _t=function(){function t(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}var e=t.prototype;return e.set=function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,m){var y=this.elements;return y[0]=t,y[4]=e,y[8]=n,y[12]=r,y[1]=i,y[5]=o,y[9]=a,y[13]=s,y[2]=u,y[6]=c,y[10]=l,y[14]=h,y[3]=f,y[7]=p,y[11]=d,y[15]=m,this},e.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},e.clone=function(){return(new t).fromArray(this.elements)},e.copy=function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},e.copyPosition=function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},e.extractBasis=function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},e.makeBasis=function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},e.extractRotation=function(t){var e=this.elements,n=t.elements,r=1/wt.setFromMatrixColumn(t,0).length(),i=1/wt.setFromMatrixColumn(t,1).length(),o=1/wt.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},e.makeRotationFromEuler=function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*c,f=o*l,p=a*c,d=a*l;e[0]=s*c,e[4]=-s*l,e[8]=u,e[1]=f+p*u,e[5]=h-d*u,e[9]=-a*s,e[2]=d-h*u,e[6]=p+f*u,e[10]=o*s}else if("YXZ"===t.order){var m=s*c,y=s*l,v=u*c,g=u*l;e[0]=m+g*a,e[4]=v*a-y,e[8]=o*u,e[1]=o*l,e[5]=o*c,e[9]=-a,e[2]=y*a-v,e[6]=g+m*a,e[10]=o*s}else if("ZXY"===t.order){var b=s*c,x=s*l,_=u*c,w=u*l;e[0]=b-w*a,e[4]=-o*l,e[8]=_+x*a,e[1]=x+_*a,e[5]=o*c,e[9]=w-b*a,e[2]=-o*u,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){var E=o*c,S=o*l,T=a*c,M=a*l;e[0]=s*c,e[4]=T*u-S,e[8]=E*u+M,e[1]=s*l,e[5]=M*u+E,e[9]=S*u-T,e[2]=-u,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var P=o*s,O=o*u,A=a*s,C=a*u;e[0]=s*c,e[4]=C-P*l,e[8]=A*l+O,e[1]=l,e[5]=o*c,e[9]=-a*c,e[2]=-u*c,e[6]=O*l+A,e[10]=P-C*l}else if("XZY"===t.order){var R=o*s,I=o*u,k=a*s,L=a*u;e[0]=s*c,e[4]=-l,e[8]=u*c,e[1]=R*l+L,e[5]=o*c,e[9]=I*l-k,e[2]=k*l-I,e[6]=a*c,e[10]=L*l+R}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},e.makeRotationFromQuaternion=function(t){return this.compose(St,t,Tt)},e.lookAt=function(t,e,n){var r=this.elements;return Ot.subVectors(t,e),0===Ot.lengthSq()&&(Ot.z=1),Ot.normalize(),Mt.crossVectors(n,Ot),0===Mt.lengthSq()&&(1===Math.abs(n.z)?Ot.x+=1e-4:Ot.z+=1e-4,Ot.normalize(),Mt.crossVectors(n,Ot)),Mt.normalize(),Pt.crossVectors(Ot,Mt),r[0]=Mt.x,r[4]=Pt.x,r[8]=Ot.x,r[1]=Mt.y,r[5]=Pt.y,r[9]=Ot.y,r[2]=Mt.z,r[6]=Pt.z,r[10]=Ot.z,this},e.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],c=n[1],l=n[5],h=n[9],f=n[13],p=n[2],d=n[6],m=n[10],y=n[14],v=n[3],g=n[7],b=n[11],x=n[15],_=r[0],w=r[4],E=r[8],S=r[12],T=r[1],M=r[5],P=r[9],O=r[13],A=r[2],C=r[6],R=r[10],I=r[14],k=r[3],L=r[7],j=r[11],D=r[15];return i[0]=o*_+a*T+s*A+u*k,i[4]=o*w+a*M+s*C+u*L,i[8]=o*E+a*P+s*R+u*j,i[12]=o*S+a*O+s*I+u*D,i[1]=c*_+l*T+h*A+f*k,i[5]=c*w+l*M+h*C+f*L,i[9]=c*E+l*P+h*R+f*j,i[13]=c*S+l*O+h*I+f*D,i[2]=p*_+d*T+m*A+y*k,i[6]=p*w+d*M+m*C+y*L,i[10]=p*E+d*P+m*R+y*j,i[14]=p*S+d*O+m*I+y*D,i[3]=v*_+g*T+b*A+x*k,i[7]=v*w+g*M+b*C+x*L,i[11]=v*E+g*P+b*R+x*j,i[15]=v*S+g*O+b*I+x*D,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],u=t[13],c=t[2],l=t[6],h=t[10],f=t[14];return t[3]*(+i*s*l-r*u*l-i*a*h+n*u*h+r*a*f-n*s*f)+t[7]*(+e*s*f-e*u*h+i*o*h-r*o*f+r*u*c-i*s*c)+t[11]*(+e*u*l-e*a*f-i*o*l+n*o*f+i*a*c-n*u*c)+t[15]*(-r*a*c-e*s*l+e*a*h+r*o*l-n*o*h+n*s*c)},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.setPosition=function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this},e.getInverse=function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=t.elements,i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],c=r[5],l=r[6],h=r[7],f=r[8],p=r[9],d=r[10],m=r[11],y=r[12],v=r[13],g=r[14],b=r[15],x=p*g*h-v*d*h+v*l*m-c*g*m-p*l*b+c*d*b,_=y*d*h-f*g*h-y*l*m+u*g*m+f*l*b-u*d*b,w=f*v*h-y*p*h+y*c*m-u*v*m-f*c*b+u*p*b,E=y*p*l-f*v*l-y*c*d+u*v*d+f*c*g-u*p*g,S=i*x+o*_+a*w+s*E;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return n[0]=x*T,n[1]=(v*d*s-p*g*s-v*a*m+o*g*m+p*a*b-o*d*b)*T,n[2]=(c*g*s-v*l*s+v*a*h-o*g*h-c*a*b+o*l*b)*T,n[3]=(p*l*s-c*d*s-p*a*h+o*d*h+c*a*m-o*l*m)*T,n[4]=_*T,n[5]=(f*g*s-y*d*s+y*a*m-i*g*m-f*a*b+i*d*b)*T,n[6]=(y*l*s-u*g*s-y*a*h+i*g*h+u*a*b-i*l*b)*T,n[7]=(u*d*s-f*l*s+f*a*h-i*d*h-u*a*m+i*l*m)*T,n[8]=w*T,n[9]=(y*p*s-f*v*s-y*o*m+i*v*m+f*o*b-i*p*b)*T,n[10]=(u*v*s-y*c*s+y*o*h-i*v*h-u*o*b+i*c*b)*T,n[11]=(f*c*s-u*p*s-f*o*h+i*p*h+u*o*m-i*c*m)*T,n[12]=E*T,n[13]=(f*v*a-y*p*a+y*o*d-i*v*d-f*o*g+i*p*g)*T,n[14]=(y*c*a-u*v*a-y*o*l+i*v*l+u*o*g-i*c*g)*T,n[15]=(u*p*a-f*c*a+f*o*l-i*p*l-u*o*d+i*c*d)*T,this},e.scale=function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},e.getMaxScaleOnAxis=function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},e.makeTranslation=function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},e.makeRotationX=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},e.makeRotationY=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},e.makeRotationZ=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},e.makeRotationAxis=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,s=t.z,u=i*o,c=i*a;return this.set(u*o+n,u*a-r*s,u*s+r*a,0,u*a+r*s,c*a+n,c*s-r*o,0,u*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this},e.makeScale=function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},e.makeShear=function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},e.compose=function(t,e,n){var r=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,p=i*l,d=o*c,m=o*l,y=a*l,v=s*u,g=s*c,b=s*l,x=n.x,_=n.y,w=n.z;return r[0]=(1-(d+y))*x,r[1]=(f+b)*x,r[2]=(p-g)*x,r[3]=0,r[4]=(f-b)*_,r[5]=(1-(h+y))*_,r[6]=(m+v)*_,r[7]=0,r[8]=(p+g)*w,r[9]=(m-v)*w,r[10]=(1-(h+d))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},e.decompose=function(t,e,n){var r=this.elements,i=wt.set(r[0],r[1],r[2]).length(),o=wt.set(r[4],r[5],r[6]).length(),a=wt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],Et.copy(this);var s=1/i,u=1/o,c=1/a;return Et.elements[0]*=s,Et.elements[1]*=s,Et.elements[2]*=s,Et.elements[4]*=u,Et.elements[5]*=u,Et.elements[6]*=u,Et.elements[8]*=c,Et.elements[9]*=c,Et.elements[10]*=c,e.setFromRotationMatrix(Et),n.x=i,n.y=o,n.z=a,this},e.makePerspective=function(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),u=2*i/(n-r),c=(e+t)/(e-t),l=(n+r)/(n-r),h=-(o+i)/(o-i),f=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},e.makeOrthographic=function(t,e,n,r,i,o){var a=this.elements,s=1/(e-t),u=1/(n-r),c=1/(o-i),l=(e+t)*s,h=(n+r)*u,f=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},e.equals=function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},e.fromArray=function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},e.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t},t}();n.Matrix4=_t;var wt=new Y,Et=new _t,St=new Y(0,0,0),Tt=new Y(1,1,1),Mt=new Y,Pt=new Y,Ot=new Y,At=function(){function t(e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=t.DefaultOrder),Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=n,this._z=r,this._order=i}var e=t.prototype;return e.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},e.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)},e.copy=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},e.setFromRotationMatrix=function(t,e,n){var r=D.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],u=i[1],c=i[5],l=i[9],h=i[2],f=i[6],p=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this},e.setFromQuaternion=function(t,e,n){return Ct.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Ct,e,n)},e.setFromVector3=function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},e.reorder=function(t){return Rt.setFromEuler(this),this.setFromQuaternion(Rt,t)},e.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},e.fromArray=function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},e.toVector3=function(t){return t?t.set(this._x,this._y,this._z):new Y(this._x,this._y,this._z)},e._onChange=function(t){return this._onChangeCallback=t,this},e._onChangeCallback=function(){},Object(o.a)(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}]),t}();n.Euler=At,At.DefaultOrder="XYZ",At.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Ct=new _t,Rt=new X,It=function(){function t(){this.mask=1}var e=t.prototype;return e.set=function(t){this.mask=1<1){for(var e=0;e1){for(var e=0;e0){r.children=[];for(var p=0;p0&&(n.geometries=d),m.length>0&&(n.materials=m),y.length>0&&(n.textures=y),v.length>0&&(n.images=v),g.length>0&&(n.shapes=g)}return n.object=r,n;function b(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n1?void 0:e.copy(n).multiplyScalar(i).add(t.start)},e.intersectsLine=function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},e.intersectsBox=function(t){return t.intersectsPlane(this)},e.intersectsSphere=function(t){return t.intersectsPlane(this)},e.coplanarPoint=function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Y),t.copy(this.normal).multiplyScalar(-this.constant)},e.applyMatrix4=function(t,e){var n=e||Kt.getNormalMatrix(t),r=this.coplanarPoint(Yt).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},e.translate=function(t){return this.constant-=t.dot(this.normal),this},e.equals=function(t){return t.normal.equals(this.normal)&&t.constant===this.constant},t}();n.Plane=Jt;var Qt=new Y,Zt=new Y,$t=new Y,te=new Y,ee=new Y,ne=new Y,re=new Y,ie=new Y,oe=new Y,ae=new Y,se=function(){function t(t,e,n){this.a=void 0!==t?t:new Y,this.b=void 0!==e?e:new Y,this.c=void 0!==n?n:new Y}t.getNormal=function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Y),r.subVectors(n,e),Qt.subVectors(t,e),r.cross(Qt);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},t.getBarycoord=function(t,e,n,r,i){Qt.subVectors(r,e),Zt.subVectors(n,e),$t.subVectors(t,e);var o=Qt.dot(Qt),a=Qt.dot(Zt),s=Qt.dot($t),u=Zt.dot(Zt),c=Zt.dot($t),l=o*u-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Y),0===l)return i.set(-2,-1,-1);var h=1/l,f=(u*s-a*c)*h,p=(o*c-a*s)*h;return i.set(1-f-p,p,f)},t.containsPoint=function(t,e,n,r){return this.getBarycoord(t,e,n,r,te),te.x>=0&&te.y>=0&&te.x+te.y<=1},t.getUV=function(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,te),s.set(0,0),s.addScaledVector(i,te.x),s.addScaledVector(o,te.y),s.addScaledVector(a,te.z),s},t.isFrontFacing=function(t,e,n,r){return Qt.subVectors(n,e),Zt.subVectors(t,e),Qt.cross(Zt).dot(r)<0};var e=t.prototype;return e.set=function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},e.setFromPointsAndIndices=function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},e.getArea=function(){return Qt.subVectors(this.c,this.b),Zt.subVectors(this.a,this.b),.5*Qt.cross(Zt).length()},e.getMidpoint=function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Y),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},e.getNormal=function(e){return t.getNormal(this.a,this.b,this.c,e)},e.getPlane=function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Jt),t.setFromCoplanarPoints(this.a,this.b,this.c)},e.getBarycoord=function(e,n){return t.getBarycoord(e,this.a,this.b,this.c,n)},e.getUV=function(e,n,r,i,o){return t.getUV(e,this.a,this.b,this.c,n,r,i,o)},e.containsPoint=function(e){return t.containsPoint(e,this.a,this.b,this.c)},e.isFrontFacing=function(e){return t.isFrontFacing(this.a,this.b,this.c,e)},e.intersectsBox=function(t){return t.intersectsTriangle(this)},e.closestPointToPoint=function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Y);var n,r,i=this.a,o=this.b,a=this.c;ee.subVectors(o,i),ne.subVectors(a,i),ie.subVectors(t,i);var s=ee.dot(ie),u=ne.dot(ie);if(s<=0&&u<=0)return e.copy(i);oe.subVectors(t,o);var c=ee.dot(oe),l=ne.dot(oe);if(c>=0&&l<=c)return e.copy(o);var h=s*l-c*u;if(h<=0&&s>=0&&c<=0)return n=s/(s-c),e.copy(i).addScaledVector(ee,n);ae.subVectors(t,a);var f=ee.dot(ae),p=ne.dot(ae);if(p>=0&&f<=p)return e.copy(a);var d=f*u-s*p;if(d<=0&&u>=0&&p<=0)return r=u/(u-p),e.copy(i).addScaledVector(ne,r);var m=c*p-f*l;if(m<=0&&l-c>=0&&f-p>=0)return re.subVectors(a,o),r=(l-c)/(l-c+(f-p)),e.copy(o).addScaledVector(re,r);var y=1/(m+d+h);return n=d*y,r=h*y,e.copy(i).addScaledVector(ee,n).addScaledVector(ne,r)},e.equals=function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)},t}();n.Triangle=se;var ue={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ce={h:0,s:0,l:0},le={h:0,s:0,l:0};function he(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function fe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function pe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var de=function(){function t(t,e,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}var e=t.prototype;return e.set=function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},e.setScalar=function(t){return this.r=t,this.g=t,this.b=t,this},e.setHex=function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},e.setRGB=function(t,e,n){return this.r=t,this.g=e,this.b=n,this},e.setHSL=function(t,e,n){if(t=D.euclideanModulo(t,1),e=D.clamp(e,0,1),n=D.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=he(i,r,t+1/3),this.g=he(i,r,t),this.b=he(i,r,t-1/3)}return this},e.setStyle=function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,u)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c=n[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},e.setColorName=function(t){var e=ue[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},e.clone=function(){return new this.constructor(this.r,this.g,this.b)},e.copy=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},e.copyGammaToLinear=function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},e.copyLinearToGamma=function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},e.convertGammaToLinear=function(t){return this.copyGammaToLinear(this,t),this},e.convertLinearToGamma=function(t){return this.copyLinearToGamma(this,t),this},e.copySRGBToLinear=function(t){return this.r=fe(t.r),this.g=fe(t.g),this.b=fe(t.b),this},e.copyLinearToSRGB=function(t){return this.r=pe(t.r),this.g=pe(t.g),this.b=pe(t.b),this},e.convertSRGBToLinear=function(){return this.copySRGBToLinear(this),this},e.convertLinearToSRGB=function(){return this.copyLinearToSRGB(this),this},e.getHex=function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},e.getHexString=function(){return("000000"+this.getHex().toString(16)).slice(-6)},e.getHSL=function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),u=(s+a)/2;if(s===a)e=0,n=0;else{var c=a-s;switch(n=u<=.5?c/(a+s):c/(2-a-s),a){case r:e=(i-o)/c+(i0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),o=r(t.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ve.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),ge.prototype=Object.create(ve.prototype),ge.prototype.constructor=ge,ge.prototype.isMeshBasicMaterial=!0,ge.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var be=new Y,xe=new N;function _e(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=A,this.updateRange={offset:0,count:-1},this.version=0}function we(t,e,n){_e.call(this,new Int8Array(t),e,n)}function Ee(t,e,n){_e.call(this,new Uint8Array(t),e,n)}function Se(t,e,n){_e.call(this,new Uint8ClampedArray(t),e,n)}function Te(t,e,n){_e.call(this,new Int16Array(t),e,n)}function Me(t,e,n){_e.call(this,new Uint16Array(t),e,n)}function Pe(t,e,n){_e.call(this,new Int32Array(t),e,n)}function Oe(t,e,n){_e.call(this,new Uint32Array(t),e,n)}function Ae(t,e,n){_e.call(this,new Float32Array(t),e,n)}function Ce(t,e,n){_e.call(this,new Float64Array(t),e,n)}Object.defineProperty(_e.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(_e.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r0,a=i[1]&&i[1].length>0,s=t.morphTargets,u=s.length;if(u>0){e=[];for(var c=0;c0){l=[];for(var p=0;p0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var g=0;ge&&(e=t[n]);return e}var ke=1,Le=new _t,je=new Xt,De=new Y,Ne=new J,Be=new J,Fe=new Y;function Ue(){Object.defineProperty(this,"id",{value:ke+=2}),this.uuid=D.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Ue.prototype=Object.assign(Object.create(I.prototype),{constructor:Ue,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Ie(t)>65535?Oe:Me)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new F).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Le.makeRotationX(t),this.applyMatrix4(Le),this},rotateY:function(t){return Le.makeRotationY(t),this.applyMatrix4(Le),this},rotateZ:function(t){return Le.makeRotationZ(t),this.applyMatrix4(Le),this},translate:function(t,e,n){return Le.makeTranslation(t,e,n),this.applyMatrix4(Le),this},scale:function(t,e,n){return Le.makeScale(t,e,n),this.applyMatrix4(Le),this},lookAt:function(t){return je.lookAt(t),je.updateMatrix(),this.applyMatrix4(je.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(De).negate(),this.translate(De.x,De.y,De.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Ae(3*e.vertices.length,3),r=new Ae(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new Ae(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new _e(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new _e(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new _e(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new _e(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],u=t.morphTargets[a],c=0,l=u.length;c0){var p=new Ae(4*t.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var d=new Ae(4*t.skinWeights.length,4);this.setAttribute("skinWeight",d.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new J);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Y(-1/0,-1/0,-1/0),new Y(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;null!==r&&(t.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o],s=a.toJSON(t.data);""!==a.name&&(s.name=a.name),t.data.attributes[o]=s}var u={},c=!1;for(var l in this.morphAttributes){for(var h=this.morphAttributes[l],f=[],p=0,d=h.length;p0&&(u[l]=f,c=!0)}c&&(t.data.morphAttributes=u,t.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(t.data.groups=JSON.parse(JSON.stringify(v)));var g=this.boundingSphere;return null!==g&&(t.data.boundingSphere={center:g.center.toArray(),radius:g.radius}),t},clone:function(){return(new Ue).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var n=t.index;null!==n&&this.setIndex(n.clone(e));var r=t.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(e))}var a=t.morphAttributes;for(var s in a){for(var u=[],c=a[s],l=0,h=c.length;ln.far?null:{distance:u,point:rn.clone(),object:t}}function sn(t,e,n,r,i,o,a,s,u,c,l,h){Ve.fromBufferAttribute(i,c),We.fromBufferAttribute(i,l),Xe.fromBufferAttribute(i,h);var f=t.morphTargetInfluences;if(e.morphTargets&&o&&f){Je.set(0,0,0),Qe.set(0,0,0),Ze.set(0,0,0);for(var p=0,d=o.length;p0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),ze.copy(r.boundingSphere),ze.applyMatrix4(o),!1!==t.ray.intersectsSphere(ze)&&(Ge.getInverse(o),He.copy(t.ray).applyMatrix4(Ge),null===r.boundingBox||!1!==He.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,u=r.morphAttributes.position,c=r.morphTargetsRelative,l=r.attributes.uv,h=r.attributes.uv2,f=r.groups,p=r.drawRange;if(null!==a)if(Array.isArray(i))for(var d=0,m=f.length;d0&&(D=G);for(var H=0,z=U.length;H0)for(var f=0;f0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var t=0,e=this.faces.length;t=0;d--){var m=u[d];this.faces.splice(m,1);for(var y=0,v=this.faceVertexUvs.length;y0,v=d.vertexNormals.length>0,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,b=d.vertexColors.length>0,x=0;if(x=S(x,0,0),x=S(x,1,!0),x=S(x,2,!1),x=S(x,3,m),x=S(x,4,y),x=S(x,5,v),x=S(x,6,g),x=S(x,7,b),a.push(x),a.push(d.a,d.b,d.c),a.push(d.materialIndex),m){var _=this.faceVertexUvs[0][p];a.push(P(_[0]),P(_[1]),P(_[2]))}if(y&&a.push(T(d.normal)),v){var w=d.vertexNormals;a.push(T(w[0]),T(w[1]),T(w[2]))}if(g&&a.push(M(d.color)),b){var E=d.vertexColors;a.push(M(E[0]),M(E[1]),M(E[2]))}}function S(t,e,n){return n?t|1<0&&(t.data.colors=c),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new fn).copy(this)},copy:function(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;for(var e=t.vertices,n=0,r=e.length;n0?1:-1,f.push(P.x,P.y,P.z),p.push(C/u),p.push(1-O/y),T+=1}for(var I=0;I0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},bn.prototype=Object.assign(Object.create(Xt.prototype),{constructor:bn,isCamera:!0,copy:function(t,e){return Xt.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Y),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Xt.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){Xt.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),xn.prototype=Object.assign(Object.create(bn.prototype),{constructor:xn,isPerspectiveCamera:!0,copy:function(t,e){return bn.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*D.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*D.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*D.RAD2DEG*Math.atan(Math.tan(.5*D.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*D.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,e-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var u=this.filmOffset;0!==u&&(i+=t*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Xt.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function _n(t,e,n){if(Xt.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new xn(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Y(1,0,0)),this.add(r);var i=new xn(90,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Y(-1,0,0)),this.add(i);var o=new xn(90,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Y(0,1,0)),this.add(o);var a=new xn(90,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Y(0,-1,0)),this.add(a);var s=new xn(90,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Y(0,0,1)),this.add(s);var u=new xn(90,1,t,e);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new Y(0,0,-1)),this.add(u),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var c=t.xr.enabled,l=t.getRenderTarget();t.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,u),t.setRenderTarget(l),t.xr.enabled=c},this.clear=function(t,e,r,i){for(var o=t.getRenderTarget(),a=0;a<6;a++)t.setRenderTarget(n,a),t.clear(e,r,i);t.setRenderTarget(o)}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function wn(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),V.call(this,t,t,e),this.texture.isWebGLCubeRenderTargetTexture=!0}function En(t,e,n,r,i,o,a,s,u,c,l,f){H.call(this,null,o,a,s,u,c,r,i,l,f),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==u?u:h,this.minFilter=void 0!==c?c:h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}_n.prototype=Object.create(Xt.prototype),_n.prototype.constructor=_n,wn.prototype=Object.create(V.prototype),wn.prototype.constructor=wn,wn.prototype.isWebGLCubeRenderTarget=!0,wn.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=_,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include \n\t\t\t\t#include \n\n\t\t\t}\n\t\t",i="\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",o=new dn(5,5,5),a=new gn({name:"CubemapFromEquirect",uniforms:mn(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=e;var s=new on(o,a),u=e.minFilter;return e.minFilter===p&&(e.minFilter=f),new _n(1,10,this).update(t,s),e.minFilter=u,s.geometry.dispose(),s.material.dispose(),this},En.prototype=Object.create(H.prototype),En.prototype.constructor=En,En.prototype.isDataTexture=!0;var Sn=new ft,Tn=new Y,Mn=function(){function t(t,e,n,r,i,o){this.planes=[void 0!==t?t:new Jt,void 0!==e?e:new Jt,void 0!==n?n:new Jt,void 0!==r?r:new Jt,void 0!==i?i:new Jt,void 0!==o?o:new Jt]}var e=t.prototype;return e.set=function(t,e,n,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},e.setFromProjectionMatrix=function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],c=n[6],l=n[7],h=n[8],f=n[9],p=n[10],d=n[11],m=n[12],y=n[13],v=n[14],g=n[15];return e[0].setComponents(a-r,l-s,d-h,g-m).normalize(),e[1].setComponents(a+r,l+s,d+h,g+m).normalize(),e[2].setComponents(a+i,l+u,d+f,g+y).normalize(),e[3].setComponents(a-i,l-u,d-f,g-y).normalize(),e[4].setComponents(a-o,l-c,d-p,g-v).normalize(),e[5].setComponents(a+o,l+c,d+p,g+v).normalize(),this},e.intersectsObject=function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Sn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Sn)},e.intersectsSprite=function(t){return Sn.center.set(0,0,0),Sn.radius=.7071067811865476,Sn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Sn)},e.intersectsSphere=function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++)if(e[i].distanceToPoint(n)0?t.max.x:t.min.x,Tn.y=r.normal.y>0?t.max.y:t.min.y,Tn.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Tn)<0)return!1}return!0},e.containsPoint=function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0},t}();function Pn(){var t=null,e=!1,n=null,r=null;function i(e,o){n(e,o),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function On(t,e){var n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){var o=r.get(e);(!o||o.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"};n.ShaderChunk=Rn;var In={common:{diffuse:{value:new de(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new F},uv2Transform:{value:new F},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new N(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new de(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new de(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new F}},sprite:{diffuse:{value:new de(15658734)},opacity:{value:1},center:{value:new N(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new F}}};n.UniformsLib=In;var kn={basic:{uniforms:yn([In.common,In.specularmap,In.envmap,In.aomap,In.lightmap,In.fog]),vertexShader:Rn.meshbasic_vert,fragmentShader:Rn.meshbasic_frag},lambert:{uniforms:yn([In.common,In.specularmap,In.envmap,In.aomap,In.lightmap,In.emissivemap,In.fog,In.lights,{emissive:{value:new de(0)}}]),vertexShader:Rn.meshlambert_vert,fragmentShader:Rn.meshlambert_frag},phong:{uniforms:yn([In.common,In.specularmap,In.envmap,In.aomap,In.lightmap,In.emissivemap,In.bumpmap,In.normalmap,In.displacementmap,In.fog,In.lights,{emissive:{value:new de(0)},specular:{value:new de(1118481)},shininess:{value:30}}]),vertexShader:Rn.meshphong_vert,fragmentShader:Rn.meshphong_frag},standard:{uniforms:yn([In.common,In.envmap,In.aomap,In.lightmap,In.emissivemap,In.bumpmap,In.normalmap,In.displacementmap,In.roughnessmap,In.metalnessmap,In.fog,In.lights,{emissive:{value:new de(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Rn.meshphysical_vert,fragmentShader:Rn.meshphysical_frag},toon:{uniforms:yn([In.common,In.aomap,In.lightmap,In.emissivemap,In.bumpmap,In.normalmap,In.displacementmap,In.gradientmap,In.fog,In.lights,{emissive:{value:new de(0)}}]),vertexShader:Rn.meshtoon_vert,fragmentShader:Rn.meshtoon_frag},matcap:{uniforms:yn([In.common,In.bumpmap,In.normalmap,In.displacementmap,In.fog,{matcap:{value:null}}]),vertexShader:Rn.meshmatcap_vert,fragmentShader:Rn.meshmatcap_frag},points:{uniforms:yn([In.points,In.fog]),vertexShader:Rn.points_vert,fragmentShader:Rn.points_frag},dashed:{uniforms:yn([In.common,In.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Rn.linedashed_vert,fragmentShader:Rn.linedashed_frag},depth:{uniforms:yn([In.common,In.displacementmap]),vertexShader:Rn.depth_vert,fragmentShader:Rn.depth_frag},normal:{uniforms:yn([In.common,In.bumpmap,In.normalmap,In.displacementmap,{opacity:{value:1}}]),vertexShader:Rn.normal_vert,fragmentShader:Rn.normal_frag},sprite:{uniforms:yn([In.sprite,In.fog]),vertexShader:Rn.sprite_vert,fragmentShader:Rn.sprite_frag},background:{uniforms:{uvTransform:{value:new F},t2D:{value:null}},vertexShader:Rn.background_vert,fragmentShader:Rn.background_frag},cube:{uniforms:yn([In.envmap,{opacity:{value:1}}]),vertexShader:Rn.cube_vert,fragmentShader:Rn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Rn.equirect_vert,fragmentShader:Rn.equirect_frag},distanceRGBA:{uniforms:yn([In.common,In.displacementmap,{referencePosition:{value:new Y},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Rn.distanceRGBA_vert,fragmentShader:Rn.distanceRGBA_frag},shadow:{uniforms:yn([In.lights,In.fog,{color:{value:new de(0)},opacity:{value:1}}]),vertexShader:Rn.shadow_vert,fragmentShader:Rn.shadow_frag}};function Ln(t,e,n,r,i){var o,a,s=new de(0),u=0,c=null,l=0,h=null;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}return{getClearColor:function(){return s},setClearColor:function(t,e){s.set(t),f(s,u=void 0!==e?e:1)},getClearAlpha:function(){return u},setClearAlpha:function(t){f(s,u=t)},render:function(n,i,p,d){var m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=e.get(m));var y=t.xr,v=y.getSession&&y.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?f(s,u):m&&m.isColor&&(f(m,1),d=!0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.isWebGLCubeRenderTargetTexture||306===m.mapping)?(void 0===a&&((a=new on(new dn(1,1,1),new gn({name:"BackgroundCubeMaterial",uniforms:mn(kn.cube.uniforms),vertexShader:kn.cube.vertexShader,fragmentShader:kn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),m.isWebGLCubeRenderTarget&&(m=m.texture),a.material.uniforms.envMap.value=m,a.material.uniforms.flipEnvMap.value=m.isCubeTexture?-1:1,c===m&&l===m.version&&h===t.toneMapping||(a.material.needsUpdate=!0,c=m,l=m.version,h=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):m&&m.isTexture&&(void 0===o&&((o=new on(new Cn(2,2),new gn({name:"BackgroundMaterial",uniforms:mn(kn.background.uniforms),vertexShader:kn.background.vertexShader,fragmentShader:kn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&l===m.version&&h===t.toneMapping||(o.material.needsUpdate=!0,c=m,l=m.version,h=t.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function jn(t,e,n,r){var i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},u=f(null),c=u;function l(e){return r.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function f(t){for(var e=[],n=[],r=[],o=0;o=0){var g=u[h];if(void 0!==g){var b=g.normalized,x=g.itemSize,_=n.get(g);if(void 0===_)continue;var w=_.buffer,E=_.type,S=_.bytesPerElement;if(g.isInterleavedBufferAttribute){var T=g.data,M=T.stride,P=g.offset;T&&T.isInstancedInterleavedBuffer?(m(f,T.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=T.meshPerAttribute*T.count)):d(f),t.bindBuffer(34962,w),v(f,x,E,b,M*S,P*S)}else g.isInstancedBufferAttribute?(m(f,g.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=g.meshPerAttribute*g.count)):d(f),t.bindBuffer(34962,w),v(f,x,E,b,0,0)}else if("instanceMatrix"===h){var O=n.get(i.instanceMatrix);if(void 0===O)continue;var A=O.buffer,C=O.type;m(f+0,1),m(f+1,1),m(f+2,1),m(f+3,1),t.bindBuffer(34962,A),t.vertexAttribPointer(f+0,4,C,!1,64,0),t.vertexAttribPointer(f+1,4,C,!1,64,16),t.vertexAttribPointer(f+2,4,C,!1,64,32),t.vertexAttribPointer(f+3,4,C,!1,64,48)}else if("instanceColor"===h){var R=n.get(i.instanceColor);if(void 0===R)continue;var I=R.buffer,k=R.type;m(f,1),t.bindBuffer(34962,I),t.vertexAttribPointer(f,3,k,!1,12,0)}else if(void 0!==l){var L=l[h];if(void 0!==L)switch(L.length){case 2:t.vertexAttrib2fv(f,L);break;case 3:t.vertexAttrib3fv(f,L);break;case 4:t.vertexAttrib4fv(f,L);break;default:t.vertexAttrib1fv(f,L)}}}}y()}}(i,u,h,g),null!==b&&t.bindBuffer(34963,n.get(b).buffer))},reset:g,resetDefaultState:b,dispose:function(){for(var t in g(),s){var e=s[t];for(var n in e){var r=e[n];for(var i in r)h(r[i].object),delete r[i];delete e[n]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0!==s[t.id]){var e=s[t.id];for(var n in e){var r=e[n];for(var i in r)h(r[i].object),delete r[i];delete e[n]}delete s[t.id]}},releaseStatesOfProgram:function(t){for(var e in s){var n=s[e];if(void 0!==n[t.id]){var r=n[t.id];for(var i in r)h(r[i].object),delete r[i];delete n[t.id]}}},initAttributes:p,enableAttribute:d,disableUnusedAttributes:y}}function Dn(t,e,n,r){var i,o=r.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var u,c;if(o)u=t,c="drawArraysInstanced";else if(c="drawArraysInstancedANGLE",null===(u=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](i,r,a,s),n.update(a,i,s)}}}function Nn(t,e,n){var r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),l=t.getParameter(35660),h=t.getParameter(3379),f=t.getParameter(34076),p=t.getParameter(34921),d=t.getParameter(36347),m=t.getParameter(36348),y=t.getParameter(36349),v=l>0,g=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:f,maxAttributes:p,maxVertexUniforms:d,maxVaryings:m,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:g,floatVertexTextures:v&&g,maxSamples:o?t.getParameter(36183):0}}function Bn(t){var e=this,n=null,r=0,i=!1,o=!1,a=new Jt,s=new F,u={value:null,needsUpdate:!1};function c(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function l(t,n,r,i){var o=null!==t?t.length:0,c=null;if(0!==o){if(c=u.value,!0!==i||null===c){var l=r+4*o,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===c||c.length0){var a=t.getRenderList(),s=t.getRenderTarget(),u=t.getRenderState(),c=new wn(o.height/2);return c.fromEquirectangularTexture(t,r),e.set(r,c),t.setRenderTarget(s),t.setRenderList(a),t.setRenderState(u),n(c.texture,r.mapping)}return null}}return r},dispose:function(){e=new WeakMap}}}function Un(t){var e={};return{has:function(n){if(void 0!==e[n])return null!==e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,null!==r},get:function(t){return this.has(t)||console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]}}}function Gn(t,e,n,r){var i=new WeakMap,o=new WeakMap;function a(t){var s=t.target,u=i.get(s);for(var c in null!==u.index&&e.remove(u.index),u.attributes)e.remove(u.attributes[c]);s.removeEventListener("dispose",a),i.delete(s);var l=o.get(u);l&&(e.remove(l),o.delete(u)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){var n=[],r=t.index,i=t.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var u=0,c=s.length;u65535?Oe:Me)(n,1);b.version=a;var x=o.get(t);x&&e.remove(x),o.set(t,b)}return{get:function(t,e){var r=i.get(e);return r||(e.addEventListener("dispose",a),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Ue).setFromObject(t)),r=e._bufferGeometry),i.set(e,r),n.memory.geometries++,r)},update:function(t){var n=t.attributes;for(var r in n)e.update(n[r],34962);var i=t.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s0)return t;var i=e*n,o=er[i];if(void 0===o&&(o=new Float32Array(i),er[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function sr(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n/gm;function ri(t){return t.replace(ni,ii)}function ii(t,e){var n=Rn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return ri(n)}var oi=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ai=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function si(t){return t.replace(ai,ci).replace(oi,ui)}function ui(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ci(t,e,n,r)}function ci(t,e,n,r){for(var i="",o=parseInt(e);o0?t.gammaFactor:1,m=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter($r).join("\n")}(n),y=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(s),v=a.createProgram(),g=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[y].filter($r).join("\n")).length>0&&(i+="\n"),(o=[m,y].filter($r).join("\n")).length>0&&(o+="\n")):(i=[li(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter($r).join("\n"),o=[m,li(n),"#define SHADER_NAME "+n.shaderName,y,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.envMap?"#define "+f:"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Rn.tonemapping_pars_fragment:"",0!==n.toneMapping?Zr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Rn.encodings_pars_fragment,n.map?Jr("mapTexelToLinear",n.mapEncoding):"",n.matcap?Jr("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Jr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Jr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Jr("lightMapTexelToLinear",n.lightMapEncoding):"",Qr("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter($r).join("\n")),u=ei(u=ti(u=ri(u),n),n),c=ei(c=ti(c=ri(c),n),n),u=si(u),c=si(c),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(g="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in",n.glslVersion===R?"":"out highp vec4 pc_fragColor;",n.glslVersion===R?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var b,x,_=g+o+c,w=Xr(a,35633,g+i+u),E=Xr(a,35632,_);if(a.attachShader(v,w),a.attachShader(v,E),void 0!==n.index0AttributeName?a.bindAttribLocation(v,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),t.debug.checkShaderErrors){var S=a.getProgramInfoLog(v).trim(),T=a.getShaderInfoLog(w).trim(),M=a.getShaderInfoLog(E).trim(),P=!0,O=!0;if(!1===a.getProgramParameter(v,35714)){P=!1;var A=Kr(a,w,"vertex"),C=Kr(a,E,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(v,35715),"gl.getProgramInfoLog",S,A,C)}else""!==S?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",S):""!==T&&""!==M||(O=!1);O&&(this.diagnostics={runnable:P,programLog:S,vertexShader:{log:T,prefix:i},fragmentShader:{log:M,prefix:o}})}return a.deleteShader(w),a.deleteShader(E),this.getUniforms=function(){return void 0===b&&(b=new Wr(a,v)),b},this.getAttributes=function(){return void 0===x&&(x=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i0,maxBones:S,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&d.length>0,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(!1===e.isRawShaderMaterial){for(var i=0;i1&&r.sort(t||mi),i.length>1&&i.sort(e||yi)}}}function gi(t){var e=new WeakMap;return{get:function(n,r){var i,o=e.get(n);return void 0===o?(i=new vi(t),e.set(n,new WeakMap),e.get(n).set(r,i)):void 0===(i=o.get(r))&&(i=new vi(t),o.set(r,i)),i},dispose:function(){e=new WeakMap}}}function bi(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new Y,color:new de};break;case"SpotLight":n={position:new Y,direction:new Y,color:new de,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Y,color:new de,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Y,skyColor:new de,groundColor:new de};break;case"RectAreaLight":n={color:new de,position:new Y,halfWidth:new Y,halfHeight:new Y}}return t[e.id]=n,n}}}var xi=0;function _i(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function wi(){for(var t=new bi,e=function(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new N};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new N,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=0;r<9;r++)n.probe.push(new Y);var i=new Y,o=new _t,a=new _t;return{setup:function(r,s,u){for(var c=0,l=0,h=0,f=0;f<9;f++)n.probe[f].set(0,0,0);var p=0,d=0,m=0,y=0,v=0,g=0,b=0,x=0,_=u.matrixWorldInverse;r.sort(_i);for(var w=0,E=r.length;w0&&(n.rectAreaLTC1=In.LTC_1,n.rectAreaLTC2=In.LTC_2),n.ambient[0]=c,n.ambient[1]=l,n.ambient[2]=h;var G=n.hash;G.directionalLength===p&&G.pointLength===d&&G.spotLength===m&&G.rectAreaLength===y&&G.hemiLength===v&&G.numDirectionalShadows===g&&G.numPointShadows===b&&G.numSpotShadows===x||(n.directional.length=p,n.spot.length=m,n.rectArea.length=y,n.point.length=d,n.hemi.length=v,n.directionalShadow.length=g,n.directionalShadowMap.length=g,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=g,n.pointShadowMatrix.length=b,n.spotShadowMatrix.length=x,G.directionalLength=p,G.pointLength=d,G.spotLength=m,G.rectAreaLength=y,G.hemiLength=v,G.numDirectionalShadows=g,G.numPointShadows=b,G.numSpotShadows=x,n.version=xi++)},state:n}}function Ei(){var t=new wi,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(r){t.setup(e,n,r)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function Si(){var t=new WeakMap;return{get:function(e,n){var r;return!1===t.has(e)?(r=new Ei,t.set(e,new WeakMap),t.get(e).set(n,r)):!1===t.get(e).has(n)?(r=new Ei,t.get(e).set(n,r)):r=t.get(e).get(n),r},dispose:function(){t=new WeakMap}}}function Ti(t){ve.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Mi(t){ve.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Y,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Ti.prototype=Object.create(ve.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isMeshDepthMaterial=!0,Ti.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Mi.prototype=Object.create(ve.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isMeshDistanceMaterial=!0,Mi.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};function Pi(t,e,n){var r=new Mn,i=new N,o=new N,a=new z,s=[],u=[],c={},l={0:1,1:0,2:2},p=new gn({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new N},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=p.clone();d.defines.HORIZONAL_PASS=1;var m=new Ue;m.setAttribute("position",new _e(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var y=new on(m,p),v=this;function g(n,r){var i=e.update(y);p.uniforms.shadow_pass.value=n.map.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,p,y,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,d,y,null)}function b(t,e,n){var r=t<<0|e<<1|n<<2,i=s[r];return void 0===i&&(i=new Ti({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function x(t,e,n){var r=t<<0|e<<1|n<<2,i=u[r];return void 0===i&&(i=new Mi({morphTargets:t,skinning:e}),u[r]=i),i}function w(e,n,r,i,o,a,s){var u=null,h=b,f=e.customDepthMaterial;if(!0===i.isPointLight&&(h=x,f=e.customDistanceMaterial),void 0===f){var p=!1;!0===r.morphTargets&&(p=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var d=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?d=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),u=h(p,d,!0===e.isInstancedMesh)}else u=f;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=u.uuid,y=r.uuid,v=c[m];void 0===v&&(v={},c[m]=v);var g=v[y];void 0===g&&(g=u.clone(),v[y]=g),u=g}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:l[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function E(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var u=e.update(n),c=n.material;if(Array.isArray(c))for(var l=u.groups,h=0,f=l.length;hn||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/w.x),i.x=o.x*w.x,x.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/w.y),i.y=o.y*w.y,x.mapSize.y=o.y)),null===x.map&&!x.isPointLightShadow&&3===this.type){var S={minFilter:f,magFilter:f,format:_};x.map=new V(i.x,i.y,S),x.map.texture.name=b.name+".shadowMap",x.mapPass=new V(i.x,i.y,S),x.camera.updateProjectionMatrix()}if(null===x.map){var T={minFilter:h,magFilter:h,format:_};x.map=new V(i.x,i.y,T),x.map.texture.name=b.name+".shadowMap",x.camera.updateProjectionMatrix()}t.setRenderTarget(x.map),t.clear();for(var M=x.getViewportCount(),P=0;P=1):-1!==A.indexOf("OpenGL ES")&&(O=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(A)[1]),P=O>=2);var C=null,R={},I=new z,k=new z;function L(e,n,r){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;ar||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var o=e?D.floorPowerOfTwo:Math.floor,a=o(i*t.width),s=o(i*t.height);void 0===S&&(S=I(a,s));var u=n?I(a,s):S;return u.width=a,u.height=s,u.getContext("2d").drawImage(t,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+s+")."),u}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function L(t){return D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)}function j(t,e){return t.generateMipmaps&&e&&t.minFilter!==h&&t.minFilter!==f}function N(e,n,i,o){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function B(n,r,i){if(!1===T)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function F(t){return t===h||1004===t||1005===t?9728:9729}function U(e){var n=e.target;n.removeEventListener("dispose",U),function(e){var n=r.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),r.remove(e))}(n),n.isVideoTexture&&C.delete(n),a.memory.textures--}function G(e){var n=e.target;n.removeEventListener("dispose",G),function(e){var n=r.get(e),i=r.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(e.texture),r.remove(e)}}(n),a.memory.textures--}var H=0;function z(t,e){var i=r.get(t);if(t.isVideoTexture&&function(t){var e=a.render.frame;C.get(t)!==e&&(C.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void J(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function V(e,i){if(6===e.image.length){var a=r.get(e);if(e.version>0&&a.__version!==e.version){K(a,e),n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),u=e.image[0]&&e.image[0].isDataTexture,c=[],l=0;l<6;l++)c[l]=s||u?u?e.image[l].image:e.image[l]:k(e.image[l],!1,!0,P);var h,f=c[0],p=L(f)||T,d=o.convert(e.format),m=o.convert(e.type),y=B(e.internalFormat,d,m);if(q(34067,e,p),s){for(var v=0;v<6;v++){h=c[v].mipmaps;for(var g=0;g1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function K(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",U),e.__webglTexture=t.createTexture(),a.memory.textures++)}function J(e,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),K(e,r),n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var s,u=function(t){return!T&&(t.wrapS!==c||t.wrapT!==c||t.minFilter!==h&&t.minFilter!==f)}(r)&&!1===L(r.image),l=k(r.image,u,!1,O),p=L(l)||T,d=o.convert(r.format),g=o.convert(r.type),S=B(r.internalFormat,d,g);q(a,r,p);var M=r.mipmaps;if(r.isDepthTexture)S=6402,T?S=r.type===v?36012:r.type===y?33190:r.type===b?35056:33189:r.type===v&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===w&&6402===S&&r.type!==m&&r.type!==y&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=m,g=o.convert(r.type)),r.format===E&&6402===S&&(S=34041,r.type!==b&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=b,g=o.convert(r.type))),n.texImage2D(3553,0,S,l.width,l.height,0,d,g,null);else if(r.isDataTexture)if(M.length>0&&p){for(var P=0,A=M.length;P0&&p){for(var I=0,D=M.length;I=M&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+M),H+=1,t},this.resetTextureUnits=function(){H=0},this.setTexture2D=z,this.setTexture2DArray=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?J(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?J(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=V,this.setTextureCubeDynamic=W,this.setupRenderTarget=function(e){var i=r.get(e),s=r.get(e.texture);e.addEventListener("dispose",G),s.__webglTexture=t.createTexture(),a.memory.textures++;var u=!0===e.isWebGLCubeRenderTarget,c=!0===e.isWebGLMultisampleRenderTarget,l=L(e)||T;if(!T||e.texture.format!==x||e.texture.type!==v&&e.texture.type!==g||(e.texture.format=_,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),c)if(T){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var f=o.convert(e.texture.format),p=o.convert(e.texture.type),d=B(e.texture.internalFormat,f,p),m=$(e);t.renderbufferStorageMultisample(36161,m,d,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),Z(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){n.bindTexture(34067,s.__webglTexture),q(34067,e.texture,l);for(var y=0;y<6;y++)Q(i.__webglFramebuffer[y],e,36064,34069+y);j(e.texture,l)&&N(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),q(3553,e.texture,l),Q(i.__webglFramebuffer,e,36064,3553),j(e.texture,l)&&N(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&function(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),z(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===w)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==E)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),Z(n.__webglDepthbuffer[o],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),Z(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(j(e,L(t)||T)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),N(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(T){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===tt&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),tt=!0),t=t.texture),z(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===et&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),et=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?V(t,e):W(t,e)}}function Ci(t,e,n){var r=n.isWebGL2;return{convert:function(t){var n;if(t===d)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===m)return 5123;if(1013===t)return 5124;if(t===y)return 5125;if(t===v)return 5126;if(t===g)return r?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(t===x)return 6407;if(t===_)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===w)return 6402;if(t===E)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:t===b?r?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ri(t){xn.call(this),this.cameras=t||[]}function Ii(){Xt.call(this),this.type="Group"}function ki(){this._targetRay=null,this._grip=null,this._hand=null}function Li(t,e){var n=this,r=null,i=1,o=null,a="local-floor",s=null,u=[],c=new Map,l=new xn;l.layers.enable(1),l.viewport=new z;var h=new xn;h.layers.enable(2),h.viewport=new z;var f=[l,h],p=new Ri;p.layers.enable(1),p.layers.enable(2);var d=null,m=null;function y(t){var e=c.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function v(){c.forEach((function(t,e){t.disconnect(e)})),c.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function g(t){o=t,S.setContext(r),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function b(t){for(var e=r.inputSources,n=0;n0&&Rt(o,t,e),a.length>0&&Rt(a,t,e),!0===t.isScene&&t.onAfterRender(p,t,e),null!==w&&(et.updateRenderTargetMipmap(w),et.updateMultisampleRenderTarget(w)),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1),h=null,f=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){y!==t&&null===w&&vt.bindFramebuffer(36160,t),y=t},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return x},this.getRenderList=function(){return h},this.setRenderList=function(t){h=t},this.getRenderState=function(){return f},this.setRenderState=function(t){f=t},this.getRenderTarget=function(){return w},this.setRenderTarget=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),w=t,b=e,x=n,t&&void 0===tt.get(t).__webglFramebuffer&&et.setupRenderTarget(t);var r=y,i=!1;if(t){var o=tt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=o[e],i=!0):r=t.isWebGLMultisampleRenderTarget?tt.get(t).__webglMultisampledFramebuffer:o,O.copy(t.viewport),A.copy(t.scissor),C=t.scissorTest}else O.copy(B).multiplyScalar(k).floor(),A.copy(F).multiplyScalar(k).floor(),C=U;if(E!==r&&(vt.bindFramebuffer(36160,r),E=r),Z.viewport(O),Z.scissor(A),Z.setScissorTest(C),i){var a=tt.get(t.texture);vt.framebufferTexture2D(36160,36064,34069+e,a.__webglTexture,n)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(t&&t.isWebGLRenderTarget){var s=tt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var u=!1;s!==E&&(vt.bindFramebuffer(36160,s),u=!0);try{var c=t.texture,l=c.format,h=c.type;if(l!==_&&mt.convert(l)!==vt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===d||mt.convert(h)===vt.getParameter(35738)||h===v&&(Q.isWebGL2||J.get("OES_texture_float")||J.get("WEBGL_color_buffer_float"))||h===g&&(Q.isWebGL2?J.get("EXT_color_buffer_float"):J.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===vt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&vt.readPixels(e,n,r,i,mt.convert(l),mt.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&vt.bindFramebuffer(36160,E)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),a=mt.convert(e.format);et.setTexture2D(e,0),vt.copyTexImage2D(3553,n,a,t.x,t.y,i,o,0),Z.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){void 0===r&&(r=0);var i=e.image.width,o=e.image.height,a=mt.convert(n.format),s=mt.convert(n.type);et.setTexture2D(n,0),vt.pixelStorei(37440,n.flipY),vt.pixelStorei(37441,n.premultiplyAlpha),vt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?vt.texSubImage2D(3553,r,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?vt.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):vt.texSubImage2D(3553,r,t.x,t.y,a,s,e.image),0===r&&n.generateMipmaps&&vt.generateMipmap(3553),Z.unbindTexture()},this.initTexture=function(t){et.setTexture2D(t,0),Z.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ni(t){Di.call(this,t)}Ri.prototype=Object.assign(Object.create(xn.prototype),{constructor:Ri,isArrayCamera:!0}),Ii.prototype=Object.assign(Object.create(Xt.prototype),{constructor:Ii,isGroup:!0}),Object.assign(ki.prototype,{constructor:ki,getHandSpace:function(){if(null===this._hand&&(this._hand=new Ii,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var t=0;t<=window.XRHand.LITTLE_PHALANX_TIP;t++){var e=new Ii;e.matrixAutoUpdate=!1,e.visible=!1,this._hand.joints.push(e),this._hand.add(e)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Ii,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Ii,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){var r=null,i=null,o=null,a=this._targetRay,s=this._grip,u=this._hand;if(t)if(u&&t.hand){o=!0;for(var c=0;c<=window.XRHand.LITTLE_PHALANX_TIP;c++)if(t.hand[c]){var l=e.getJointPose(t.hand[c],n),h=u.joints[c];null!==l&&(h.matrix.fromArray(l.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.jointRadius=l.radius),h.visible=null!==l;var f=u.joints[window.XRHand.INDEX_PHALANX_TIP],p=u.joints[window.XRHand.THUMB_PHALANX_TIP],d=f.position.distanceTo(p.position);u.inputState.pinching&&d>.025?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&d<=.015&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}}else null!==a&&null!==(r=e.getPose(t.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)),null!==s&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==u&&(u.visible=null!==o),this}}),Object.assign(Li.prototype,I.prototype),Ni.prototype=Object.assign(Object.create(Di.prototype),{constructor:Ni,isWebGL1Renderer:!0});var Bi=function(){function t(t,e){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new de(t),this.density=void 0!==e?e:25e-5}var e=t.prototype;return e.clone=function(){return new t(this.color,this.density)},e.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},t}();n.FogExp2=Bi;var Fi=function(){function t(t,e,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new de(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}var e=t.prototype;return e.clone=function(){return new t(this.color,this.near,this.far)},e.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},t}();n.Fog=Fi;var Ui=function(t){function e(){var e;return e=t.call(this)||this,Object.defineProperty(Object(r.a)(e),"isScene",{value:!0}),e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:Object(r.a)(e)})),e}Object(i.a)(e,t);var n=e.prototype;return n.copy=function(e,n){return t.prototype.copy.call(this,e,n),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},n.toJSON=function(e){var n=t.prototype.toJSON.call(this,e);return null!==this.background&&(n.object.background=this.background.toJSON(e)),null!==this.environment&&(n.object.environment=this.environment.toJSON(e)),null!==this.fog&&(n.object.fog=this.fog.toJSON()),n},e}(Xt);function Gi(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=A,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=D.generateUUID()}n.Scene=Ui,Object.defineProperty(Gi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Gi.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;rt.far||e.push({distance:s,point:Xi.clone(),uv:se.getUV(Xi,Zi,$i,to,eo,no,ro,new N),face:null,object:this})}},copy:function(t){return Xt.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});var ao=new Y,so=new Y;function uo(){Xt.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function co(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),on.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new _t,this.bindMatrixInverse=new _t}uo.prototype=Object.assign(Object.create(Xt.prototype),{constructor:uo,isLOD:!0,copy:function(t){Xt.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n0){var n,r;for(n=1,r=e.length;n0){ao.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(ao);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){ao.setFromMatrixPosition(t.matrixWorld),so.setFromMatrixPosition(this.matrixWorld);var n,r,i=ao.distanceTo(so)/t.zoom;for(e[0].object.visible=!0,n=1,r=e.length;n=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;na)){l.applyMatrix4(this.matrixWorld);var b=t.ray.origin.distanceTo(l);bt.far||e.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var x=0,_=p.length/3-1;x<_;x+=h)if(s.fromArray(p,3*x),u.fromArray(p,3*x+3),!(So.distanceSqToSegment(s,u,l,c)>a)){l.applyMatrix4(this.matrixWorld);var w=t.ray.origin.distanceTo(l);wt.far||e.push({distance:w,point:c.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else if(n.isGeometry)for(var E=n.vertices,S=E.length,T=0;Ta)){l.applyMatrix4(this.matrixWorld);var M=t.ray.origin.distanceTo(l);Mt.far||e.push({distance:M,point:c.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var Po=new Y,Oo=new Y;function Ao(t,e){Mo.call(this,t,e),this.type="LineSegments"}function Co(t,e){Mo.call(this,t,e),this.type="LineLoop"}function Ro(t){ve.call(this),this.type="PointsMaterial",this.color=new de(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Ao.prototype=Object.assign(Object.create(Mo.prototype),{constructor:Ao,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;ri.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:u,index:e,face:null,object:a})}}function Bo(t,e,n,r,i,o,a,s,u){H.call(this,t,e,n,r,i,o,a,s,u),this.format=void 0!==a?a:x,this.minFilter=void 0!==o?o:f,this.magFilter=void 0!==i?i:f,this.generateMipmaps=!1;var c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}function Fo(t,e,n,r,i,o,a,s,u,c,l,h){H.call(this,null,o,a,s,u,c,r,i,l,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Uo(t,e,n,r,i,o,a,s,u){H.call(this,t,e,n,r,i,o,a,s,u),this.needsUpdate=!0}function Go(t,e,n,r,i,o,a,s,u,c){if((c=void 0!==c?c:w)!==w&&c!==E)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===w&&(n=m),void 0===n&&c===E&&(n=b),H.call(this,null,r,i,o,a,s,c,n,u),this.image={width:t,height:e},this.magFilter=void 0!==a?a:h,this.minFilter=void 0!==s?s:h,this.flipY=!1,this.generateMipmaps=!1}Do.prototype=Object.assign(Object.create(Xt.prototype),{constructor:Do,isPoints:!0,copy:function(t){return Xt.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Lo.copy(n.boundingSphere),Lo.applyMatrix4(r),Lo.radius+=i,!1!==t.ray.intersectsSphere(Lo)){Io.getInverse(r),ko.copy(t.ray).applyMatrix4(Io);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,u=n.attributes.position.array;if(null!==s)for(var c=s.array,l=0,h=c.length;l0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Bo.prototype=Object.assign(Object.create(H.prototype),{constructor:Bo,isVideoTexture:!0,update:function(){var t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Fo.prototype=Object.create(H.prototype),Fo.prototype.constructor=Fo,Fo.prototype.isCompressedTexture=!0,Uo.prototype=Object.create(H.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isCanvasTexture=!0,Go.prototype=Object.create(H.prototype),Go.prototype.constructor=Go,Go.prototype.isDepthTexture=!0;var Ho=function(t){function e(e){var n;(n=t.call(this)||this).type="WireframeGeometry";var r=[],i=[0,0],o={},a=["a","b","c"];if(e&&e.isGeometry){for(var s=e.faces,u=0,c=s.length;u=0?(t(y-1e-5,d,c),l.subVectors(u,c)):(t(y+1e-5,d,c),l.subVectors(c,u)),d-1e-5>=0?(t(y,d-1e-5,c),h.subVectors(u,c)):(t(y,d+1e-5,c),h.subVectors(c,u)),s.crossVectors(l,h).normalize(),o.push(s.x,s.y,s.z),a.push(y,d)}for(var v=0;v.9&&o<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),r<.2&&(s[t+4]+=1))}}()}(),o.setAttribute("position",new Ae(a,3)),o.setAttribute("normal",new Ae(a.slice(),3)),o.setAttribute("uv",new Ae(s,2)),0===i?o.computeVertexNormals():o.normalizeNormals(),o}return Object(i.a)(e,t),e}(Ue);n.PolyhedronBufferGeometry=Xo;var Yo=function(t){function e(e,n){var r;return(r=t.call(this)||this).type="TetrahedronGeometry",r.parameters={radius:e,detail:n},r.fromBufferGeometry(new qo(e,n)),r.mergeVertices(),r}return Object(i.a)(e,t),e}(fn);n.TetrahedronGeometry=Yo;var qo=function(t){function e(e,n){var r;return(r=t.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,n)||this).type="TetrahedronBufferGeometry",r.parameters={radius:e,detail:n},r}return Object(i.a)(e,t),e}(Xo);n.TetrahedronBufferGeometry=qo;var Ko=function(t){function e(e,n){var r;return(r=t.call(this)||this).type="OctahedronGeometry",r.parameters={radius:e,detail:n},r.fromBufferGeometry(new Jo(e,n)),r.mergeVertices(),r}return Object(i.a)(e,t),e}(fn);n.OctahedronGeometry=Ko;var Jo=function(t){function e(e,n){var r;return(r=t.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,n)||this).type="OctahedronBufferGeometry",r.parameters={radius:e,detail:n},r}return Object(i.a)(e,t),e}(Xo);n.OctahedronBufferGeometry=Jo;var Qo=function(t){function e(e,n){var r;return(r=t.call(this)||this).type="IcosahedronGeometry",r.parameters={radius:e,detail:n},r.fromBufferGeometry(new Zo(e,n)),r.mergeVertices(),r}return Object(i.a)(e,t),e}(fn);n.IcosahedronGeometry=Qo;var Zo=function(t){function e(e,n){var r,i=(1+Math.sqrt(5))/2;return(r=t.call(this,[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,n)||this).type="IcosahedronBufferGeometry",r.parameters={radius:e,detail:n},r}return Object(i.a)(e,t),e}(Xo);n.IcosahedronBufferGeometry=Zo;var $o=function(t){function e(e,n){var r;return(r=t.call(this)||this).type="DodecahedronGeometry",r.parameters={radius:e,detail:n},r.fromBufferGeometry(new ta(e,n)),r.mergeVertices(),r}return Object(i.a)(e,t),e}(fn);n.DodecahedronGeometry=$o;var ta=function(t){function e(e,n){var r,i=(1+Math.sqrt(5))/2,o=1/i;return(r=t.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-o,-i,0,-o,i,0,o,-i,0,o,i,-o,-i,0,-o,i,0,o,-i,0,o,i,0,-i,0,-o,i,0,-o,-i,0,o,i,0,o],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,n)||this).type="DodecahedronBufferGeometry",r.parameters={radius:e,detail:n},r}return Object(i.a)(e,t),e}(Xo);n.DodecahedronBufferGeometry=ta;var ea=function(t){function e(e,n,r,i,o,a){var s;(s=t.call(this)||this).type="TubeGeometry",s.parameters={path:e,tubularSegments:n,radius:r,radialSegments:i,closed:o},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var u=new na(e,n,r,i,o);return s.tangents=u.tangents,s.normals=u.normals,s.binormals=u.binormals,s.fromBufferGeometry(u),s.mergeVertices(),s}return Object(i.a)(e,t),e}(fn);n.TubeGeometry=ea;var na=function(t){function e(e,n,r,i,o){var a;(a=t.call(this)||this).type="TubeBufferGeometry",a.parameters={path:e,tubularSegments:n,radius:r,radialSegments:i,closed:o},n=n||64,r=r||1,i=i||8,o=o||!1;var s=e.computeFrenetFrames(n,o);a.tangents=s.tangents,a.normals=s.normals,a.binormals=s.binormals;var u=new Y,c=new Y,l=new N,h=new Y,f=[],p=[],d=[],m=[];function y(t){h=e.getPointAt(t/n,h);for(var o=s.normals[t],a=s.binormals[t],l=0;l<=i;l++){var d=l/i*Math.PI*2,m=Math.sin(d),y=-Math.cos(d);c.x=y*o.x+m*a.x,c.y=y*o.y+m*a.y,c.z=y*o.z+m*a.z,c.normalize(),p.push(c.x,c.y,c.z),u.x=h.x+r*c.x,u.y=h.y+r*c.y,u.z=h.z+r*c.z,f.push(u.x,u.y,u.z)}}return function(){for(var t=0;t80*n){r=o=t[0],i=a=t[1];for(var d=n;do&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return la(f,p,n,r,i,c),p};function ua(t,e,n,r,i){var o,a;if(i===function(t,e,n,r){for(var i=0,o=e,a=n-r;o0)for(o=e;o=e;o-=r)a=Aa(o,t[o],t[o+1],a);return a&&Ea(a,a.next)&&(Ca(a),a=a.next),a}function ca(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ea(r,r.next)&&0!==wa(r.prev,r,r.next))r=r.next;else{if(Ca(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function la(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=ga(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?fa(t,r,i,o):ha(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),Ca(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?la(t=pa(ca(t),e,n),e,n,r,i,o,2):2===a&&da(t,e,n,r,i,o):la(ca(t),e,n,r,i,o,1);break}}}function ha(t){var e=t.prev,n=t,r=t.next;if(wa(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(xa(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&wa(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function fa(t,e,n,r){var i=t.prev,o=t,a=t.next;if(wa(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=ga(s,u,e,n,r),f=ga(c,l,e,n,r),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&xa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&wa(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&xa(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&wa(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&xa(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&wa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&xa(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&wa(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function pa(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ea(i,o)&&Sa(i,r,r.next,o)&&Pa(i,o)&&Pa(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Ca(r),Ca(r.next),r=t=o),r=r.next}while(r!==t);return ca(r)}function da(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&_a(a,s)){var u=Oa(a,s);return a=ca(a,a.next),u=ca(u,u.next),la(a,e,n,r,i,o),void la(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function ma(t,e){return t.x-e.x}function ya(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=l&&i!==r.x&&xa(on.x||r.x===n.x&&va(n,r)))&&(n=r,f=u)),r=r.next}while(r!==c);return n}(t,e)){var n=Oa(e,t);ca(e,e.next),ca(n,n.next)}}function va(t,e){return wa(t.prev,t,e.prev)<0&&wa(e.next,t,t.next)<0}function ga(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ba(t){var e=t,n=t;do{(e.x=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function _a(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Sa(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Pa(t,e)&&Pa(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(wa(t.prev,t,e.prev)||wa(t,e.prev,e))||Ea(t,e)&&wa(t.prev,t,t.next)>0&&wa(e.prev,e,e.next)>0)}function wa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ea(t,e){return t.x===e.x&&t.y===e.y}function Sa(t,e,n,r){var i=Ma(wa(t,e,n)),o=Ma(wa(t,e,r)),a=Ma(wa(n,r,t)),s=Ma(wa(n,r,e));return i!==o&&a!==s||!(0!==i||!Ta(t,n,e))||!(0!==o||!Ta(t,r,e))||!(0!==a||!Ta(n,t,r))||!(0!==s||!Ta(n,e,r))}function Ta(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ma(t){return t>0?1:t<0?-1:0}function Pa(t,e){return wa(t.prev,t,t.next)<0?wa(t,e,t.next)>=0&&wa(t,t.prev,e)>=0:wa(t,e,t.prev)<0||wa(t,t.next,e)<0}function Oa(t,e){var n=new Ra(t.i,t.x,t.y),r=new Ra(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Aa(t,e,n,r){var i=new Ra(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ca(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ra(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Ia={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i2&&t[e-1].equals(t[0])&&t.pop()}function La(t,e){for(var n=0;nNumber.EPSILON){var f=Math.sqrt(l),p=Math.sqrt(u*u+c*c),d=e.x-s/f,m=e.y+a/f,y=((n.x-c/p-d)*c-(n.y+u/p-m)*u)/(a*c-s*u),v=(r=d+a*y-t.x)*r+(i=m+s*y-t.y)*i;if(v<=2)return new N(r,i);o=Math.sqrt(v/2)}else{var g=!1;a>Number.EPSILON?u>Number.EPSILON&&(g=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(g=!0):Math.sign(s)===Math.sign(c)&&(g=!0),g?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new N(r/o,i/o)}for(var B=[],F=0,U=A.length,G=U-1,H=F+1;F=0;bt--){for(var xt=bt/p,_t=l*Math.cos(xt*Math.PI/2),wt=h*Math.sin(xt*Math.PI/2)+f,Et=0,St=A.length;Et=0;){var r=n,o=n-1;o<0&&(o=t.length-1);for(var a=0,s=i+2*p;a0)&&d.push(M,P,A),(S!==r-1||c0&&x(!0),n>0&&x(!1)),l.setIndex(f),l.setAttribute("position",new Ae(p,3)),l.setAttribute("normal",new Ae(d,3)),l.setAttribute("uv",new Ae(m,2)),l}return Object(i.a)(e,t),e}(Ue);n.CylinderBufferGeometry=Za;var $a=function(t){function e(e,n,r,i,o,a,s){var u;return(u=t.call(this,0,e,n,r,i,o,a,s)||this).type="ConeGeometry",u.parameters={radius:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},u}return Object(i.a)(e,t),e}(Qa);n.ConeGeometry=$a;var ts=function(t){function e(e,n,r,i,o,a,s){var u;return(u=t.call(this,0,e,n,r,i,o,a,s)||this).type="ConeBufferGeometry",u.parameters={radius:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},u}return Object(i.a)(e,t),e}(Za);n.ConeBufferGeometry=ts;var es=function(t){function e(e,n,r,i){var o;return(o=t.call(this)||this).type="CircleGeometry",o.parameters={radius:e,segments:n,thetaStart:r,thetaLength:i},o.fromBufferGeometry(new ns(e,n,r,i)),o.mergeVertices(),o}return Object(i.a)(e,t),e}(fn);n.CircleGeometry=es;var ns=function(t){function e(e,n,r,i){var o;(o=t.call(this)||this).type="CircleBufferGeometry",o.parameters={radius:e,segments:n,thetaStart:r,thetaLength:i},e=e||1,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var a=[],s=[],u=[],c=[],l=new Y,h=new N;s.push(0,0,0),u.push(0,0,1),c.push(.5,.5);for(var f=0,p=3;f<=n;f++,p+=3){var d=r+f/n*i;l.x=e*Math.cos(d),l.y=e*Math.sin(d),s.push(l.x,l.y,l.z),u.push(0,0,1),h.x=(s[p]/e+1)/2,h.y=(s[p+1]/e+1)/2,c.push(h.x,h.y)}for(var m=1;m<=n;m++)a.push(m,m+1,0);return o.setIndex(a),o.setAttribute("position",new Ae(s,3)),o.setAttribute("normal",new Ae(u,3)),o.setAttribute("uv",new Ae(c,2)),o}return Object(i.a)(e,t),e}(Ue);n.CircleBufferGeometry=ns;var rs=Object.freeze({__proto__:null,WireframeGeometry:Ho,ParametricGeometry:zo,ParametricBufferGeometry:Vo,TetrahedronGeometry:Yo,TetrahedronBufferGeometry:qo,OctahedronGeometry:Ko,OctahedronBufferGeometry:Jo,IcosahedronGeometry:Qo,IcosahedronBufferGeometry:Zo,DodecahedronGeometry:$o,DodecahedronBufferGeometry:ta,PolyhedronGeometry:Wo,PolyhedronBufferGeometry:Xo,TubeGeometry:ea,TubeBufferGeometry:na,TorusKnotGeometry:ra,TorusKnotBufferGeometry:ia,TorusGeometry:oa,TorusBufferGeometry:aa,TextGeometry:Fa,TextBufferGeometry:Ua,SphereGeometry:Ga,SphereBufferGeometry:Ha,RingGeometry:za,RingBufferGeometry:Va,PlaneGeometry:An,PlaneBufferGeometry:Cn,LatheGeometry:Wa,LatheBufferGeometry:Xa,ShapeGeometry:Ya,ShapeBufferGeometry:qa,ExtrudeGeometry:ja,ExtrudeBufferGeometry:Da,EdgesGeometry:Ja,ConeGeometry:$a,ConeBufferGeometry:ts,CylinderGeometry:Qa,CylinderBufferGeometry:Za,CircleGeometry:es,CircleBufferGeometry:ns,BoxGeometry:pn,BoxBufferGeometry:dn});function is(t){ve.call(this),this.type="ShadowMaterial",this.color=new de(0),this.transparent=!0,this.setValues(t)}function os(t){gn.call(this,t),this.type="RawShaderMaterial"}function as(t){ve.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new de(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new N(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function ss(t){as.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new N(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(t)}function us(t){ve.call(this),this.type="MeshPhongMaterial",this.color=new de(16777215),this.specular=new de(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new N(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function cs(t){ve.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new de(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new N(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ls(t){ve.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new N(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function hs(t){ve.call(this),this.type="MeshLambertMaterial",this.color=new de(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new de(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function fs(t){ve.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new de(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new N(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ps(t){xo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}is.prototype=Object.create(ve.prototype),is.prototype.constructor=is,is.prototype.isShadowMaterial=!0,is.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.color.copy(t.color),this},os.prototype=Object.create(gn.prototype),os.prototype.constructor=os,os.prototype.isRawShaderMaterial=!0,as.prototype=Object.create(ve.prototype),as.prototype.constructor=as,as.prototype.isMeshStandardMaterial=!0,as.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},ss.prototype=Object.create(as.prototype),ss.prototype.constructor=ss,ss.prototype.isMeshPhysicalMaterial=!0,ss.prototype.copy=function(t){return as.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new de).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this},us.prototype=Object.create(ve.prototype),us.prototype.constructor=us,us.prototype.isMeshPhongMaterial=!0,us.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},cs.prototype=Object.create(ve.prototype),cs.prototype.constructor=cs,cs.prototype.isMeshToonMaterial=!0,cs.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ls.prototype=Object.create(ve.prototype),ls.prototype.constructor=ls,ls.prototype.isMeshNormalMaterial=!0,ls.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},hs.prototype=Object.create(ve.prototype),hs.prototype.constructor=hs,hs.prototype.isMeshLambertMaterial=!0,hs.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},fs.prototype=Object.create(ve.prototype),fs.prototype.constructor=fs,fs.prototype.isMeshMatcapMaterial=!0,fs.prototype.copy=function(t){return ve.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ps.prototype=Object.create(xo.prototype),ps.prototype.constructor=ps,ps.prototype.isLineDashedMaterial=!0,ps.prototype.copy=function(t){return xo.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var ds=Object.freeze({__proto__:null,ShadowMaterial:is,SpriteMaterial:Wi,RawShaderMaterial:os,ShaderMaterial:gn,PointsMaterial:Ro,MeshPhysicalMaterial:ss,MeshStandardMaterial:as,MeshPhongMaterial:us,MeshToonMaterial:cs,MeshNormalMaterial:ls,MeshLambertMaterial:hs,MeshDepthMaterial:Ti,MeshDistanceMaterial:Mi,MeshBasicMaterial:ge,MeshMatcapMaterial:fs,LineDashedMaterial:ps,LineBasicMaterial:xo,Material:ve}),ms={arraySlice:function(t,e,n){return ms.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*e,u=0;u!==e;++u)i[a++]=t[s+u];return i},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,n,r,i){i=i||30;var o=t.clone();o.name=e;for(var a=[],s=0;s=r)){l.push(u.times[f]);for(var d=0;do.tracks[y].times[0]&&(m=o.tracks[y].times[0]);for(var v=0;v=r.times[h]){var m=h*u+s,y=m+u-s;f=ms.arraySlice(r.values,m,y)}else{var v=r.createInterpolant(),g=s,b=u-s;v.evaluate(o),f=ms.arraySlice(v.resultBuffer,g,b)}"quaternion"===i&&(new X).fromArray(f).normalize().conjugate().toArray(f);for(var x=a.times.length,_=0;_=i)break t;var s=e[1];t=(i=e[--n-1]))break e}o=n,n=0}for(;n>>1;te;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=ms.arraySlice(n,i,o),this.values=ms.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&ms.isTypedArray(r))for(var u=0,c=r.length;u!==c;++u){var l=r[u];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,l),t=!1;break}}return t},optimize:function(){for(var t=ms.arraySlice(this.times),e=ms.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=t.length-1,o=1,a=1;a0){t[o]=t[i];for(var v=i*n,g=o*n,b=0;b!==n;++b)e[g+b]=e[v+b];++o}return o!==t.length?(this.times=ms.arraySlice(t,0,o),this.values=ms.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this},clone:function(){var t=ms.arraySlice(this.times,0),e=ms.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),_s.prototype=Object.assign(Object.create(xs.prototype),{constructor:_s,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ws.prototype=Object.assign(Object.create(xs.prototype),{constructor:ws,ValueTypeName:"color"}),Es.prototype=Object.assign(Object.create(xs.prototype),{constructor:Es,ValueTypeName:"number"}),Ss.prototype=Object.assign(Object.create(ys.prototype),{constructor:Ss,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-e)/(r-e),u=t*a,c=u+a;u!==c;u+=4)X.slerpFlat(i,0,o,u-a,o,u,s);return i}}),Ts.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ts,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new Ss(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ms.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ms,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ps.prototype=Object.assign(Object.create(xs.prototype),{constructor:Ps,ValueTypeName:"vector"}),Object.assign(Os,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(As(n[i]).scale(r));return new Os(t.name,t.duration,e,t.blendMode)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},i=0,o=n.length;i!==o;++i)e.push(xs.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,o=[],a=0;a1){var c=u[1],l=r[c];l||(r[c]=l=[]),l.push(s)}}var h=[];for(var f in r)h.push(Os.CreateFromMorphTargetSequence(f,r[f],e,n));return h},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var o=[],a=[];ms.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.fps||30,a=t.blendMode,s=t.length||-1,u=t.hierarchy||[],c=0;c0||0===t.search(/^data\:image\/jpeg/);i.format=r?x:_,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}),Object.assign(Hs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=t;o++)i+=(e=this.getPoint(o/t)).distanceTo(r),n.push(i),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=r[i=Math.floor(s+(u-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(o-1)},getTangent:function(t,e){var n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),o=this.getPoint(r),a=e||(i.isVector2?new N:new Y);return a.copy(o).sub(i).normalize(),a},getTangentAt:function(t,e){var n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){for(var n=new Y,r=[],i=[],o=[],a=new Y,s=new _t,u=0;u<=t;u++){var c=u/t;r[u]=this.getTangentAt(c,new Y),r[u].normalize()}i[0]=new Y,o[0]=new Y;var l=Number.MAX_VALUE,h=Math.abs(r[0].x),f=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=l&&(l=h,n.set(1,0,0)),f<=l&&(l=f,n.set(0,1,0)),p<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var d=1;d<=t;d++){if(i[d]=i[d-1].clone(),o[d]=o[d-1].clone(),a.crossVectors(r[d-1],r[d]),a.length()>Number.EPSILON){a.normalize();var m=Math.acos(D.clamp(r[d-1].dot(r[d]),-1,1));i[d].applyMatrix4(s.makeRotationAxis(a,m))}o[d].crossVectors(r[d],i[d])}if(!0===e){var y=Math.acos(D.clamp(i[0].dot(i[t]),-1,1));y/=t,r[0].dot(a.crossVectors(i[0],i[t]))>0&&(y=-y);for(var v=1;v<=t;v++)i[v].applyMatrix4(s.makeRotationAxis(r[v],y*v)),o[v].crossVectors(r[v],i[v])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),zs.prototype=Object.create(Hs.prototype),zs.prototype.constructor=zs,zs.prototype.isEllipseCurve=!0,zs.prototype.getPoint=function(t,e){for(var n=e||new N,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===c&&u===a-1&&(u=a-2,c=1),this.closed||u>0?n=o[(u-1)%a]:(Xs.subVectors(o[0],o[1]).add(o[0]),n=Xs);var l=o[u%a],h=o[(u+1)%a];if(this.closed||u+2r.length-2?r.length-1:o+1],l=r[o>r.length-3?r.length-1:o+2];return n.set(Qs(a,s.x,u.x,c.x,l.x),Qs(a,s.y,u.y,c.y,l.y)),n},au.prototype.copy=function(t){Hs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e=e){var i=n[r]-e,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Hs.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var l=u.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return uu.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=uu.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return uu.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),lu.prototype=Object.assign(Object.create(cu.prototype),{constructor:lu,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var i in t.uniforms){var o=t.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new de).setHex(o.value);break;case"v2":r.uniforms[i].value=(new N).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new Y).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new z).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new F).fromArray(o.value);break;case"m4":r.uniforms[i].value=(new _t).fromArray(o.value);break;default:r.uniforms[i].value=o.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)r.extensions[a]=t.extensions[a];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.matcap&&(r.matcap=n(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new N).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new N).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(r.transmission=t.transmission),void 0!==t.transmissionMap&&(r.transmissionMap=n(t.transmissionMap)),r},setTextures:function(t){return this.textures=t,this}});var Mu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n0){var a=new Rs(e);(n=new Bs(a)).setCrossOrigin(this.crossOrigin);for(var s=0,u=t.length;sNumber.EPSILON){if(c<0&&(a=e[o],u=-u,s=e[i],c=-c),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=c*(t.x-a.x)-u*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var i,o,a,s=Ia.isClockWise,u=this.subPaths;if(0===u.length)return[];if(!0===e)return n(u);var c=[];if(1===u.length)return o=u[0],(a=new lu).curves=o.curves,c.push(a),c;var l=!s(u[0].getPoints());l=t?!l:l;var h,f,p=[],d=[],m=[],y=0;d[y]=void 0,m[y]=[];for(var v=0,g=u.length;v1){for(var b=!1,x=[],_=0,w=d.length;_0&&(b||(m=p))}for(var C=0,R=d.length;C0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(var u=e,c=e+e;u!==c;++u)if(n[u]!==n[u+e]){a.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(var i=n,o=r;i!==o;++i)e[i]=e[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,n=t;n=.5)for(var o=0;o!==i;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,r){X.slerpFlat(t,e,t,e,t,n,r)},_slerpAdditive:function(t,e,n,r,i){var o=this._workIndex*i;X.multiplyQuaternionsFlat(t,o,t,e,t,n),X.slerpFlat(t,e,t,e,t,o,r)},_lerp:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}},_lerpAdditive:function(t,e,n,r,i){for(var o=0;o!==i;++o){var a=e+o;t[a]=t[a]+t[n+o]*r}}});var uc=new RegExp("[\\[\\]\\.:\\/]","g"),cc="[^\\[\\]\\.:\\/]",lc="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",hc=/((?:WC+[\/:])*)/.source.replace("WC",cc),fc=/(WCOD+)?/.source.replace("WCOD",lc),pc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cc),dc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cc),mc=new RegExp("^"+hc+fc+pc+dc+"$"),yc=["material","materials","bones"];function vc(t,e,n){var r=n||gc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function gc(t,e,n){this.path=e,this.parsedPath=n||gc.parseTrackName(e),this.node=gc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function bc(){this.uuid=D.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(vc.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(gc,{Composite:vc,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new gc.Composite(t,e,n):new gc(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(uc,"")},parseTrackName:function(t){var e=mc.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==yc.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function t(n){for(var r=0;r=i){var l=i++,h=t[l];e[h.uuid]=c,t[c]=h,e[u]=l,t[l]=s;for(var f=0,p=r;f!==p;++f){var d=n[f],m=d[l],y=d[c];d[c]=m,d[l]=y}}}this.nCachedObjects_=i},uncache:function(){for(var t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=t.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a].uuid,c=e[u];if(void 0!==c)if(delete e[u],c0){var u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,h=u.length;l!==h;++l)u[l].evaluate(a),c[l].accumulateAdditive(s);break;case 2500:default:for(var f=0,p=u.length;f!==p;++f)u[f].evaluate(a),c[f].accumulate(r,s)}}}else this._updateWeight(t)},e._updateWeight=function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e},e._updateTimeScale=function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e},e._updateTime=function(t){var e=this._clip.duration,n=this.loop,r=this.time+t,i=this._loopCount,o=2202===n;if(0===t)return-1===i?r:o&&1==(1&i)?e-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=e||r<0){var a=Math.floor(r/e);r-=e*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var u=t<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1==(1&i))return e-r}return r},e._setEndings=function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=T,r.endingEnd=T):(r.endingStart=t?this.zeroSlopeAtStart?T:S:M,r.endingEnd=e?this.zeroSlopeAtEnd?T:S:M)},e._scheduleFading=function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this},t}();function _c(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_c.prototype=Object.assign(Object.create(I.prototype),{constructor:_c,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,u=this._bindingsByRootAndName,c=u[s];void 0===c&&(c={},u[s]=c);for(var l=0;l!==i;++l){var h=r[l],f=h.name,p=c[f];if(void 0!==p)o[l]=p;else{if(void 0!==(p=o[l])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,f));continue}var d=e&&e._propertyBindings[l].binding.parsedPath;++(p=new sc(gc.create(n,f,d),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,f),o[l]=p}a[l].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a)e[a]._update(r,t,i,o);for(var s=this._bindings,u=this._nActiveBindings,c=0;c!==u;++c)s[c].apply(o);return this},setTime:function(t){this.time=0;for(var e=0;ethis.max.x||t.ythis.max.y)},e.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},e.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new N),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},e.intersectsBox=function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},e.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new N),e.copy(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return Cc.copy(t).clamp(this.min,this.max).sub(t).length()},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}();n.Box2=Rc;var Ic=new Y,kc=new Y,Lc=function(){function t(t,e){this.start=void 0!==t?t:new Y,this.end=void 0!==e?e:new Y}var e=t.prototype;return e.set=function(t,e){return this.start.copy(t),this.end.copy(e),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){return this.start.copy(t.start),this.end.copy(t.end),this},e.getCenter=function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Y),t.addVectors(this.start,this.end).multiplyScalar(.5)},e.delta=function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Y),t.subVectors(this.end,this.start)},e.distanceSq=function(){return this.start.distanceToSquared(this.end)},e.distance=function(){return this.start.distanceTo(this.end)},e.at=function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Y),this.delta(e).multiplyScalar(t).add(this.start)},e.closestPointToPointParameter=function(t,e){Ic.subVectors(t,this.start),kc.subVectors(this.end,this.start);var n=kc.dot(kc),r=kc.dot(Ic)/n;return e&&(r=D.clamp(r,0,1)),r},e.closestPointToPoint=function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Y),this.delta(n).multiplyScalar(r).add(this.start)},e.applyMatrix4=function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},e.equals=function(t){return t.start.equals(this.start)&&t.end.equals(this.end)},t}();function jc(t){Xt.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}n.Line3=Lc,jc.prototype=Object.create(Xt.prototype),jc.prototype.constructor=jc,jc.prototype.isImmediateRenderObject=!0;var Dc=new Y,Nc=function(t){function e(e,n){var r;(r=t.call(this)||this).light=e,r.light.updateMatrixWorld(),r.matrix=e.matrixWorld,r.matrixAutoUpdate=!1,r.color=n;for(var i=new Ue,o=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],a=0,s=1;a<32;a++,s++){var u=a/32*Math.PI*2,c=s/32*Math.PI*2;o.push(Math.cos(u),Math.sin(u),1,Math.cos(c),Math.sin(c),1)}i.setAttribute("position",new Ae(o,3));var l=new xo({fog:!1,toneMapped:!1});return r.cone=new Ao(i,l),r.add(r.cone),r.update(),r}Object(i.a)(e,t);var n=e.prototype;return n.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},n.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Dc.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Dc),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)},e}(Xt);n.SpotLightHelper=Nc;var Bc=new Y,Fc=new _t,Uc=new _t,Gc=function(t){function e(e){for(var n,r=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{cl.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(cl,e)}},n.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},n.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},n.copy=function(e){return t.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},e}(Xt);n.ArrowHelper=ll;var hl=function(t){function e(e){var n;void 0===e&&(e=1);var r=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=new Ue;return i.setAttribute("position",new Ae(r,3)),i.setAttribute("color",new Ae([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),(n=t.call(this,i,new xo({vertexColors:!0,toneMapped:!1}))||this).type="AxesHelper",n}return Object(i.a)(e,t),e}(Ao);n.AxesHelper=hl;var fl=Math.pow(2,8),pl=[.125,.215,.35,.446,.526,.582],dl=5+pl.length,ml=((a={})[P]=0,a[O]=1,a[3002]=2,a[3004]=3,a[3005]=4,a[3006]=5,a[3007]=6,a),yl=new gu,vl=function(){for(var t=[],e=[],n=[],r=8,i=0;i4?a=pl[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),u=-s/2,c=1+s/2,l=[u,u,c,u,c,c,u,u,c,c,u,c],h=new Float32Array(108),f=new Float32Array(72),p=new Float32Array(36),d=0;d<6;d++){var m=d%3*2/3-1,y=d>2?0:-1,v=[m,y,0,m+2/3,y,0,m+2/3,y+1,0,m,y,0,m+2/3,y+1,0,m,y+1,0];h.set(v,18*d),f.set(l,12*d);var g=[d,d,d,d,d,d];p.set(g,6*d)}var b=new Ue;b.setAttribute("position",new _e(h,3)),b.setAttribute("uv",new _e(f,2)),b.setAttribute("faceIndex",new _e(p,1)),t.push(b),r>4&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),gl=vl._lodPlanes,bl=vl._sizeLods,xl=vl._sigmas,_l=null,wl=(1+Math.sqrt(5))/2,El=1/wl,Sl=[new Y(1,1,1),new Y(-1,1,1),new Y(1,1,-1),new Y(-1,1,-1),new Y(0,wl,El),new Y(0,wl,-El),new Y(El,0,wl),new Y(-El,0,wl),new Y(wl,El,0),new Y(-wl,El,0)],Tl=function(){function t(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){return new os({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(t)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Y(0,1,0)},inputEncoding:{value:ml[P]},outputEncoding:{value:ml[P]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}var e=t.prototype;return e.fromScene=function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===r&&(r=100),_l=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i},e.fromEquirectangular=function(t){return this._fromTexture(t)},e.fromCubemap=function(t){return this._fromTexture(t)},e.compileCubemapShader=function(){null===this._cubemapShader&&(this._cubemapShader=Cl(),this._compileMaterial(this._cubemapShader))},e.compileEquirectangularShader=function(){null===this._equirectShader&&(this._equirectShader=Al(),this._compileMaterial(this._equirectShader))},e.dispose=function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t2?fl:0,fl,fl),s.setRenderTarget(r),s.render(t,i)}s.toneMapping=c,s.outputEncoding=u,s.setClearColor(l,h)},e._textureToCubeUV=function(t,e){var n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Cl()):null==this._equirectShader&&(this._equirectShader=Al());var r=t.isCubeTexture?this._cubemapShader:this._equirectShader,i=new on(gl[0],r),o=r.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=ml[t.encoding],o.outputEncoding.value=ml[e.texture.encoding],Ol(e,0,0,3*fl,2*fl),n.setRenderTarget(e),n.render(i,yl)},e._applyPMREM=function(t){var e=this._renderer,n=e.autoClear;e.autoClear=!1;for(var r=1;r20&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+d+" samples when the maximum is set to 20");for(var m=[],y=0,v=0;v<20;++v){var g=v/p,b=Math.exp(-g*g/2);m.push(b),0==v?y+=b:v4?r-8+4:0),3*_,2*_),s.setRenderTarget(e),s.render(c,yl)},t}();function Ml(t){return void 0!==t&&t.type===d&&(t.encoding===P||t.encoding===O||3007===t.encoding)}function Pl(t){var e=new V(3*fl,3*fl,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Ol(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Al(){return new os({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new N(1,1)},inputEncoding:{value:ml[P]},outputEncoding:{value:ml[P]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Cl(){return new os({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ml[P]},outputEncoding:{value:ml[P]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}n.PMREMGenerator=Tl;n.LineStrip=0;n.LinePieces=1;n.NoColors=0;n.FaceColors=1;function Rl(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Js.call(this,t),this.type="catmullrom",this.closed=!0}function Il(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Js.call(this,t),this.type="catmullrom"}function kl(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Js.call(this,t),this.type="catmullrom"}n.VertexColors=2,Hs.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Hs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(uu.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new fn,n=0,r=t.length;n1&&void 0!==arguments[1]&&arguments[1];this.canvas="string"==typeof t?document.getElementById(t):t,this.app=new i.Application(Object.assign({view:this.canvas},this.config)),this.load(),n||this.app.ticker.add((function(t){return e.update(t)}))}},{key:"destroy",value:function(){this.app.destroy()}}]),t}();n.PIXIExample=f;var p=function(){function t(e){u(this,t),this.config=e}return l(t,[{key:"init",value:function(t){this.engine=new r.Engine,this.canvas="string"==typeof t?document.getElementById(t):t,this.engine.init(this.canvas,this.config),this.load()}},{key:"destroy",value:function(){this.engine.destroy()}}]),t}();n.ECSExample=p},{"../../libs/pixi-ecs":"KEu4","pixi.js":"FmRY",three:"lKFo"}],Whwc:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.PixiHelloWorld=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("pixi.js")),i=t("../utils/APHExample");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}(this.container.children);try{for(r.s();!(n=r.n()).done;)n.value.rotation+=.1*t}catch(e){r.e(e)}finally{r.f()}}}]),n}();n.Particles=m,m.particlesNum=250},{"pixi.js":"FmRY","../utils/APHExample":"Xu9H"}],mnDy:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Primitives=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("pixi.js")),i=t("../utils/APHExample");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n10&&(t/=1e3),t||0},Object.defineProperty(e.prototype,"_enabled",{set:function(t){i.Ticker.shared.remove(this._updateListener,this),t&&i.Ticker.shared.add(this._updateListener,this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},e.prototype.toString=function(){return"[WebAudioInstance id="+this.id+"]"},e.prototype._now=function(){return this._media.context.audioContext.currentTime},e.prototype._updateListener=function(){this._update()},e.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),n=e-this._lastUpdate;if(n>0||t){var r=this._source.playbackRate.value;this._elapsed+=n*r,this._lastUpdate=e;var i=this._duration,o=void 0;if(this._source.loopStart){var a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/i}else o=this._elapsed%i/i;this._progress=o,this.emit("progress",this._progress,i)}}},e.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},e.prototype._internalStop=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.stop(0),this._source.disconnect(),this._source=null)},e.prototype._onComplete=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.disconnect()),this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},e}(o.EventEmitter),_=function(t){function e(e){var n=this,r=e.audioContext,i=r.createBufferSource(),o=r.createGain(),a=r.createAnalyser();return i.connect(a),a.connect(o),o.connect(e.destination),(n=t.call(this,a,o)||this).context=e,n.bufferSource=i,n.gain=o,n.analyser=a,n}return l(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,g.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var n=this.context.audioContext.createGain();return e.connect(n),n.connect(this.destination),{source:e,gain:n}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!0,configurable:!0}),e.BUFFER_SIZE=0,e}(s),w=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new _(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null,this._source=null,this.source=null},t.prototype.create=function(){return new x(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!0,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,n=new XMLHttpRequest,r=this.parent.url;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){e.source=n.response,e._decode(n.response,t)},n.send()},t.prototype._decode=function(t,e){var n=this;this.parent.context.decode(t,(function(t,r){if(t)e&&e(t);else{n.parent.isLoaded=!0,n.buffer=r;var i=n.parent.autoPlayStart();e&&e(null,n.parent,i)}}))},t}(),E=function(t){function e(){var n=this,r=window,i=new e.AudioContext,a=i.createDynamicsCompressor(),s=i.createAnalyser();return s.connect(a),a.connect(i.destination),(n=t.call(this,s,a)||this)._ctx=i,n._offlineCtx=new e.OfflineAudioContext(1,2,r.OfflineAudioContext?i.sampleRate:44100),n._unlocked=!1,n.compressor=a,n.analyser=s,n.events=new o.EventEmitter,n.volume=1,n.speed=1,n.muted=!1,n.paused=!1,"running"!==i.state&&(n._unlock(),n._unlock=n._unlock.bind(n),document.addEventListener("mousedown",n._unlock,!0),document.addEventListener("touchstart",n._unlock,!0),document.addEventListener("touchend",n._unlock,!0)),n}return l(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){this._offlineCtx.decodeAudioData(t,(function(t){e(null,t)}),(function(t){e(new Error(t.message||"Unable to decode file"))}))},e}(s),S={WebAudioMedia:w,WebAudioInstance:x,WebAudioNodes:_,WebAudioContext:E,WebAudioUtils:g},T={Filter:u,EqualizerFilter:function(t){function e(n,r,i,o,a,s,u,c,l,h){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===l&&(l=0),void 0===h&&(h=0);var f=this;if(!p().useLegacy){var d=[{f:e.F32,type:"lowshelf",gain:n},{f:e.F64,type:"peaking",gain:r},{f:e.F125,type:"peaking",gain:i},{f:e.F250,type:"peaking",gain:o},{f:e.F500,type:"peaking",gain:a},{f:e.F1K,type:"peaking",gain:s},{f:e.F2K,type:"peaking",gain:u},{f:e.F4K,type:"peaking",gain:c},{f:e.F8K,type:"peaking",gain:l},{f:e.F16K,type:"highshelf",gain:h}].map((function(t){var e=p().context.audioContext.createBiquadFilter();return e.type=t.type,g.setParamValue(e.Q,1),e.frequency.value=t.f,g.setParamValue(e.gain,t.gain),e}));(f=t.call(this,d[0],d[d.length-1])||this).bands=d,f.bandsMap={};for(var m=0;m0&&f.bands[m-1].connect(y),f.bandsMap[y.frequency.value]=y}return f}f=t.call(this,null)||this}return l(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency "+t);g.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency "+t);return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.bands.forEach((function(t){g.setParamValue(t.gain,0)}))},e.prototype.destroy=function(){this.bands.forEach((function(t){t.disconnect()})),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(u),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var n=this;if(!p().useLegacy){var r=p().context.audioContext.createWaveShaper();return(n=t.call(this,r)||this)._distortion=r,n.amount=e,n}n=t.call(this,null)||this}return l(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){t*=1e3,this._amount=t;for(var e,n=new Float32Array(44100),r=Math.PI/180,i=0;i<44100;++i)e=2*i/44100-1,n[i]=(3+t)*e*20*r/(Math.PI+t*Math.abs(e));this._distortion.curve=n,this._distortion.oversample="4x"},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._distortion=null,t.prototype.destroy.call(this)},e}(u),StereoFilter:function(t){function e(e){void 0===e&&(e=0);var n=this;if(!p().useLegacy){var r,i,o,a=p().context.audioContext;return a.createStereoPanner?o=r=a.createStereoPanner():((i=a.createPanner()).panningModel="equalpower",o=i),(n=t.call(this,o)||this)._stereo=r,n._panner=i,n.pan=e,n}n=t.call(this,null)||this}return l(e,t),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t,this._stereo?g.setParamValue(this._stereo.pan,t):this._panner.setPosition(t,0,1-Math.abs(t))},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._stereo=null,this._panner=null},e}(u),ReverbFilter:function(t){function e(e,n,r){void 0===e&&(e=3),void 0===n&&(n=2),void 0===r&&(r=!1);var i=this;if(!p().useLegacy)return(i=t.call(this,null)||this)._seconds=i._clamp(e,1,50),i._decay=i._clamp(n,0,100),i._reverse=r,i._rebuild(),i;i=t.call(this,null)||this}return l(e,t),e.prototype._clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},Object.defineProperty(e.prototype,"seconds",{get:function(){return this._seconds},set:function(t){this._seconds=this._clamp(t,1,50),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decay",{get:function(){return this._decay},set:function(t){this._decay=this._clamp(t,0,100),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this._reverse},set:function(t){this._reverse=t,this._rebuild()},enumerable:!0,configurable:!0}),e.prototype._rebuild=function(){for(var t,e=p().context.audioContext,n=e.sampleRate,r=n*this._seconds,i=e.createBuffer(2,r,n),o=i.getChannelData(0),a=i.getChannelData(1),s=0;s=this._end&&!this._source.loop&&this._onComplete()},e.prototype._onComplete=function(){i.Ticker.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},e.prototype.destroy=function(){i.Ticker.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},e.prototype.toString=function(){return"[HTMLAudioInstance id="+this.id+"]"},e.PADDING=.1,e}(o.EventEmitter),O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new P(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),e.prototype.load=function(t){var e=this._source,n=this.parent;if(4!==e.readyState){if(!n.url)return t(new Error("sound.url or sound.source must be set"));e.src=n.url;var r=function(){e.removeEventListener("canplaythrough",i),e.removeEventListener("load",i),e.removeEventListener("abort",o),e.removeEventListener("error",a)},i=function(){r(),n.isLoaded=!0;var e=n.autoPlayStart();t&&t(null,n,e)},o=function(){r(),t&&t(new Error("Sound loading has been aborted"))},a=function(){r();var n="Failed to load audio element (code: "+e.error.code+")";t&&t(new Error(n))};e.addEventListener("canplaythrough",i,!1),e.addEventListener("load",i,!1),e.addEventListener("abort",o,!1),e.addEventListener("error",a,!1),e.load()}else{n.isLoaded=!0;var s=n.autoPlayStart();t&&setTimeout((function(){t(null,n,s)}),0)}},e}(o.EventEmitter),A=function(t){function e(){var e=t.call(this)||this;return e.speed=1,e.volume=1,e.muted=!1,e.paused=!1,e}return l(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(o.EventEmitter),C={HTMLAudioMedia:O,HTMLAudioInstance:P,HTMLAudioContext:A},R=["mp3","ogg","oga","opus","mpeg","wav","m4a","aiff","wma","mid"],I=(d={m4a:"mp4",oga:"ogg"},m=document.createElement("audio"),y={},v=/^no$/,R.forEach((function(t){var e=d[t]||t,n=m.canPlayType("audio/"+t).replace(v,""),r=m.canPlayType("audio/"+e).replace(v,"");y[t]=!!n||!!r})),Object.freeze(y)),k=/\.(\{([^\}]+)\})(\?.*)?$/;function L(t){var e=k,n="string"==typeof t?t:t.url;if(e.test(n)){for(var r=e.exec(n),i=r[2].split(","),o=i[i.length-1],a=0,s=i.length;a-1?t.sound=p().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},t}(),D=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),N=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var n=e.complete;this._autoPlayOptions=n?{complete:n}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var n={};return"string"==typeof e?n.url=e:e instanceof ArrayBuffer||e instanceof HTMLAudioElement?n.source=e:n=e,(n=f({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},n)).url&&(n.url=L(n.url)),Object.freeze(n),new t(p().useLegacy?new O:new w,n)},Object.defineProperty(t.prototype,"context",{get:function(){return p().context},enumerable:!0,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!0,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var n={};for(var r in t)n[r]=this.addSprites(r,t[r]);return n}if("string"==typeof t){var i=new D(this,e);return this._sprites[t]=i,i}},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var n in this._sprites)this.removeSprites(n);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!0,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var n,r=this;if("string"==typeof t?n={sprite:o=t,loop:this.loop,complete:e}:"function"==typeof t?(n={}).complete=t:n=t,(n=f({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},n||{})).sprite){var i=n.sprite,o=this._sprites[i];n.start=o.start,n.end=o.end,n.speed=o.speed||1,n.loop=o.loop||n.loop,delete n.sprite}if(n.offset&&(n.start=n.offset),!this.isLoaded)return new Promise((function(t,e){r.autoPlay=!0,r._autoPlayOptions=n,r._preload((function(r,i,o){r?e(r):(n.loaded&&n.loaded(r,i,o),t(o))}))}));this.singleInstance&&this._removeInstances();var a=this._createInstance();return this._instances.push(a),this.isPlaying=!0,a.once("end",(function(){n.complete&&n.complete(r),r._onComplete(a)})),a.once("stop",(function(){r._onComplete(a)})),a.play(n),a},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),B=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new E),this._htmlAudioContext=new A,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==E.AudioContext},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var n={};for(var r in t){var i=this._getOptions(t[r],e);n[r]=this.add(r,i)}return n}if("string"==typeof t){if(e instanceof N)return this._sounds[t]=e,e;i=this._getOptions(e);var o=N.from(i);return this._sounds[t]=o,o}},t.prototype._getOptions=function(t,e){var n;return n="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof HTMLAudioElement?{source:t}:t,f({},n,e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){j.legacy=t,this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!0,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!0,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var n=this.find(t);return void 0!==e&&(n.volume=e),n.volume},t.prototype.speed=function(t,e){var n=this.find(t);return void 0!==e&&(n.speed=e),n.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),F=0,U={get PLAY_ID(){return F},playOnce:function(t,e){var n="alias"+F++;return p().add(n,{url:t,preload:!0,autoPlay:!0,loaded:function(t){t&&(p().remove(n),e&&e(t))},complete:function(){p().remove(n),e&&e(null)}}),n},render:function(t,e){var n=document.createElement("canvas");e=f({width:512,height:128,fill:"black"},e||{}),n.width=e.width,n.height=e.height;var r=a.BaseTexture.from(n);if(!(t.media instanceof w))return r;var i=t.media,o=n.getContext("2d");o.fillStyle=e.fill;for(var s=i.buffer.getChannelData(0),u=Math.ceil(s.length/e.width),c=e.height/2,l=0;lp&&(p=m)}o.fillRect(l,(1+h)*c,1,Math.max(1,(p-h)*c))}return r},resolveUrl:L,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var n=N.from({singleInstance:!0});if(!(n.media instanceof w))return n;for(var r=n.media,i=n.context.audioContext.createBuffer(1,48e3*e,48e3),o=i.getChannelData(0),a=0;athis.app.screen.width&&(this.directionLeft=!0)}}]),n}();n.Text=p},{"pixi.js":"FmRY","../utils/APHExample":"Xu9H"}],SCPm:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.BitmapText=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=t("../utils/APHExample");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n=2*Math.PI&&(this.owner.rotation=0,this.sendMessage("ROTATION_FINISHED"),this.owner.resetFlag(1)))}}]),n}(),m=function(t){l(n,i.ECSExample);var e=h(n);function n(){return s(this,n),e.apply(this,arguments)}return c(n,[{key:"load",value:function(){var t=new r.Graphics;t.beginFill(16711680),t.drawRect(0,0,200,200),t.endFill(),t.pivot.set(100,100),t.position.set(.25*this.canvas.width,.5*this.canvas.height);var e=new r.Graphics;e.beginFill(255),e.drawRect(0,0,200,200),e.endFill(),e.pivot.set(100,100),e.position.set(.75*this.canvas.width,.5*this.canvas.height),t.addComponent(new d),t.setFlag(1),e.addComponent(new d),this.engine.scene.stage.addChild(t),this.engine.scene.stage.addChild(e)}}]),n}();n.Squares=m},{"../../libs/pixi-ecs":"KEu4","../utils/APHExample":"Xu9H"}],WrDt:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Graphics=void 0;var r,i,o,a=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=c();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),s=t("../utils/APHExample"),u=t("../../libs/pixi-ecs/components/key-input-component");function c(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return c=function(){return t},t}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n=o&&(c=i.LEFT);break;case i.DOWN:r.y+=u,s.bottom>=a&&(c=i.UP);break;case i.UP:r.y-=u,s.top<=0&&(c=i.DOWN)}n!==c&&this.modifyState({dir:c})}}}]),n}(),b=function(t){var e=new a.Graphics,n=(Math.floor(255*Math.random())<<16)+(Math.floor(255*Math.random())<<8)+Math.floor(255*Math.random()),i=Math.random()*(t.app.screen.width-40),o=Math.random()*(t.app.screen.height-40);e.beginFill(16777215),e.tint=n,Math.random()>.5?(e.drawRect(0,0,40,40),e.name="SQUARE",e.addTag("SQUARE")):(e.drawCircle(0,0,20),e.name="CIRCLE",e.addTag("CIRCLE")),e.endFill(),e.position.set(i,o);var s=Math.floor(4*Math.random());return e.addComponent(new g({dir:s,running:t.getGlobalAttribute(r.SCENE_STATE).isRunning})),e},x=function(t){d(n,a.Component);var e=m(n);function n(){return h(this,n),e.apply(this,arguments)}return p(n,[{key:"onInit",value:function(){this.keyInput=this.scene.findGlobalComponentByName(a.KeyInputComponent.name),this.emitObject(),this.emitObject(),this.emitObject()}},{key:"onUpdate",value:function(){if(this.keyInput.isKeyPressed(a.Keys.KEY_Q)&&(this.keyInput.handleKey(a.Keys.KEY_Q),this.changeDirection()),this.keyInput.isKeyPressed(a.Keys.KEY_W)){this.keyInput.handleKey(a.Keys.KEY_W);var t,e=this.scene.getGlobalAttribute(r.SCENE_STATE);e.isRunning?(t=!1,this.pauseScene()):(t=!0,this.resumeScene()),this.scene.assignGlobalAttribute(r.SCENE_STATE,Object.assign(Object.assign({},e),{isRunning:t}))}this.keyInput.isKeyPressed(a.Keys.KEY_E)&&(this.keyInput.handleKey(a.Keys.KEY_E),this.emitObject())}},{key:"emitObject",value:function(){var t=b(this.scene);this.scene.stage.addChild(t)}},{key:"changeDirection",value:function(){this.sendMessage(o.CHANGE_DIRECTION)}},{key:"pauseScene",value:function(){this.sendMessage(o.SCENE_PAUSE)}},{key:"resumeScene",value:function(){this.sendMessage(o.SCENE_RESUME)}}]),n}(),_=function(t){d(n,s.ECSExample);var e=m(n);function n(){return h(this,n),e.apply(this,arguments)}return p(n,[{key:"load",value:function(){this.engine.scene.assignGlobalAttribute(r.SCENE_STATE,{isRunning:!0}),this.engine.scene.addGlobalComponent(new u.KeyInputComponent),this.engine.scene.addGlobalComponent(new x)}}]),n}();n.Graphics=_},{"../../libs/pixi-ecs":"KEu4","../utils/APHExample":"Xu9H","../../libs/pixi-ecs/components/key-input-component":"DRet"}],cvv9:[function(t,e,n){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n>>0)/4294967296}},{key:"double",value:function(){var t;do{t=((this.next()>>>11)+(this.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t}},{key:"normalRadial",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=r(this.nextNormal(),2),o=i[0],a=i[1];if(1===n)return t+e*o;var s=n/Math.sqrt(1+n*n);return t+e*(s*o+Math.sqrt(1-s*s)*a)}},{key:"normal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.normalRadial((e-t)/2+t,(e-t)/7,n)}},{key:"uniform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t+((arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)-t)*this.float()}},{key:"uniformInt",value:function(t,e){return t+Math.floor((e-t+1)*this.float())}},{key:"nextNormal",value:function(){for(var t=0,e=0;0===t;)t=Math.random();for(;0===e;)e=Math.random();var n=Math.sqrt(-2*Math.log(t)),r=2*Math.PI*e;return[n*Math.cos(r),n*Math.sin(r)]}},{key:"next",value:function(){var t=this.x^this.x<<11;return this.x=this.y,this.y=this.z,this.z=this.w,this.w^=this.w>>>19^t^t>>>8}}]),t}();n.default=s},{}],euY0:[function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;r(this,t),this.gradients=[new a(1,1,0),new a(-1,1,0),new a(1,-1,0),new a(-1,-1,0),new a(1,0,1),new a(-1,0,1),new a(1,0,-1),new a(-1,0,-1),new a(0,1,1),new a(0,-1,1),new a(0,1,-1),new a(0,-1,-1)],this.periods=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],this.perm=new Array(512),this.gradP=new Array(512),this.seed(e)}return o(t,[{key:"seed",value:function(t){t>0&&t<1&&(t*=65536),(t=Math.floor(t))<256&&(t|=t<<8);for(var e=0;e<256;e++){var n;n=1&e?this.periods[e]^255&t:this.periods[e]^t>>8&255,this.perm[e]=this.perm[e+256]=n,this.gradP[e]=this.gradP[e+256]=this.gradients[n%12]}}},{key:"fade",value:function(t){return t*t*t*(t*(6*t-15)+10)}},{key:"lerp",value:function(t,e,n){return(1-n)*t+n*e}},{key:"rawNoise",value:function(t,e){var n=Math.floor(t),r=Math.floor(e);t-=n,e-=r,n&=255,r&=255;var i=this.gradP[n+this.perm[r]].dot2(t,e),o=this.gradP[n+this.perm[r+1]].dot2(t,e-1),a=this.gradP[n+1+this.perm[r]].dot2(t-1,e),s=this.gradP[n+1+this.perm[r+1]].dot2(t-1,e-1),u=this.fade(t);return this.lerp(this.lerp(i,a,u),this.lerp(o,s,u),this.fade(e))}},{key:"interpolatedNoise",value:function(t,e,n,r,i){for(var o=0,a=1/i,s=1,u=0;u1&&(o=1),o}},{key:"renderNoise",value:function(t,e,n,r,i,o,a){for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o(this,t),this.topRight=null,this.topLeft=null,this.bottomLeft=null,this.bottomRight=null,this.objects=new Array,this.bounds=e,this.maxObjects=n,this.maxLevels=r,this.level=i}return i(t,[{key:"insert",value:function(t){var e;if(null==this.topRight||-1===(e=this.getIndex(t))){if(this.objects.push(t),this.objects.length>this.maxObjects&&this.levelr;return t.xn&&(i?e=0:o&&(e=3)),e}}]),t}();n.QuadTree=a},{}],PEfu:[function(t,e,n){function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o(this,t),this.segments=new Array,null!=e&&null!=n&&this.addFirstSegment(e,n)}return i(t,[{key:"addFirstSegment",value:function(t,e){this.segments=new Array;var n=new a(t,e);this.segments.push(n),this.pathLength=n.length}},{key:"addSegment",value:function(t){var e=this.segments[this.segments.length-1],n=new a(e.end,t);this.segments.push(n),this.pathLength+=n.length}},{key:"calcTargetPoint",value:function(t,e,n){var r=this.segments[-1!==n.currentPointIndex?n.currentPointIndex:0];return-1===n.currentPointIndex&&e.distance(r.start)>t?(n.currentPointIndex=-1,void(n.targetLocation=r.start)):(-1===n.currentPointIndex&&(n.currentPointIndex=0),e.distance(r.end)>t?void(n.targetLocation=r.end):void(n.currentPointIndex===this.segments.length-1?n.targetLocation=e:(n.currentPointIndex=n.currentPointIndex+1,n.targetLocation=this.segments[n.currentPointIndex].end)))}}]),t}();n.Path=s},{}],XdEc:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.compareToEquals=n.makeString=n.defaultToString=n.reverseCompareFunction=n.isString=n.isUndefined=n.isFunction=n.defaultEquals=n.defaultCompare=n.has=void 0;var r=Object.prototype.hasOwnProperty,i=function(t,e){return r.call(t,e)};n.has=i;n.defaultCompare=function(t,e){return t1&&void 0!==arguments[1]?arguments[1]:",";if(null===t)return"COLLECTION_NULL";if(a(t))return"COLLECTION_UNDEFINED";if(s(t))return t.toString();var n="{",r=!0;for(var o in t)i(t,o)&&(r?r=!1:n+=e,n=n+o+":"+t[o]);return n+"}"};n.compareToEquals=function(t){return function(e,n){return 0===t(e,n)}}},{}],QooG:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.forEach=n.toString=n.swap=n.copy=n.equals=n.frequency=n.remove=n.contains=n.lastIndexOf=n.indexOf=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=r?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}(t("./struct-utils"));function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;o--)if(i(t[o],e))return o;return-1};n.contains=function(t,e,n){return u(t,e,n)>=0};n.remove=function(t,e,n){var r=u(t,e,n);return!(r<0||(t.splice(r,1),0))};n.frequency=function(t,e,n){for(var i=n||r.defaultEquals,o=t.length,a=0,s=0;s=t.length||n<0||n>=t.length)return!1;var r=t[e];return t[e]=t[n],t[n]=r,!0};n.toString=function(t){return"["+t.toString()+"]"};n.forEach=function(t,e){var n,r=o(t);try{for(r.s();!(n=r.n()).done;)if(!1===e(n.value))return}catch(s){r.e(s)}finally{r.f()}}},{"./struct-utils":"XdEc"}],sz5Q:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(t("./struct-utils")),i=a(t("./arrays"));function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function s(t,e){for(var n=0;nthis.nElements||r.isUndefined(t))return!1;var n=this.createNode(t);if(0===this.nElements||null===this.lastNode)this.firstNode=n,this.lastNode=n;else if(e===this.nElements)this.lastNode.next=n,this.lastNode=n;else if(0===e)n.next=this.firstNode,this.firstNode=n;else{var i=this.nodeAtIndex(e-1);if(null===i)return!1;n.next=i.next,i.next=n}return this.nElements++,!0}},{key:"first",value:function(){if(null!==this.firstNode)return this.firstNode.element}},{key:"last",value:function(){if(null!==this.lastNode)return this.lastNode.element}},{key:"elementAtIndex",value:function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element}},{key:"indexOf",value:function(t,e){var n=e||r.defaultEquals;if(r.isUndefined(t))return-1;for(var i=this.firstNode,o=0;null!==i;){if(n(i.element,t))return o;o++,i=i.next}return-1}},{key:"contains",value:function(t,e){return this.indexOf(t,e)>=0}},{key:"remove",value:function(t,e){var n=e||r.defaultEquals;if(this.nElements<1||r.isUndefined(t))return!1;for(var i=null,o=this.firstNode;null!==o;){if(n(o.element,t))return null===i?(this.firstNode=o.next,o===this.lastNode&&(this.lastNode=null)):o===this.lastNode?(this.lastNode=i,i.next=o.next,o.next=null):(i.next=o.next,o.next=null),this.nElements--,!0;i=o,o=o.next}return!1}},{key:"clear",value:function(){this.firstNode=null,this.lastNode=null,this.nElements=0}},{key:"equals",value:function(e,n){var i=n||r.defaultEquals;return e instanceof t&&this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,i)}},{key:"removeElementAtIndex",value:function(t){if(!(t<0||t>=this.nElements||null===this.firstNode||null===this.lastNode)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(t-1);null===n?(e=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(e=n.next.element,n.next=n.next.next)}return this.nElements--,e}}},{key:"forEach",value:function(t){for(var e=this.firstNode;null!==e&&!1!==t(e.element);)e=e.next}},{key:"reverse",value:function(){for(var t=null,e=this.firstNode,n=null;null!==e;)n=e.next,e.next=t,t=e,e=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n}},{key:"toArray",value:function(){for(var t=[],e=this.firstNode;null!==e;)t.push(e.element),e=e.next;return t}},{key:"size",value:function(){return this.nElements}},{key:"isEmpty",value:function(){return this.nElements<=0}},{key:"toString",value:function(){return i.toString(this.toArray())}},{key:"equalsAux",value:function(t,e,n){for(;null!==t&&null!==e;){if(!n(t.element,e.element))return!1;t=t.next,e=e.next}return!0}},{key:"nodeAtIndex",value:function(t){if(t<0||t>=this.nElements)return null;if(t===this.nElements-1)return this.lastNode;for(var e=this.firstNode,n=0;n0?this.data[0]:void 0}},{key:"add",value:function(t){return!r.isUndefined(t)&&(this.data.push(t),this.siftUp(this.data.length-1),!0)}},{key:"removeRoot",value:function(){if(this.data.length>0){var t=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),t}}},{key:"contains",value:function(t){var e=r.compareToEquals(this.compare);return i.contains(this.data,t,e)}},{key:"size",value:function(){return this.data.length}},{key:"isEmpty",value:function(){return this.data.length<=0}},{key:"clear",value:function(){this.data.length=0}},{key:"forEach",value:function(t){i.forEach(this.data,t)}},{key:"leftChildIndex",value:function(t){return 2*t+1}},{key:"rightChildIndex",value:function(t){return 2*t+2}},{key:"parentIndex",value:function(t){return Math.floor((t-1)/2)}},{key:"minIndex",value:function(t,e){return e>=this.data.length?t>=this.data.length?-1:t:this.compare(this.data[t],this.data[e])<=0?t:e}},{key:"siftUp",value:function(t){for(var e=this.parentIndex(t);t>0&&this.compare(this.data[e],this.data[t])>0;)i.swap(this.data,e,t),t=e,e=this.parentIndex(t)}},{key:"siftDown",value:function(t){for(var e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t));e>=0&&this.compare(this.data[t],this.data[e])>0;)i.swap(this.data,e,t),t=e,e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t))}}]),t}();n.default=u},{"./struct-utils":"XdEc","./arrays":"QooG"}],BKea:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("./struct-utils")),i=function(t){return t&&t.__esModule?t:{default:t}}(t("./heap"));function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n4&&void 0!==arguments[4]?arguments[4]:"manhattan",a=arguments.length>5?arguments[5]:void 0,u=new i.default((function(t,e){return t.second===e.second?0:t.second=this.width||t.y<0||t.y>=this.height}},{key:"getElevation",value:function(t){var e=this.indexMapper(t);return this.elevations.has(e)?this.elevations.get(this.indexMapper(t)):this.defaultElevation}},{key:"setElevation",value:function(t,e){this.elevations.set(this.indexMapper(t),e)}},{key:"addObstruction",value:function(t){this.obstructions.add(this.indexMapper(t))}},{key:"removeObstruction",value:function(t){this.obstructions.delete(this.indexMapper(t))}},{key:"getCost",value:function(t,e){return this.elevations.has(this.indexMapper(t))?this.elevations.get(this.indexMapper(t)):this.defaultElevation}},{key:"getNeighbors",value:function(t){var e=new Array;if(1===this.mapType){var n=new r.default(t.x-1,t.y),i=new r.default(t.x+1,t.y),o=new r.default(t.x,t.y-1),a=new r.default(t.x,t.y+1);this.isInside(n)&&!this.obstructions.has(this.indexMapper(n))&&e.push(n),this.isInside(i)&&!this.obstructions.has(this.indexMapper(i))&&e.push(i),this.isInside(o)&&!this.obstructions.has(this.indexMapper(o))&&e.push(o),this.isInside(a)&&!this.obstructions.has(this.indexMapper(a))&&e.push(a)}else if(2===this.mapType){var s=new r.default(t.x-1,t.y),u=new r.default(t.x+1,t.y),c=new r.default(t.x,t.y-1),l=new r.default(t.x,t.y+1),h=new r.default(t.x-1,t.y-1),f=new r.default(t.x+1,t.y+1),p=new r.default(t.x+1,t.y-1),d=new r.default(t.x-1,t.y+1);this.isInside(s)&&!this.obstructions.has(this.indexMapper(s))&&e.push(s),this.isInside(u)&&!this.obstructions.has(this.indexMapper(u))&&e.push(u),this.isInside(c)&&!this.obstructions.has(this.indexMapper(c))&&e.push(c),this.isInside(l)&&!this.obstructions.has(this.indexMapper(l))&&e.push(l),this.isInside(h)&&!this.obstructions.has(this.indexMapper(h))&&e.push(h),this.isInside(f)&&!this.obstructions.has(this.indexMapper(f))&&e.push(f),this.isInside(p)&&!this.obstructions.has(this.indexMapper(p))&&e.push(p),this.isInside(d)&&!this.obstructions.has(this.indexMapper(d))&&e.push(d)}return e}},{key:"isInside",value:function(t){return 0<=t.x&&t.x=1e3&&o.finish()})))}}]),n}(),y=function(t){h(n,m);var e=f(n);function n(){return u(this,n),e.apply(this,arguments)}return l(n,[{key:"generateNumber",value:function(t,e){return this.random.normal(t,e,1)}}]),n}();n.DistributionNormal=y;var v=function(t){h(n,m);var e=f(n);function n(){return u(this,n),e.apply(this,arguments)}return l(n,[{key:"generateNumber",value:function(t,e){return this.random.uniform(t,e)}}]),n}();n.DistributionUniform=v},{"../../libs/pixi-ecs":"KEu4","../utils/APHExample":"Xu9H","../../libs/aph-math":"DwxV"}],uAMK:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Pathfinding=n.Heuristics=n.DistanceMeasurement=n.PathAlgorithm=n.MapType=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=a();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=t("../utils/APHExample"),o=t("./../../libs/aph-math");function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.app.screen.width||c.x<0)&&(c.vx*=-1),(c.y>t.app.screen.height||c.y<0)&&(c.vy*=-1),n.insert(c)}}catch(h){s.e(h)}finally{s.f()}}))).withComponent(new r.FuncComponent("Renderer").doOnUpdate((function(t,e,r){var o=t.owner.asGraphics();o.clear(),o.beginFill(15298415);var a,s=u(i);try{for(s.s();!(a=s.n()).done;){var c=a.value;o.drawCircle(c.x,c.y,4)}}catch(h){s.e(h)}finally{s.f()}o.endFill(),o.lineStyle(1,4694485),function t(e,n){null==n.topRight?e.drawRect(n.bounds.x,n.bounds.y,n.bounds.width,n.bounds.height):(t(e,n.topLeft),t(e,n.topRight),t(e,n.bottomLeft),t(e,n.bottomRight))}(o,n)}))).asGraphics().withParent(t.stage).build()}}]),n}();n.QuadTreeView=y},{"../../libs/pixi-ecs":"KEu4","../utils/APHExample":"Xu9H","../../libs/aph-math":"DwxV"}],BCGB:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.colors=void 0;n.colors={midnightLight:"#3a414e",midnight:"#121824",midnightDark:"#03060c",white:"#ffffff",goldenrodLight:"#ffd179",goldenrod:"#fbb227",goldenrodDark:"#a96f00",tomatoLight:"#ff867f",tomato:"#cf2f25",tomatoDark:"#7d0600",lemonLight:"#fffdc8",lemon:"#e9e56f",lemonDark:"#a19d22",emeraldLight:"#a0f1c6",emerald:"#47d58a",emeraldDark:"#009244",aquaLight:"#86ecec",aqua:"#30d2d5",aquaDark:"#00a0a0",royalLight:"#c9d4fb",royal:"#6f8ce9",royalDark:"#4d6fdc",azureLight:"#7893ea",azure:"#2c57df",azureDark:"#0a2c9d",manhattanLight:"#fff2e6",manhattan:"#f6c9a0",manhattanDark:"#a56b36",rhino100:"#1d232d",rhino90:"#2f3744",rhino80:"#535e70",rhino60:"#7b8694",rhino40:"#a6aeb8",rhino20:"#d2d6dc",rhino10:"#e8eaec",rhino5:"#f3f4f5"}},{}],Ojj4:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Missile=n.IntegrationType=void 0;var r,i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),o=t("../utils/APHExample"),a=t("../utils/colors");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n=Math.max(this.positionMemory.length-1-o,0);s--){var u=this.positionMemory[s];r.lineTo(u.x-this.owner.position.x,u.y-this.owner.position.y)}this.positionMemory.push(new i.Vector(r.position.x,r.position.y)),this.owner.getBounds().bottom>=3*this.scene.app.screen.height&&(this.owner.destroy(),this.finish())}}]),n}(),v=function(t){f(n,y);var e=p(n);function n(){return c(this,n),e.apply(this,arguments)}return h(n,[{key:"updateDynamics",value:function(t){var e=this.state.velocity.clone();this.state.velocity=this.state.velocity.add(this.state.acceleration.multiply(t)),this.state.position=this.state.position.add(e.multiply(t))}}]),n}(),g=function(t){f(n,y);var e=p(n);function n(){return c(this,n),e.apply(this,arguments)}return h(n,[{key:"updateDynamics",value:function(t){var e=this.state.velocity.clone();this.state.velocity=this.state.velocity.add(this.state.acceleration.multiply(t)),this.state.position=this.state.position.add(e.add(this.state.velocity).multiply(.5*t))}}]),n}(),b=function(t){f(n,y);var e=p(n);function n(){return c(this,n),e.apply(this,arguments)}return h(n,[{key:"updateDynamics",value:function(t){this.state.velocity=this.state.velocity.add(this.state.acceleration.multiply(t)),this.state.position=this.state.position.add(this.state.velocity.multiply(t))}}]),n}(),x=function(t){f(n,i.Component);var e=p(n);function n(t){var r;return c(this,n),(r=e.call(this)).fixedFrequency=.5,r.particleFreq=t,r}return h(n,[{key:"onFixedUpdate",value:function(t,e){this.createProjectile(a.colors.lemon,1,r.EULER_EXPLICIT),this.createProjectile(a.colors.royal,1,r.EULER_IMPROVED),this.createProjectile(a.colors.tomatoLight,1,r.EULER_IMPLICIT)}},{key:"createProjectile",value:function(t,e,n){var o,a=Math.sqrt(this.scene.app.screen.width)*Math.cos(this.owner.rotation)*4,s=Math.sqrt(this.scene.app.screen.width)*Math.sin(this.owner.rotation)*4,u=new i.Vector(a,s),c=new i.Vector(0,.75*Math.sqrt(this.scene.app.screen.height)),l=new i.Graphics;switch(l.pivot.set(1,1),l.alpha=e,n){case r.EULER_EXPLICIT:o=new v({color:t,velocity:u,acceleration:c});break;case r.EULER_IMPLICIT:o=new b({color:t,velocity:u,acceleration:c});break;case r.EULER_IMPROVED:o=new g({color:t,velocity:u,acceleration:c})}o.fixedFrequency=this.particleFreq,new i.Builder(this.scene).localPos(this.owner.position.x,this.owner.position.y).withComponent(o).withParent(this.scene.stage).buildInto(l)}}]),n}(),_=function(t){f(n,o.ECSExample);var e=p(n);function n(t){return c(this,n),e.call(this,t)}return h(n,[{key:"load",value:function(){var t=this.engine.config.frequency,e=new i.Graphics;e.beginFill(PIXI.utils.string2hex(a.colors.rhino80)),e.drawPolygon([0,0,40,0,40,20,0,20,0,0]),e.endFill(),e.pivot.set(e.width/2,e.height/2),e.position.set(.03*this.engine.scene.app.screen.width,.9*this.engine.scene.app.screen.height),e.rotation=-Math.PI/3,e.addComponent(new x(t)),this.engine.scene.stage.addChild(e)}}]),n}();n.Missile=_},{"../../libs/pixi-ecs":"KEu4","../utils/APHExample":"Xu9H","../utils/colors":"BCGB"}],zrRr:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Rotation=n.IntegrationType=void 0;var r,i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),o=t("../utils/APHExample"),a=t("../utils/colors");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;no.right&&this.velocity.x>0&&(this.owner.position.x-=o.width+i.width),i.bottomo.bottom&&this.velocity.y>0&&(this.owner.position.y-=o.height+i.height)}}},{key:"applyVelocity",value:function(t,e){this.velocity=this.velocity.add(this.acceleration.multiply(.001*t*e))}},{key:"applyPosition",value:function(t,e){var n=this.velocity.multiply(.001*t*e);this.owner.position.x+=n.x,this.owner.position.y+=n.y}},{key:"velocity",get:function(){return this.owner.getAttribute(m)},set:function(t){this.owner.assignAttribute(m,t)}},{key:"acceleration",get:function(){return this.owner.getAttribute(y)},set:function(t){this.owner.assignAttribute(y,t)}}]),n}();n.SteeringComponentBase=v;var g=function(t){h(n,v);var e=f(n);function n(){return s(this,n),e.apply(this,arguments)}return c(n,[{key:"calcForce",value:function(t){var e=new r.Vector(this.props.target.position.x,this.props.target.position.y),n=new r.Vector(this.owner.position.x,this.owner.position.y),o=i.Steering.seek(e,n,this.velocity,1e3,null).limit(5);return e.distance(n)<1?(this.finish(),null):o}}]),n}();n.SeekComponent=g;var b=function(t){h(n,v);var e=f(n);function n(){return s(this,n),e.apply(this,arguments)}return c(n,[{key:"calcForce",value:function(t){var e=new r.Vector(this.props.target.position.x,this.props.target.position.y),n=new r.Vector(this.owner.position.x,this.owner.position.y),o=this.props.target.getAttribute(m);return i.Steering.evade(e,n,30,this.velocity,o)}}]),n}();n.EvadeComponent=b;var x=function(t){h(n,v);var e=f(n);function n(){return s(this,n),e.apply(this,arguments)}return c(n,[{key:"calcForce",value:function(t){var e=new r.Vector(this.props.target.position.x,this.props.target.position.y),n=new r.Vector(this.owner.position.x,this.owner.position.y),o=this.props.target.getAttribute(m);return i.Steering.pursuit(e,n,300,this.velocity,o)}}]),n}();n.PursuitComponent=x;var _=function(t){h(n,v);var e=f(n);function n(){var t;return s(this,n),(t=e.apply(this,arguments)).wanderTarget=new r.Vector(0,0),t}return c(n,[{key:"onUpdate",value:function(t,e){l(d(n.prototype),"onUpdate",this).call(this,t,e);var r=Math.atan2(this.acceleration.y,this.acceleration.x),i=Math.atan2(this.velocity.y,this.velocity.x);this.props.dot||(this.props.boid.rotation=i),this.props.dot&&this.props.dot.position.set(this.props.distance+Math.cos(r-i)*this.props.radius,Math.sin(r-i)*this.props.radius),this.props.circle&&this.props.circle.position.set(this.props.distance,0)}},{key:"calcForce",value:function(t){var e=i.Steering.wander(this.velocity,this.wanderTarget,this.props.radius,this.props.distance,this.props.jittering,t);return this.wanderTarget=e[1],e[0]}}]),n}();n.WanderComponent=_},{"../../libs/pixi-ecs":"KEu4","../../libs/aph-math":"DwxV"}],TW4b:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.SteeringCombined=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=a();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=t("../utils/APHExample"),o=t("./steering-base");function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n.5&&0!==this.objects.length){var i=this.objects[Math.floor(Math.random()*(this.objects.length-1))];e.addComponent(new o.PursuitComponent({target:i,speed:10})),n++}else if(Math.random()>.7&&0!==this.objects.length){var a=this.objects[Math.floor(Math.random()*(this.objects.length-1))];e.addComponent(new o.EvadeComponent({target:a,speed:8})),n++}Math.random()>.5&&(e.addComponent(new o.WanderComponent({speed:10,initialVelocity:new r.Vector(1,1),distance:100*Math.random(),radius:50*Math.random(),jittering:Math.random(),boid:e})),n++),0!==n&&(this.objects.push(e),t.stage.addChild(e))}}]),n}();n.SteeringCombined=d},{"../../libs/pixi-ecs":"KEu4","../utils/APHExample":"Xu9H","./steering-base":"iwBk"}],JsJY:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.SteeringSeek=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=t("../utils/APHExample"),o=t("./steering-base"),a=t("../utils/colors");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n0&&o.rotateAbout(a.position,n,t.position,a.position)}},r.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=o.magnitude(t.velocity)},r.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},r.translate=function(t,e){r.setPosition(t,o.add(t.position,e))},r.rotate=function(t,e,n){if(n){var i=Math.cos(e),o=Math.sin(e),a=t.position.x-n.x,s=t.position.y-n.y;r.setPosition(t,{x:n.x+(a*i-s*o),y:n.y+(a*o+s*i)}),r.setAngle(t,t.angle+e)}else r.setAngle(t,t.angle+e)},r.scale=function(t,e,n,o){var a=0,s=0;o=o||t.position;for(var l=0;l0&&(a+=h.area,s+=h.inertia),h.position.x=o.x+(h.position.x-o.x)*e,h.position.y=o.y+(h.position.y-o.y)*n,u.update(h.bounds,h.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(r.setMass(t,t.density*a),r.setInertia(t,s))),t.circleRadius&&(e===n?t.circleRadius*=e:t.circleRadius=null)},r.update=function(t,e,n,r){var a=Math.pow(e*n*t.timeScale,2),s=1-t.frictionAir*n*t.timeScale,l=t.position.x-t.positionPrev.x,h=t.position.y-t.positionPrev.y;t.velocity.x=l*s*r+t.force.x/t.mass*a,t.velocity.y=h*s*r+t.force.y/t.mass*a,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*s*r+t.torque/t.inertia*a,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=o.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(i.rotate(p.vertices,t.angularVelocity,t.position),c.rotate(p.axes,t.angularVelocity),f>0&&o.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),u.update(p.bounds,p.vertices,t.velocity)}},r.applyForce=function(t,e,n){t.force.x+=n.x,t.force.y+=n.y;var r=e.x-t.position.x,i=e.y-t.position.y;t.torque+=r*n.y-i*n.x},r._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},n=1===t.parts.length?0:1;n1?1:0;h1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},{"../geometry/Bounds":26,"./Pair":7,"./SAT":11}],6:[function(t,e,n){var r={};e.exports=r;var i=t("./Pair"),o=t("./Detector"),a=t("../core/Common");r.create=function(t){var e={controller:r,detector:o.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return a.extend(e,t)},r.update=function(t,e,n,i){var o,a,s,u,c,l=n.world,h=t.buckets,f=!1;for(o=0;ol.bounds.max.x||p.bounds.max.yl.bounds.max.y)){var d=r._getRegion(t,p);if(!p.region||d.id!==p.region.id||i){p.region&&!i||(p.region=d);var m=r._regionUnion(d,p.region);for(a=m.startCol;a<=m.endCol;a++)for(s=m.startRow;s<=m.endRow;s++){u=h[c=r._getBucketId(a,s)];var y=a>=d.startCol&&a<=d.endCol&&s>=d.startRow&&s<=d.endRow,v=a>=p.region.startCol&&a<=p.region.endCol&&s>=p.region.startRow&&s<=p.region.endRow;!y&&v&&v&&u&&r._bucketRemoveBody(t,u,p),(p.region===d||y&&!v||i)&&(u||(u=r._createBucket(h,c)),r._bucketAddBody(t,u,p))}p.region=d,f=!0}}}f&&(t.pairsList=r._createActivePairsList(t))},r.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},r._regionUnion=function(t,e){var n=Math.min(t.startCol,e.startCol),i=Math.max(t.endCol,e.endCol),o=Math.min(t.startRow,e.startRow),a=Math.max(t.endRow,e.endRow);return r._createRegion(n,i,o,a)},r._getRegion=function(t,e){var n=e.bounds,i=Math.floor(n.min.x/t.bucketWidth),o=Math.floor(n.max.x/t.bucketWidth),a=Math.floor(n.min.y/t.bucketHeight),s=Math.floor(n.max.y/t.bucketHeight);return r._createRegion(i,o,a,s)},r._createRegion=function(t,e,n,r){return{id:t+","+e+","+n+","+r,startCol:t,endCol:e,startRow:n,endRow:r}},r._getBucketId=function(t,e){return"C"+t+"R"+e},r._createBucket=function(t,e){return t[e]=[]},r._bucketAddBody=function(t,e,n){for(var r=0;r0?r.push(n):delete t.pairs[e[i]];return r}},{"../core/Common":14,"./Detector":5,"./Pair":7}],7:[function(t,e,n){var r={};e.exports=r;var i=t("./Contact");r.create=function(t,e){var n=t.bodyA,i=t.bodyB,o=t.parentA,a=t.parentB,s={id:r.id(n,i),bodyA:n,bodyB:i,contacts:{},activeContacts:[],separation:0,isActive:!0,isSensor:n.isSensor||i.isSensor,timeCreated:e,timeUpdated:e,inverseMass:o.inverseMass+a.inverseMass,friction:Math.min(o.friction,a.friction),frictionStatic:Math.max(o.frictionStatic,a.frictionStatic),restitution:Math.max(o.restitution,a.restitution),slop:Math.max(o.slop,a.slop)};return r.update(s,t,e),s},r.update=function(t,e,n){var o=t.contacts,a=e.supports,s=t.activeContacts,u=e.parentA,c=e.parentB;if(t.collision=e,t.inverseMass=u.inverseMass+c.inverseMass,t.friction=Math.min(u.friction,c.friction),t.frictionStatic=Math.max(u.frictionStatic,c.frictionStatic),t.restitution=Math.max(u.restitution,c.restitution),t.slop=Math.max(u.slop,c.slop),s.length=0,e.collided){for(var l=0;lr._pairMaxIdleLife&&c.push(a);for(a=0;ap.friction*p.frictionStatic*L*n&&(D=R,j=a.clamp(p.friction*I*n,-D,D));var N=o.cross(S,v),B=o.cross(T,v),F=x/(m.inverseMass+y.inverseMass+m.inverseInertia*N*N+y.inverseInertia*B*B);if(k*=F,j*=F,A<0&&A*A>r._restingThresh*n)w.normalImpulse=0;else{var U=w.normalImpulse;w.normalImpulse=Math.min(w.normalImpulse+k,0),k=w.normalImpulse-U}if(C*C>r._restingThreshTangent*n)w.tangentImpulse=0;else{var G=w.tangentImpulse;w.tangentImpulse=a.clamp(w.tangentImpulse+j,-D,D),j=w.tangentImpulse-G}i.x=v.x*k+g.x*j,i.y=v.y*k+g.y*j,m.isStatic||m.isSleeping||(m.positionPrev.x+=i.x*m.inverseMass,m.positionPrev.y+=i.y*m.inverseMass,m.anglePrev+=o.cross(S,i)*m.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=i.x*y.inverseMass,y.positionPrev.y-=i.y*y.inverseMass,y.anglePrev-=o.cross(T,i)*y.inverseInertia)}}}}},{"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],11:[function(t,e,n){var r={};e.exports=r;var i=t("../geometry/Vertices"),o=t("../geometry/Vector");r.collides=function(t,e,n){var a,s,u,c,l=!1;if(n){var h=t.parent,f=e.parent,p=h.speed*h.speed+h.angularSpeed*h.angularSpeed+f.speed*f.speed+f.angularSpeed*f.angularSpeed;l=n&&n.collided&&p<.2,c=n}else c={collided:!1,bodyA:t,bodyB:e};if(n&&l){var d=c.axisBody,m=d===t?e:t,y=[d.axes[n.axisNumber]];if(u=r._overlapAxes(d.vertices,m.vertices,y),c.reused=!0,u.overlap<=0)return c.collided=!1,c}else{if((a=r._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return c.collided=!1,c;if((s=r._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return c.collided=!1,c;a.overlapi?i=s:s=0?a.index-1:l.length-1],c.x=i.x-h.x,c.y=i.y-h.y,u=-o.dot(n,c),s=i,i=l[(a.index+1)%l.length],c.x=i.x-h.x,c.y=i.y-h.y,(r=-o.dot(n,c))0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=c.extend(a,e.render),e},r.preSolveAll=function(t){for(var e=0;e0&&(h.position.x+=c.x,h.position.y+=c.y),0!==c.angle&&(i.rotate(h.vertices,c.angle,n.position),u.rotate(h.axes,c.angle),l>0&&o.rotateAbout(h.position,c.angle,n.position,h.position)),s.update(h.bounds,h.vertices,n.velocity)}c.angle*=r._warming,c.x*=r._warming,c.y*=r._warming}}}},{"../core/Common":14,"../core/Sleeping":22,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],13:[function(t,e,n){var r={};e.exports=r;var i=t("../geometry/Vertices"),o=t("../core/Sleeping"),a=t("../core/Mouse"),s=t("../core/Events"),u=t("../collision/Detector"),c=t("./Constraint"),l=t("../body/Composite"),h=t("../core/Common"),f=t("../geometry/Bounds");r.create=function(t,e){var n=(t?t.mouse:null)||(e?e.mouse:null);n||(t&&t.render&&t.render.canvas?n=a.create(t.render.canvas):e&&e.element?n=a.create(e.element):(n=a.create(),h.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var i={type:"mouseConstraint",mouse:n,element:null,body:null,constraint:c.create({label:"Mouse Constraint",pointA:n.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),collisionFilter:{category:1,mask:4294967295,group:0}},o=h.extend(i,e);return s.on(t,"beforeUpdate",(function(){var e=l.allBodies(t.world);r.update(o,e),r._triggerEvents(o)})),o},r.update=function(t,e){var n=t.mouse,r=t.constraint,a=t.body;if(0===n.button){if(r.bodyB)o.set(r.bodyB,!1),r.pointA=n.position;else for(var c=0;c1?1:0;l0;e--){var n=Math.floor(r.random()*(e+1)),i=t[e];t[e]=t[n],t[n]=i}return t},r.choose=function(t){return t[Math.floor(r.random()*t.length)]},r.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},r.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.isFunction=function(t){return"function"==typeof t},r.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},r.isString=function(t){return"[object String]"===toString.call(t)},r.clamp=function(t,e,n){return tn?n:t},r.sign=function(t){return t<0?-1:1},r.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-r._nowStartTime},r.random=function(t,n){return n=void 0!==n?n:1,(t=void 0!==t?t:0)+e()*(n-t)};var e=function(){return r._seed=(9301*r._seed+49297)%233280,r._seed/233280};r.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.nextId=function(){return r._nextId++},r.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n0&&l.trigger(t,"collisionStart",{pairs:b.collisionStart}),a.preSolvePosition(b.list),i=0;i0&&l.trigger(t,"collisionActive",{pairs:b.collisionActive}),b.collisionEnd.length>0&&l.trigger(t,"collisionEnd",{pairs:b.collisionEnd}),r._bodiesClearForces(y),l.trigger(t,"afterUpdate",m),t},r.merge=function(t,e){if(p.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var n=h.allBodies(t.world),i=0;io?(i.warn("Plugin.register:",r.toString(e),"was upgraded to",r.toString(t)),r._registry[t.name]=t):n-1},r.isFor=function(t,e){var n=t.for&&r.dependencyParse(t.for);return!t.for||e.name===n.name&&r.versionSatisfies(e.version,n.range)},r.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var n=r.dependencies(t),o=i.topologicalSort(n),a=[],s=0;s0&&i.info(a.join(" "))}else i.warn("Plugin.use:",r.toString(t),"does not specify any dependencies to install.")},r.dependencies=function(t,e){var n=r.dependencyParse(t),o=n.name;if(!(o in(e=e||{}))){t=r.resolve(t)||t,e[o]=i.map(t.uses||[],(function(e){r.isPlugin(e)&&r.register(e);var o=r.dependencyParse(e),a=r.resolve(e);return a&&!r.versionSatisfies(a.version,o.range)?(i.warn("Plugin.dependencies:",r.toString(a),"does not satisfy",r.toString(o),"used by",r.toString(n)+"."),a._warned=!0,t._warned=!0):a||(i.warn("Plugin.dependencies:",r.toString(e),"used by",r.toString(n),"could not be resolved."),t._warned=!0),o.name}));for(var a=0;a=i[2];if("^"===n.operator)return i[0]>0?a[0]===i[0]&&o.number>=n.number:i[1]>0?a[1]===i[1]&&a[2]>=i[2]:a[2]===i[2]}return t===e||"*"===t}},{"./Common":14}],21:[function(t,e,n){var r={};e.exports=r;var i=t("./Events"),o=t("./Engine"),a=t("./Common");!function(){var t,e,n;"undefined"!=typeof window&&(t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),t||(t=function(t){n=setTimeout((function(){t(a.now())}),1e3/60)},e=function(){clearTimeout(n)}),r.create=function(t){var e=a.extend({fps:60,correction:1,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:!1,enabled:!0},t);return e.delta=e.delta||1e3/e.fps,e.deltaMin=e.deltaMin||1e3/e.fps,e.deltaMax=e.deltaMax||1e3/(.5*e.fps),e.fps=1e3/e.delta,e},r.run=function(e,n){return void 0!==e.positionIterations&&(n=e,e=r.create()),function i(o){e.frameRequestId=t(i),o&&e.enabled&&r.tick(e,n,o)}(),e},r.tick=function(t,e,n){var r,a=e.timing,s=1,u={timestamp:a.timestamp};i.trigger(t,"beforeTick",u),i.trigger(e,"beforeTick",u),t.isFixed?r=t.delta:(r=n-t.timePrev||t.delta,t.timePrev=n,t.deltaHistory.push(r),t.deltaHistory=t.deltaHistory.slice(-t.deltaSampleSize),s=(r=(r=(r=Math.min.apply(null,t.deltaHistory))t.deltaMax?t.deltaMax:r)/t.delta,t.delta=r),0!==t.timeScalePrev&&(s*=a.timeScale/t.timeScalePrev),0===a.timeScale&&(s=0),t.timeScalePrev=a.timeScale,t.correction=s,t.frameCounter+=1,n-t.counterTimestamp>=1e3&&(t.fps=t.frameCounter*((n-t.counterTimestamp)/1e3),t.counterTimestamp=n,t.frameCounter=0),i.trigger(t,"tick",u),i.trigger(e,"tick",u),e.world.isModified&&e.render&&e.render.controller&&e.render.controller.clear&&e.render.controller.clear(e.render),i.trigger(t,"beforeUpdate",u),o.update(e,r,s),i.trigger(t,"afterUpdate",u),e.render&&e.render.controller&&(i.trigger(t,"beforeRender",u),i.trigger(e,"beforeRender",u),e.render.controller.world(e.render),i.trigger(t,"afterRender",u),i.trigger(e,"afterRender",u)),i.trigger(t,"afterTick",u),i.trigger(e,"afterTick",u)},r.stop=function(t){e(t.frameRequestId)},r.start=function(t,e){r.run(t,e)}}()},{"./Common":14,"./Engine":15,"./Events":16}],22:[function(t,e,n){var r={};e.exports=r;var i=t("./Events");r._motionWakeThreshold=.18,r._motionSleepThreshold=.08,r._minBias=.9,r.update=function(t,e){for(var n=e*e*e,i=0;i0&&o.motion=o.sleepThreshold&&r.set(o,!0)):o.sleepCounter>0&&(o.sleepCounter-=1)}else r.set(o,!1)}},r.afterCollisions=function(t,e){for(var n=e*e*e,i=0;ir._motionWakeThreshold*n&&r.set(c,!1)}}}},r.set=function(t,e){var n=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,n||i.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,n&&i.trigger(t,"sleepEnd"))}},{"./Events":16}],23:[function(t,e,n){var r={};e.exports=r;var i,o=t("../geometry/Vertices"),a=t("../core/Common"),s=t("../body/Body"),u=t("../geometry/Bounds"),c=t("../geometry/Vector");r.rectangle=function(t,e,n,r,i){i=i||{};var u={label:"Rectangle Body",position:{x:t,y:e},vertices:o.fromPath("L 0 0 L "+n+" 0 L "+n+" "+r+" L 0 "+r)};if(i.chamfer){var c=i.chamfer;u.vertices=o.chamfer(u.vertices,c.radius,c.quality,c.qualityMin,c.qualityMax),delete i.chamfer}return s.create(a.extend({},u,i))},r.trapezoid=function(t,e,n,r,i,u){u=u||{};var c,l=n*(i*=.5),h=l+(1-2*i)*n,f=h+l;c=i<.5?"L 0 0 L "+l+" "+-r+" L "+h+" "+-r+" L "+f+" 0":"L 0 0 L "+h+" "+-r+" L "+f+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:o.fromPath(c)};if(u.chamfer){var d=u.chamfer;p.vertices=o.chamfer(p.vertices,d.radius,d.quality,d.qualityMin,d.qualityMax),delete u.chamfer}return s.create(a.extend({},p,u))},r.circle=function(t,e,n,i,o){i=i||{};var s={label:"Circle Body",circleRadius:n};o=o||25;var u=Math.ceil(Math.max(10,Math.min(o,n)));return u%2==1&&(u+=1),r.polygon(t,e,u,n,a.extend({},s,i))},r.polygon=function(t,e,n,i,u){if(u=u||{},n<3)return r.circle(t,e,i,u);for(var c=2*Math.PI/n,l="",h=.5*c,f=0;f0&&o.area(S)1?(p=s.create(a.extend({parts:d.slice(0)},r)),s.setPosition(p,{x:t,y:e}),p):d[0]}},{"../body/Body":1,"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],24:[function(t,e,n){var r={};e.exports=r;var i=t("../body/Composite"),o=t("../constraint/Constraint"),a=t("../core/Common"),s=t("../body/Body"),u=t("./Bodies");r.stack=function(t,e,n,r,o,a,u){for(var c,l=i.create({label:"Stack"}),h=t,f=e,p=0,d=0;dm&&(m=g),s.translate(v,{x:.5*b,y:.5*g}),h=v.bounds.max.x+o,i.addBody(l,v),c=v,p+=1}else h+=o}f+=m+a,h=t}return l},r.chain=function(t,e,n,r,s,u){for(var c=t.bodies,l=1;l0)for(c=0;c0&&(f=p[c-1+(u-1)*e],i.addConstraint(t,o.create(a.extend({bodyA:f,bodyB:h},s)))),r&&cf||a<(c=f-c)||a>n-1-c))return 1===h&&s.translate(l,{x:(a+(n%2==1?1:-1))*p,y:0}),u(t+(l?a*p:0)+a*o,r,a,c,l,h)}))},r.newtonsCradle=function(t,e,n,r,a){for(var s=i.create({label:"Newtons Cradle"}),c=0;ct.max.x&&(t.max.x=i.x),i.xt.max.y&&(t.max.y=i.y),i.y0?t.max.x+=n.x:t.min.x+=n.x,n.y>0?t.max.y+=n.y:t.min.y+=n.y)},r.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},r.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},r.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},r.shift=function(t,e){var n=t.max.x-t.min.x,r=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+n,t.min.y=e.y,t.max.y=e.y+r}},{}],27:[function(t,e,n){var r={};e.exports=r,t("../geometry/Bounds");var i=t("../core/Common");r.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||i.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var n,o,a,s,u,c,l,h,f,p,d,m=[],y=0,v=0,g=0;e=e||15;var b=function(t,e,n){var r=n%2==1&&n>1;if(!f||t!=f.x||e!=f.y){f&&r?(p=f.x,d=f.y):(p=0,d=0);var i={x:p+t,y:d+e};!r&&f||(f=i),m.push(i),v=p+t,g=d+e}},x=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,g=t.y;break;case"H":v=t.x;break;case"V":g=t.y}b(v,g,t.pathSegType)}};for(r._svgPathToAbsolute(t),a=t.getTotalLength(),c=[],n=0;n0)return!1}return!0},r.scale=function(t,e,n,o){if(1===e&&1===n)return t;var a,s;o=o||r.centre(t);for(var u=0;u=0?u-1:t.length-1],l=t[u],h=t[(u+1)%t.length],f=e[u0&&(o|=2),3===o)return!1;return 0!==o||null},r.hull=function(t){var e,n,r=[],o=[];for((t=t.slice(0)).sort((function(t,e){var n=t.x-e.x;return 0!==n?n:t.y-e.y})),n=0;n=2&&i.cross3(o[o.length-2],o[o.length-1],e)<=0;)o.pop();o.push(e)}for(n=t.length-1;n>=0;n-=1){for(e=t[n];r.length>=2&&i.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return r.pop(),o.pop(),r.concat(o)}},{"../core/Common":14,"../geometry/Vector":28}],30:[function(t,e,n){var r=e.exports=t("../core/Matter");r.Body=t("../body/Body"),r.Composite=t("../body/Composite"),r.World=t("../body/World"),r.Contact=t("../collision/Contact"),r.Detector=t("../collision/Detector"),r.Grid=t("../collision/Grid"),r.Pairs=t("../collision/Pairs"),r.Pair=t("../collision/Pair"),r.Query=t("../collision/Query"),r.Resolver=t("../collision/Resolver"),r.SAT=t("../collision/SAT"),r.Constraint=t("../constraint/Constraint"),r.MouseConstraint=t("../constraint/MouseConstraint"),r.Common=t("../core/Common"),r.Engine=t("../core/Engine"),r.Events=t("../core/Events"),r.Mouse=t("../core/Mouse"),r.Runner=t("../core/Runner"),r.Sleeping=t("../core/Sleeping"),r.Plugin=t("../core/Plugin"),r.Bodies=t("../factory/Bodies"),r.Composites=t("../factory/Composites"),r.Axes=t("../geometry/Axes"),r.Bounds=t("../geometry/Bounds"),r.Svg=t("../geometry/Svg"),r.Vector=t("../geometry/Vector"),r.Vertices=t("../geometry/Vertices"),r.Render=t("../render/Render"),r.RenderPixi=t("../render/RenderPixi"),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,r.Engine.run=r.Runner.run},{"../body/Body":1,"../body/Composite":2,"../body/World":3,"../collision/Contact":4,"../collision/Detector":5,"../collision/Grid":6,"../collision/Pair":7,"../collision/Pairs":8,"../collision/Query":9,"../collision/Resolver":10,"../collision/SAT":11,"../constraint/Constraint":12,"../constraint/MouseConstraint":13,"../core/Common":14,"../core/Engine":15,"../core/Events":16,"../core/Matter":17,"../core/Metrics":18,"../core/Mouse":19,"../core/Plugin":20,"../core/Runner":21,"../core/Sleeping":22,"../factory/Bodies":23,"../factory/Composites":24,"../geometry/Axes":25,"../geometry/Bounds":26,"../geometry/Svg":27,"../geometry/Vector":28,"../geometry/Vertices":29,"../render/Render":31,"../render/RenderPixi":32}],31:[function(t,e,n){var r={};e.exports=r;var i=t("../core/Common"),o=t("../body/Composite"),a=t("../geometry/Bounds"),s=t("../core/Events"),u=t("../collision/Grid"),c=t("../geometry/Vector"),l=t("../core/Mouse");!function(){var t,e;"undefined"!=typeof window&&(t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout((function(){t(i.now())}),1e3/60)},e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),r.create=function(t){var e={controller:r,engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,options:{width:800,height:600,pixelRatio:1,background:"#18181d",wireframeBackground:"#0f0f13",hasBounds:!!t.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showBroadphase:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showShadows:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},o=i.extend(e,t);return o.canvas&&(o.canvas.width=o.options.width||o.canvas.width,o.canvas.height=o.options.height||o.canvas.height),o.mouse=t.mouse,o.engine=t.engine,o.canvas=o.canvas||n(o.options.width,o.options.height),o.context=o.canvas.getContext("2d"),o.textures={},o.bounds=o.bounds||{min:{x:0,y:0},max:{x:o.canvas.width,y:o.canvas.height}},1!==o.options.pixelRatio&&r.setPixelRatio(o,o.options.pixelRatio),i.isElement(o.element)?o.element.appendChild(o.canvas):o.canvas.parentNode||i.log("Render.create: options.element was undefined, render.canvas was created but not appended","warn"),o},r.run=function(e){!function n(i){e.frameRequestId=t(n),r.world(e)}()},r.stop=function(t){e(t.frameRequestId)},r.setPixelRatio=function(t,e){var n=t.options,r=t.canvas;"auto"===e&&(e=h(r)),n.pixelRatio=e,r.setAttribute("data-pixel-ratio",e),r.width=n.width*e,r.height=n.height*e,r.style.width=n.width+"px",r.style.height=n.height+"px",t.context.scale(e,e)},r.lookAt=function(t,e,n,r){r=void 0===r||r,e=i.isArray(e)?e:[e],n=n||{x:0,y:0};for(var o={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},a=0;ao.max.x&&(o.max.x=c.x),u.yo.max.y&&(o.max.y=c.y))}var h=o.max.x-o.min.x+2*n.x,f=o.max.y-o.min.y+2*n.y,p=t.canvas.height,d=t.canvas.width/p,m=h/f,y=1,v=1;m>d?v=m/d:y=d/m,t.options.hasBounds=!0,t.bounds.min.x=o.min.x,t.bounds.max.x=o.min.x+h*y,t.bounds.min.y=o.min.y,t.bounds.max.y=o.min.y+f*v,r&&(t.bounds.min.x+=.5*h-h*y*.5,t.bounds.max.x+=.5*h-h*y*.5,t.bounds.min.y+=.5*f-f*v*.5,t.bounds.max.y+=.5*f-f*v*.5),t.bounds.min.x-=n.x,t.bounds.max.x-=n.x,t.bounds.min.y-=n.y,t.bounds.max.y-=n.y,t.mouse&&(l.setScale(t.mouse,{x:(t.bounds.max.x-t.bounds.min.x)/t.canvas.width,y:(t.bounds.max.y-t.bounds.min.y)/t.canvas.height}),l.setOffset(t.mouse,t.bounds.min))},r.startViewTransform=function(t){var e=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=e/t.options.width,i=n/t.options.height;t.context.scale(1/r,1/i),t.context.translate(-t.bounds.min.x,-t.bounds.min.y)},r.endViewTransform=function(t){t.context.setTransform(t.options.pixelRatio,0,0,t.options.pixelRatio,0,0)},r.world=function(t){var e,n=t.engine,i=n.world,h=t.canvas,f=t.context,d=t.options,m=o.allBodies(i),y=o.allConstraints(i),v=d.wireframes?d.wireframeBackground:d.background,g=[],b=[],x={timestamp:n.timing.timestamp};if(s.trigger(t,"beforeRender",x),t.currentBackground!==v&&p(t,v),f.globalCompositeOperation="source-in",f.fillStyle="transparent",f.fillRect(0,0,h.width,h.height),f.globalCompositeOperation="source-over",d.hasBounds){for(e=0;e=500){var u="";a.timing&&(u+="fps: "+Math.round(a.timing.fps)+" "),t.debugString=u,t.debugTimestamp=r.timing.timestamp}if(t.debugString){n.font="12px Arial",s.wireframes?n.fillStyle="rgba(255,255,255,0.5)":n.fillStyle="rgba(0,0,0,0.5)";for(var c=t.debugString.split("\n"),l=0;l1?1:0;a1?1:0;s1?1:0;o1?1:0;s1?1:0;o1?1:0;o1?1:0;i0)){var l=r.activeContacts[0].vertex.x,h=r.activeContacts[0].vertex.y;2===r.activeContacts.length&&(l=(r.activeContacts[0].vertex.x+r.activeContacts[1].vertex.x)/2,h=(r.activeContacts[0].vertex.y+r.activeContacts[1].vertex.y)/2),i.bodyB===i.supports[0].body||!0===i.bodyA.isStatic?s.moveTo(l-8*i.normal.x,h-8*i.normal.y):s.moveTo(l+8*i.normal.x,h+8*i.normal.y),s.lineTo(l,h)}u.wireframes?s.strokeStyle="rgba(255,165,0,0.7)":s.strokeStyle="orange",s.lineWidth=1,s.stroke()},r.separations=function(t,e,n){var r,i,o,a,s,u=n,c=t.options;for(u.beginPath(),s=0;s1?1:0;f0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0,u=arguments.length>3?arguments[3]:void 0;if(a(this,n),t=e.call(this,i),!o.parts)throw new Error("Body.parts is undefined");return t.body=o,t.world=s,t.options={fillStyle:u&&u.fillStyle?u.fillStyle:437914367,strokeStyle:u&&u.strokeStyle?u.strokeStyle:15328879,strokeStyleWireframe:u&&u.strokeStyleWireframe?u.strokeStyleWireframe:11316396,strokeStyleAngle:u&&u.showAngleIndicator?u&&u.strokeStyleAngle?u.strokeStyleAngle:13978951:void 0,lineWidth:u&&u.lineWidth?u.lineWidth:1,showWireframes:!u||!u.showWireframes||u.showWireframes,showAngleIndicator:!u||!u.showAngleIndicator||u.showAngleIndicator,showAxes:!(!u||!u.showAxes)&&u.showAxes},t.createBodyPrimitive(),t.addComponent(new r.FuncComponent("MatterSync").doOnUpdate((function(e,n,r){t.body.isStatic||(t.rotation=t.body.angle),t.position.x=t.body.position.x,t.position.y=t.body.position.y}))),t}return function(t,e,n){e&&s(t.prototype,e),n&&s(t,n)}(n,[{key:"createBodyPrimitive",value:function(){var t,e=this.options.fillStyle,n=this.options.strokeStyle,r=this.options.strokeStyleAngle,i=this.options.strokeStyleWireframe;this.clear();for(var o=this.body.parts.length>1?1:0;o0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;return h(this,n),(t=e.call(this,i)).constraint=o,t.world=a,t.options=s||new f,t.renderPrimitive(),t.addComponent(new r.FuncComponent("MatterSync").doOnUpdate((function(e,n,r){t.renderPrimitive()}))),t}return function(t,e,n){e&&a(t.prototype,e),n&&a(t,n)}(n,[{key:"renderPrimitive",value:function(){var t=PIXI.utils.string2hex(this.options.strokeStyle);this.clear();var e=this.constraint.bodyA,n=this.constraint.bodyB,r=this.constraint.pointA,i=this.constraint.pointB;this.beginFill(0,0),this.lineStyle(this.options.lineWidth,t,1),e?this.moveTo(e.position.x+r.x,e.position.y+r.y):this.moveTo(r.x,r.y),n?this.lineTo(n.position.x+i.x,n.position.y+i.y):i&&this.lineTo(i.x,i.y),this.endFill()}}]),n}();n.MatterConstraint=p},{"../pixi-ecs":"KEu4"}],DgcY:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MatterBind=void 0;var r=u(t("../pixi-ecs")),i=u(t("matter-js")),o=t("./matter-body"),a=t("./matter-constraint");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function c(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=l(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){if(t){if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&e.uniform()>.7&&(o={radius:10}),Math.round(e.uniform(0,1))){case 0:return e.uniform()<.8?i.Bodies.rectangle(t,n,e.uniform(25,50),e.uniform(25,50),{chamfer:o}):i.Bodies.rectangle(t,n,e.uniform(80,120),e.uniform(25,30),{chamfer:o});case 1:return i.Bodies.polygon(t,n,r,e.uniform(25,50),{chamfer:o})}}));i.World.add(t.mWorld,n),i.World.add(t.mWorld,[i.Bodies.rectangle(400,0,800,50,{isStatic:!0}),i.Bodies.rectangle(400,600,800,50,{isStatic:!0}),i.Bodies.rectangle(800,300,50,600,{isStatic:!0}),i.Bodies.rectangle(0,300,50,600,{isStatic:!0})])}}]),n}();n.MatterMixedShapes=y},{"../../libs/pixi-matter":"fFLf","matter-js":"RycP","../../libs/aph-math":"DwxV","../utils/APHExample":"Xu9H"}],O51L:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.ClothView=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=t("../utils/APHExample");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&function(t,e){(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l(t);if(e){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0){var p=this.cloth.particles[c*i+l],d=this.cloth.particles[c*i+(l-1)];this.cloth.constraints.push(new g(p,d,a))}if(c>0){var m=this.cloth.particles[c*i+l],b=this.cloth.particles[(c-1)*i+l];this.cloth.constraints.push(new g(m,b,a))}}for(var x=0;x=-this.props.platformHeight?r.Body.setPosition(n.body,{x:n.body.position.x,y:n.body.position.y-1}):r.Body.setPosition(n.body,{x:n.body.position.x,y:n.body.position.y+this.props.shift})}}]),n}(),g=function(t){p(n,i.Component);var e=d(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"onUpdate",value:function(t,e){var n=this.scene.stage.findComponentByName(i.KeyInputComponent.name),o=this.owner;n.isKeyPressed(i.Keys.KEY_LEFT)?r.Body.applyForce(o.body,{x:o.position.x,y:o.body.position.y},{x:-.03,y:0}):n.isKeyPressed(i.Keys.KEY_RIGHT)&&r.Body.applyForce(o.body,{x:o.position.x,y:o.body.position.y},{x:.03,y:0})}}]),n}(),b=function(t){p(n,a.ECSExample);var e=d(n);function n(){return l(this,n),e.apply(this,arguments)}return f(n,[{key:"load",value:function(){var t=new o.MatterBind;t.init(this.engine.scene,{mouseControl:!1,renderConstraints:!1,renderAngles:!1});for(var e=this.engine.scene.app.screen.width,n=this.engine.scene.app.screen.height,a=.3*e,s=.25*n,u=e-a,c=.1*n,l=Math.ceil(n/(c+s))+1,h=0;h=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=this.width||e<0||e>=this.height)&&0===this.data[e*this.width+t]}}]),t}(),p=function(){function t(){a(this,t),this.lastLoopCol=0,this.previewStep=8,this.previewDownScale=8,this.map=new f,this.player=new c(1,1)}return u(t,[{key:"init",value:function(t){this.canvas="string"==typeof t?document.getElementById(t):t,this.canvas.getContext&&(this.width=this.canvas.width,this.height=this.canvas.height,this.canvas.style.background="rgb(0, 0, 0)",this.ctx=this.canvas.getContext("2d")),this.player.init(),this.running=!0,this.loop()}},{key:"loop",value:function(){var t=this;this.running&&(requestAnimationFrame((function(){return t.loop()})),this.player.update(this.map),this.draw())}},{key:"destroy",value:function(){this.running=!1,document.removeEventListener("keydown",this.player.keyDown),document.removeEventListener("keyup",this.player.keyUp),this.player.destroy()}},{key:"draw",value:function(){this.ctx.clearRect(0,0,this.width,this.height),this.drawBackground();for(var t=[],e=0;e2&&void 0!==arguments[2]?arguments[2]:1,r=2*t/this.width-1,i=this.player.posX,o=this.player.posY,a=this.player.dirX+this.player.camX*r,s=this.player.dirY+this.player.camY*r,u=Math.floor(i),c=Math.floor(o),l=Math.sqrt(1+s*s/(a*a)),h=Math.sqrt(1+a*a/(s*s)),f=0,p=0,d=0,m=0;a<0?(d=-1,f=(i-u)*l):(d=1,f=(u+1-i)*l),s<0?(m=-1,p=(o-c)*h):(m=1,p=(c+1-o)*h);for(var y=!1;f0&&(g=this.map.getTextureByPosition(u,c).width-g-1),!y&&s<0&&(g=this.map.getTextureByPosition(u,c).width-g-1),this.drawWall(u,c,t,g,x,b,n)}},{key:"drawBackground",value:function(){var t=this.ctx.createLinearGradient(0,this.height/2,0,this.height);t.addColorStop(0,this.map.floor0),t.addColorStop(1,this.map.floor1),this.ctx.fillStyle=t,this.ctx.fillRect(0,this.height/2,this.width,this.height/2),(t=this.ctx.createLinearGradient(0,0,0,this.height/2)).addColorStop(1,this.map.ceiling0),t.addColorStop(0,this.map.ceiling1),this.ctx.fillStyle=t,this.ctx.fillRect(0,0,this.width,this.height/2)}},{key:"drawWall",value:function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,s=this.map.getTextureByPosition(t,e);this.ctx.drawImage(s,r,0,1,s.height,n,i,a,o);var u=1-1.6*o/this.height;this.ctx.fillStyle="rgba(0,0,0,"+u+")",this.ctx.fillRect(n,i,a,o)}},{key:"drawSprites",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.map.items.sorted(this.player.posX,this.player.posY),r=0;r=this.width&&(d=this.width-1);for(var m=f;m0&&m>0&&m1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return u(this,n),(r=e.call(this)).duration=0,r.goBack=!1,r.goingBack=!1,r.loops=0,r.currentLoop=0,r.startTime=0,r.interpolation=null,r.duration=t,r.goBack=o,r.loops=a,r.interpolation=i.Interpolation.linear,r}return l(n,[{key:"onUpdate",value:function(t,e){if(0===this.startTime&&(this.startTime=e),this.goingBack){var n=this.interpolation(e,this.startTime,this.duration);this.applyAnim(n,!0),n>=1&&(++this.currentLoop!==this.loops?(this.goingBack=!this.goingBack,this.startTime=e):this.finish())}else{var r=this.interpolation(e,this.startTime,this.duration);this.applyAnim(r,!1),r>=1&&(this.goBack?(this.goingBack=!0,this.startTime=e):this.finish())}}},{key:"applyAnim",value:function(t,e){}}]),n}();n.BaseAnimation=m;var y=function(t){h(n,m);var e=f(n);function n(t,r,i,o,a){var s,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1;return u(this,n),(s=e.call(this,a,c,l)).srcPosX=0,s.srcPosY=0,s.targetPosX=0,s.targetPosY=0,s.srcPosX=t,s.srcPosY=r,s.targetPosX=i,s.targetPosY=o,s}return l(n,[{key:"onInit",value:function(){s(d(n.prototype),"onInit",this).call(this),this.owner.position.x=this.srcPosX,this.owner.position.y=this.srcPosY}},{key:"applyAnim",value:function(t,e){e?(this.owner.position.x=this.targetPosX+t*(this.srcPosX-this.targetPosX),this.owner.position.y=this.targetPosY+t*(this.srcPosY-this.targetPosY)):(this.owner.position.x=this.srcPosX+t*(this.targetPosX-this.srcPosX),this.owner.position.y=this.srcPosY+t*(this.targetPosY-this.srcPosY))}}]),n}();n.TranslateAnimation=y;var v=function(t){h(n,m);var e=f(n);function n(t,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return u(this,n),(o=e.call(this,i,a,s)).srcRot=0,o.targetRot=0,o.srcRot=t,o.targetRot=r,o}return l(n,[{key:"onInit",value:function(){s(d(n.prototype),"onInit",this).call(this),this.owner.rotation=this.srcRot}},{key:"applyAnim",value:function(t,e){this.owner.rotation=e?this.targetRot+t*(this.srcRot-this.targetRot):this.srcRot+t*(this.targetRot-this.srcRot)}}]),n}();n.RotationAnimation=v},{"../../../libs/pixi-ecs":"KEu4","../../../libs/aph-math":"DwxV"}],f4Un:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.TweenRotation=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=s();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=t("../utils/APHExample"),o=t("./utils/animation"),a=t("../../libs/aph-math");function s(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return s=function(){return t},t}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:1,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new r.Vector(0,0);return u(this,n),(t=e.call(this)).gameSpeed=i,t.initialVelocity=o,t}return l(n,[{key:"onInit",value:function(){h(m(n.prototype),"onInit",this).call(this),this.owner.assignAttribute(v,this.initialVelocity),this.owner.assignAttribute(g,new r.Vector(0,0))}},{key:"onUpdate",value:function(t,e){var n=this.calcForce(t);if(null!=n){this.acceleration=n,this.acceleration=this.acceleration.limit(30),this.velocity=this.velocity.limit(30),this.applyVelocity(t,this.gameSpeed),this.applyPosition(t,this.gameSpeed);var r=Math.atan2(this.velocity.y,this.velocity.x);this.owner.rotation=r+Math.PI/2}}},{key:"applyVelocity",value:function(t,e){this.velocity=this.velocity.add(this.acceleration.multiply(.001*t*e))}},{key:"applyPosition",value:function(t,e){var n=this.velocity.multiply(.001*t*e);this.owner.position.x+=n.x,this.owner.position.y+=n.y}},{key:"velocity",get:function(){return this.owner.getAttribute(v)},set:function(t){this.owner.assignAttribute(v,t)}},{key:"acceleration",get:function(){return this.owner.getAttribute(g)},set:function(t){this.owner.assignAttribute(g,t)}}]),n}();n.SteeringComponent=b;var x=function(t){f(n,b);var e=p(n);function n(t,i,o,a){var s;return u(this,n),(s=e.call(this,10,new r.Vector(1,1))).wanderTarget=new r.Vector(0,0),s.angle=0,s.game=t,s.wanderDistance=i,s.wanderRadius=o,s.wanderJittering=a,s}return l(n,[{key:"calcForce",value:function(t){var e=i.Steering.wander(this.velocity,this.wanderTarget,this.wanderRadius,this.wanderDistance,this.wanderJittering,t);this.wanderTarget=e[1];var n=this.owner.getBounds(),o=this.game.worldToMap(n.x+n.width/2,n.y+n.height/2),a=this.owner.getAttribute(v),s=a.normalize(),u=o.add(s),c=new r.Vector(Math.round(u.x),Math.round(u.y));if(this.game.grid.notInside(c)||this.game.grid.hasObstruction(c)){var l=c.x!==o.x&&c.y!==o.y,h=c.y===o.y,f=c.x===o.x,p=Math.random()*a.magnitudeSquared();l?this.wanderTarget=new r.Vector(10*-a.x+p,10*-a.y+p):h?this.wanderTarget=new r.Vector(10*-a.x+p,10*a.y+p):f&&(this.wanderTarget=new r.Vector(10*a.x+p,10*-a.y+p))}return e[0]}}]),n}(),_=function(t){f(n,r.Component);var e=p(n);function n(){var t;return u(this,n),(t=e.apply(this,arguments)).changeFrequency=10,t.lastSwitchTime=0,t.currentFrame=0,t}return l(n,[{key:"onInit",value:function(){this.texture=this.owner.asSprite().texture,this.texture.frame=new PIXI.Rectangle(0,64,32,32)}},{key:"onUpdate",value:function(t,e){this.owner.getAttribute(v).magnitude()<1?this.texture.frame=new PIXI.Rectangle(0,64,32,32):(this.currentFrame=(this.currentFrame+1)%3,this.texture.frame=new PIXI.Rectangle(32*(this.currentFrame+1),64,32,32))}}]),n}(),w=function(t){f(n,r.Component);var e=p(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).fieldOfView=60,o.coneColor=i,o.bot=r,o.game=t,o}return l(n,[{key:"checkPosition",value:function(t){var e=this.game.worldToMap(Math.floor(t.x),Math.floor(t.y));return!(this.game.grid.notInside(e)||this.game.grid.hasObstruction(e))}},{key:"onUpdate",value:function(t,e){var n=new r.Vector(this.bot.position.x,this.bot.position.y),i=this.bot.getAttribute(v).normalize(),o=this.owner.asGraphics();o.clear(),o.beginFill(this.coneColor,.2);var a=this.fieldOfView/180*Math.PI,s=Math.max(this.game.grid.width,this.game.grid.height),u=Math.ceil(2*s/(Math.PI/2)*a);this.game.mapCellSize;for(var c=new Set,l=0;l0&&void 0!==arguments[0]?arguments[0]:new r.Vector(0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new r.Vector(0,0);i(this,t),this.velocity=e,this.aceleration=n}return a(t,[{key:"applyVelocity",value:function(t,e){this.velocity=this.velocity.add(this.aceleration.multiply(.001*t*e))}},{key:"calcPositionChange",value:function(t,e){return this.velocity.multiply(.001*t*e)}}]),t}();n.default=s},{"../../libs/pixi-ecs":"KEu4"}],HL1y:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../libs/pixi-ecs")),i=function(t){return t&&t.__esModule?t:{default:t}}(t("./dynamics"));function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1;return s(this,n),(r=e.call(this)).attrName=t,r.gameSpeed=i,r}return function(t,e,n){e&&u(t.prototype,e),n&&u(t,n)}(n,[{key:"onInit",value:function(){this.dynamics=this.owner.getAttribute(this.attrName),null==this.dynamics&&(this.dynamics=new i.default,this.owner.assignAttribute(this.attrName,this.dynamics))}},{key:"onUpdate",value:function(t,e){this.dynamics.applyVelocity(t,this.gameSpeed);var n=this.dynamics.calcPositionChange(t,this.gameSpeed);this.owner.pixiObj.position.x+=n.x,this.owner.pixiObj.position.y+=n.y}}]),n}();n.default=p},{"../../libs/pixi-ecs":"KEu4","./dynamics":"BM4r"}],ayQA:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.GameMap=n.MapBlock=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=a();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../../libs/pixi-ecs")),i=t("../../../libs/aph-math"),o=t("./constants");function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]&&arguments[1],r=[],i=s(this._cargoSources);try{for(i.s();!(e=i.n()).done;){var o=a(e.value,2)[1];o.type!==t||!n&&o.exhausted||r.push(o)}}catch(u){i.e(u)}finally{i.f()}return r}},{key:"getCargoSourceAtLocation",value:function(t){var e=this.map.gridMap.indexMapper(t);return this._cargoSources.has(e)?this._cargoSources.get(e):null}},{key:"loadCargo",value:function(t,e){e.currentCargo=t.type;var n=Math.min(t.currentAmount,e.capacity);e.amount=n,t.currentAmount-=n,e.currentCargo=t.type,t.type===o.CargoTypes.ORE?this._goingToLoadOre--:t.type===o.CargoTypes.PETROL&&this._goingToLoadPetrol--}},{key:"unloadCargo",value:function(t){t.currentCargo===o.CargoTypes.ORE?this.warehouseModel.ironOre+=t.amount:t.currentCargo===o.CargoTypes.PETROL&&(this.warehouseModel.petrol+=t.amount),t.amount=0}},{key:"notifyGoingToLoad",value:function(t,e){t.type===o.CargoTypes.ORE?this._goingToLoadOre++:t.type===o.CargoTypes.PETROL&&this._goingToLoadPetrol++}},{key:"addBot",value:function(t){this._bots.push(t),this._botsNum++}},{key:"botsNum",get:function(){return this._botsNum}},{key:"goingToLoadOre",get:function(){return this._goingToLoadOre}},{key:"goingToLoadPetrol",get:function(){return this._goingToLoadPetrol}},{key:"allBots",get:function(){return this._bots}}]),t}();n.GameModel=v},{"../../../libs/pixi-ecs":"KEu4","./gamemap":"ayQA","./constants":"OPW1"}],iVke:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.WarehouseState=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../../../libs/pixi-ecs")),i=t("../constants");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n2?f(y(n.prototype),"onUpdate",this).call(this,t,e):(this.dynamics.aceleration=new r.Vector(0,0),this.dynamics.velocity=new r.Vector(0,0))}},{key:"goToPoint",value:function(t,e,n){var o=new Array,a=new Array;this.gameModel.map.findPath(t,n,a,o);for(var s=this.gameModel.map.mapBlockToLocations(a),u=0;u1e3/n}}]),n}();n.BotAnim=p},{"../../../../libs/pixi-ecs":"KEu4","../constants":"OPW1"}],xQ8V:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.BotAI=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=a();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../../../libs/pixi-ecs")),i=t("./bot-ai-move"),o=t("../constants");function a(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return a=function(){return t},t}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;nthis.loadingDelay?(this.currentLoadingTime=0,this.currentTarget&&this.gameModel.loadCargo(this.currentTarget,this.botModel),o.BotStates.IDLE):(this.currentLoadingTime+=e,o.BotStates.LOADING)}},{key:"processUnloadingState",value:function(t,e,n){return this.currentLoadingTime>this.loadingDelay?(this.currentLoadingTime=0,this.gameModel.unloadCargo(this.botModel),this.currentTarget=null,o.BotStates.IDLE):(this.currentLoadingTime+=e,o.BotStates.UNLOADING)}},{key:"goLoad",value:function(){var t=this.gameModel.getCargoSourcesByType(o.CargoTypes.ORE),e=this.gameModel.getCargoSourcesByType(o.CargoTypes.PETROL),n=this.gameModel.warehouseModel.petrol,r=this.gameModel.warehouseModel.ironOre,i=n+this.gameModel.goingToLoadPetrol*this.botModel.capacity,a=r+this.gameModel.goingToLoadOre*this.botModel.capacity;this.currentTarget=i>a?t[Math.floor(Math.random()*t.length)]:e[Math.floor(Math.random()*e.length)],this.currentTarget&&(this.gameModel.notifyGoingToLoad(this.currentTarget,this.botModel),this.moveToTarget(this.currentTarget.position))}},{key:"goUnload",value:function(){var t=this.gameModel.warehouseModel.position;this.moveToTarget(new r.Vector(t.x,t.y))}},{key:"moveToTarget",value:function(t){var e=new r.Vector(this.owner.position.x,this.owner.position.y),n=this.worldToMap(e);this.moveComponent.goToPoint(n,e,t)}},{key:"worldToMap",value:function(t){return this.gameModel.map.locationToMapBlock(t)}},{key:"arrivedToTarget",get:function(){return this.moveComponent.pathFinished}},{key:"isBotLoaded",get:function(){return this.botModel.isLoaded}}]),n}();n.BotAI=d},{"../../../../libs/pixi-ecs":"KEu4","./bot-ai-move":"AfKx","../constants":"OPW1"}],du7Y:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Progress=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=r?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}(t("../../../../libs/pixi-ecs"));function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n=this.buildDelay){this.currentBuildTime=0,this.isBuilding=!1,this.model.warehouseModel.ironOre-=this.model.warehouseModel.agentIronCost,this.model.warehouseModel.petrol-=this.model.warehouseModel.agentPetrolCost;var n=this.factory.createBot(this.scene.stage,this.model,this.model.factoryModel.position);this.model.addBot(n)}}else this.model.warehouseModel.ironOre>=this.model.warehouseModel.agentIronCost&&this.model.warehouseModel.petrol>=this.model.warehouseModel.agentPetrolCost&&(this.isBuilding=!0)}}]),n}();n.FactoryBuilding=p},{"../../../../libs/pixi-ecs":"KEu4","../constants":"OPW1"}],Ya6M:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.CargoSource=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=r?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../../../libs/pixi-ecs")),i=t("../constants");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n20?1:this.model.currentAmount>0?.5:.1}}]),n}();n.CargoSource=f},{"../../../../libs/pixi-ecs":"KEu4","../constants":"OPW1"}],EUKZ:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.BotFactory=void 0;var r=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=v();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}(t("../../../libs/pixi-ecs")),i=t("./components/warehouse"),o=y(t("../../utils/dynamics-component")),a=t("./model"),s=t("./components/warehouse-state"),u=t("./constants"),c=t("./components/bot-ai-move"),l=t("./components/bot-anim"),h=t("./components/bot-ai"),f=y(t("../../utils/dynamics")),p=t("./components/progress"),d=t("./components/factory-building"),m=t("./components/cargo-source");function y(t){return t&&t.__esModule?t:{default:t}}function v(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return v=function(){return t},t}function g(t,e){for(var n=0;n=o&&e.x=a&&e.y0||(l[p]&1<0:(l[p]&1<0}},{key:"genHitMap",value:function(t,e){if(!t.resource)return!1;var n=t.resource.source,r=null;if(!n)return!1;var i=null;if(n.getContext)i=(r=n).getContext("2d");else{if(!(n instanceof Image))return!1;(r=document.createElement("canvas")).width=n.width,r.height=n.height,(i=r.getContext("2d")).drawImage(n,0,0)}for(var o=r.width,a=r.height,s=i.getImageData(0,0,o,a),u=new Uint32Array(Math.ceil(o*a/32)),c=0;c=e&&(u[f]|=1<=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne&&(o.push(u),u="",c=0),0===u.length?u+=h:u+=" "+h,c+=f+(s+n)}}catch(p){l.e(p)}finally{l.f()}return o.push(u),o}},{key:"calcWordLength",value:function(t){var e,n=0,i=r(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;n+=this.props.font.getCharData(o).width}}catch(s){i.e(s)}finally{i.f()}return n}}]),t}();n.DialogModel=s},{}],z91E:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.DialogController=n.Attributes=n.Assets=void 0;var r,i,o=c(t("pixi.js")),a=c(t("../../../libs/pixi-ecs")),s=t("./dialog-model");function u(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return u=function(){return t},t}function c(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=u();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=r?Object.getOwnPropertyDescriptor(t,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(181),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(28))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,c={},l=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n{const n=document.createElement("textarea"),r=document.activeElement;n.value=t,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const i=document.getSelection();let o=!1;i.rangeCount>0&&(o=i.getRangeAt(0)),e.append(n),n.select(),n.selectionStart=0,n.selectionEnd=t.length;let a=!1;try{a=document.execCommand("copy")}catch(s){}return n.remove(),o&&(i.removeAllRanges(),i.addRange(o)),r&&r.focus(),a};t.exports=r,t.exports.default=r},function(t,e){t.exports.parse=function(t){var e=t.split(",").map((function(t){return function(t){if(/^-?\d+$/.test(t))return parseInt(t,10);var e;if(e=t.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){var n=e[1],r=e[2],i=e[3];if(n&&i){var o=[],a=(n=parseInt(n))<(i=parseInt(i))?1:-1;"-"!=r&&".."!=r&&"\u2025"!=r||(i+=a);for(var s=n;s!=i;s+=a)o.push(s);return o}}return[]}(t)}));return 0===e.length?[]:1===e.length?Array.isArray(e[0])?e[0]:e:e.reduce((function(t,e){return Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]),t.concat(e)}))}}])]);